{"action":"created","issue":{"url":"https://api.github.com/repos/GoogleCloudPlatform/google-cloud-java/issues/2305","repository_url":"https://api.github.com/repos/GoogleCloudPlatform/google-cloud-java","labels_url":"https://api.github.com/repos/GoogleCloudPlatform/google-cloud-java/issues/2305/labels{/name}","comments_url":"https://api.github.com/repos/GoogleCloudPlatform/google-cloud-java/issues/2305/comments","events_url":"https://api.github.com/repos/GoogleCloudPlatform/google-cloud-java/issues/2305/events","html_url":"https://github.com/GoogleCloudPlatform/google-cloud-java/issues/2305","id":248104993,"number":2305,"title":"CloudStorage: ApiProxy$RPCFailedException: The remote RPC to the application server failed for the call urlfetch.Fetch().","user":{"login":"jbaldassari","id":307312,"avatar_url":"https://avatars1.githubusercontent.com/u/307312?v=4","gravatar_id":"","url":"https://api.github.com/users/jbaldassari","html_url":"https://github.com/jbaldassari","followers_url":"https://api.github.com/users/jbaldassari/followers","following_url":"https://api.github.com/users/jbaldassari/following{/other_user}","gists_url":"https://api.github.com/users/jbaldassari/gists{/gist_id}","starred_url":"https://api.github.com/users/jbaldassari/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jbaldassari/subscriptions","organizations_url":"https://api.github.com/users/jbaldassari/orgs","repos_url":"https://api.github.com/users/jbaldassari/repos","events_url":"https://api.github.com/users/jbaldassari/events{/privacy}","received_events_url":"https://api.github.com/users/jbaldassari/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2017-08-04T20:08:26Z","updated_at":"2017-08-04T20:22:36Z","closed_at":null,"body":"In a Java 8 flexible environment I'm trying to retrieve a file from cloud storage like this:\r\n\r\n```\r\n    private static byte[] retrieveFile(final String fileName) {\r\n        final Storage cloudStorage = StorageOptions.getDefaultInstance().getService();\r\n        final String bucketName = GcpProjects.getDefaultProjectId() + \"-data\";\r\n        try {\r\n            final Blob blob = cloudStorage.get(BlobId.of(bucketName, fileName));\r\n            if (!blob.exists()) {\r\n                throw new RuntimeException(fileName + \" not found in bucket \" + bucketName);\r\n            }\r\n            return blob.getContent();\r\n        } catch (StorageException e) {\r\n            throw new RuntimeException(\"Error obtaining \" + fileName + \" from bucket \" + bucketName, e);\r\n        }\r\n    }\r\n```\r\n\r\nThis worked fine for me in the J8 standard environment, but in the flexible environment the ```Storage.get(BlobId)``` call fails with:\r\n\r\n```\r\nCaused by: com.google.cloud.storage.StorageException: com.google.apphosting.api.ApiProxy$RPCFailedException: The remote RPC to the application server failed for the call urlfetch.Fetch().\r\n\tat com.google.cloud.storage.StorageException.translateAndThrow(StorageException.java:71) ~[google-cloud-storage-1.3.1.jar:1.3.1]\r\n\tat com.google.cloud.storage.StorageImpl.get(StorageImpl.java:196) ~[google-cloud-storage-1.3.1.jar:1.3.1]\r\n\tat com.google.cloud.storage.StorageImpl.get(StorageImpl.java:202) ~[google-cloud-storage-1.3.1.jar:1.3.1]\r\nCaused by: com.google.apphosting.api.ApiProxy$RPCFailedException: The remote RPC to the application server failed for the call urlfetch.Fetch().\r\n\tat com.google.apphosting.vmruntime.VmApiProxyDelegate.runSyncCall(VmApiProxyDelegate.java:175) ~[appengine-managed-runtime-1.9.40.sync-SNAPSHOT.jar:201703172103]\r\n\tat com.google.apphosting.vmruntime.VmApiProxyDelegate.makeApiCall(VmApiProxyDelegate.java:155) ~[appengine-managed-runtime-1.9.40.sync-SNAPSHOT.jar:201703172103]\r\n\tat com.google.apphosting.vmruntime.VmApiProxyDelegate.makeSyncCallWithTimeout(VmApiProxyDelegate.java:143) ~[appengine-managed-runtime-1.9.40.sync-SNAPSHOT.jar:201703172103]\r\n\tat com.google.apphosting.vmruntime.VmApiProxyDelegate.makeSyncCall(VmApiProxyDelegate.java:132) ~[appengine-managed-runtime-1.9.40.sync-SNAPSHOT.jar:201703172103]\r\n\tat com.google.apphosting.vmruntime.VmApiProxyDelegate.makeSyncCall(VmApiProxyDelegate.java:75) ~[appengine-managed-runtime-1.9.40.sync-SNAPSHOT.jar:201703172103]\r\n\tat com.google.apphosting.api.ApiProxy.makeSyncCall(ApiProxy.java:118) ~[appengine-api-1.0-sdk-1.9.40.jar:na]\r\n\tat com.google.appengine.api.urlfetch.URLFetchServiceImpl.fetch(URLFetchServiceImpl.java:40) ~[appengine-api-1.0-sdk-1.9.40.jar:na]\r\n\tat com.google.api.client.extensions.appengine.http.UrlFetchRequest.execute(UrlFetchRequest.java:74) ~[google-http-client-appengine-1.22.0.jar:1.22.0]\r\n\tat com.google.api.client.http.HttpRequest.execute(HttpRequest.java:981) ~[google-http-client-1.22.0.jar:1.22.0]\r\n\tat com.google.api.client.googleapis.services.AbstractGoogleClientRequest.executeUnparsed(AbstractGoogleClientRequest.java:419) ~[google-api-client-1.22.0.jar:1.22.0]\r\n\tat com.google.api.client.googleapis.services.AbstractGoogleClientRequest.executeUnparsed(AbstractGoogleClientRequest.java:352) ~[google-api-client-1.22.0.jar:1.22.0]\r\n\tat com.google.api.client.googleapis.services.AbstractGoogleClientRequest.execute(AbstractGoogleClientRequest.java:469) ~[google-api-client-1.22.0.jar:1.22.0]\r\n\tat com.google.cloud.storage.spi.v1.HttpStorageRpc.get(HttpStorageRpc.java:337) ~[google-cloud-storage-1.3.1.jar:1.3.1]\r\n\tat com.google.cloud.storage.StorageImpl$5.call(StorageImpl.java:191) ~[google-cloud-storage-1.3.1.jar:1.3.1]\r\n\tat com.google.cloud.storage.StorageImpl$5.call(StorageImpl.java:188) ~[google-cloud-storage-1.3.1.jar:1.3.1]\r\n\tat com.google.api.gax.retrying.DirectRetryingExecutor.submit(DirectRetryingExecutor.java:94) ~[gax-1.5.0.jar:na]\r\n\tat com.google.cloud.RetryHelper.runWithRetries(RetryHelper.java:54) ~[google-cloud-core-1.3.1.jar:1.3.1]\r\n\tat com.google.cloud.storage.StorageImpl.get(StorageImpl.java:188) ~[google-cloud-storage-1.3.1.jar:1.3.1]\r\n```\r\n\r\nIt doesn't say _why_ the ```urlfetch``` call failed, unfortunately.  This was built from a Gradle project with the following dependencies:\r\n\r\n```\r\ndependencies {\r\n  providedCompile 'javax.servlet:javax.servlet-api:3.1.0'\r\n  providedCompile 'com.google.appengine:appengine:+'\r\n  testCompile 'org.eclipse.jetty:jetty-server:9.+'\r\n  testCompile 'org.eclipse.jetty:jetty-servlet:9.+'\r\n  compile group: 'com.google.guava', name: 'guava', version: '19.+'\r\n  compile group: 'com.google.inject', name: 'guice', version: '4.+'\r\n  compile(group: 'com.google.api-client', name: 'google-api-client', version: '1.+') {\r\n     exclude(group: 'com.google.guava', module: 'guava-jdk5')\r\n  }\r\n  compile(group: 'com.google.api-client', name: 'google-api-client-appengine', version: '1.+') {\r\n     exclude(group: 'com.google.guava', module: 'guava-jdk5')\r\n  }\r\n  compile 'com.google.auth:google-auth-library-credentials:0.+'\r\n  compile 'com.google.cloud:google-cloud-core:1.+'\r\n  compile('com.google.apis:google-api-services-cloudkms:v1-rev15-1.+') {\r\n     exclude(group: 'com.google.guava', module: 'guava-jdk5')\r\n  }\r\n  compile 'com.google.cloud:google-cloud-storage:1.+'\r\n  compile ('com.google.cloud:google-cloud-datastore:1.+')\r\n  compile group: 'com.google.cloud', name: 'google-cloud-pubsub', version: '0.20+'\r\n}\r\n```"},"comment":{"url":"https://api.github.com/repos/GoogleCloudPlatform/google-cloud-java/issues/comments/320344677","html_url":"https://github.com/GoogleCloudPlatform/google-cloud-java/issues/2305#issuecomment-320344677","issue_url":"https://api.github.com/repos/GoogleCloudPlatform/google-cloud-java/issues/2305","id":320344677,"user":{"login":"neozwu","id":25352356,"avatar_url":"https://avatars2.githubusercontent.com/u/25352356?v=4","gravatar_id":"","url":"https://api.github.com/users/neozwu","html_url":"https://github.com/neozwu","followers_url":"https://api.github.com/users/neozwu/followers","following_url":"https://api.github.com/users/neozwu/following{/other_user}","gists_url":"https://api.github.com/users/neozwu/gists{/gist_id}","starred_url":"https://api.github.com/users/neozwu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/neozwu/subscriptions","organizations_url":"https://api.github.com/users/neozwu/orgs","repos_url":"https://api.github.com/users/neozwu/repos","events_url":"https://api.github.com/users/neozwu/events{/privacy}","received_events_url":"https://api.github.com/users/neozwu/received_events","type":"User","site_admin":false},"created_at":"2017-08-04T20:22:36Z","updated_at":"2017-08-04T20:22:36Z","body":"It shouldn't call urlfetch. We have logic in our code to dispatch urlfetch only for GAE J7, but normal http transport for GAE J8. I think this logic must have been broken for GAE flex. "}}
{"actor":{"display_login":"neozwu"}}