GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — CloudStorage: ApiProxy$RPCFailedException: The remote RPC to the application server failed for the call urlfetch.Fetch(). · Issue #2305 · googleapis/google-cloud-java

CloudStorage: ApiProxy$RPCFailedException: The remote RPC to the application server failed for the call urlfetch.Fetch(). #2305

New issue
Copy link
New issue
Copy link
Closed
Closed
CloudStorage: ApiProxy$RPCFailedException: The remote RPC to the application server failed for the call urlfetch.Fetch().#2305
Copy link
Assignees
jbaldassari
Labels
running on app engine

Description

@jbaldassari
jbaldassari
opened on Aug 4, 2017
Issue body actions

In a Java 8 flexible environment I'm trying to retrieve a file from cloud storage like this:

    private static byte[] retrieveFile(final String fileName) {
        final Storage cloudStorage = StorageOptions.getDefaultInstance().getService();
        final String bucketName = GcpProjects.getDefaultProjectId() + "-data";
        try {
            final Blob blob = cloudStorage.get(BlobId.of(bucketName, fileName));
            if (!blob.exists()) {
                throw new RuntimeException(fileName + " not found in bucket " + bucketName);
            }
            return blob.getContent();
        } catch (StorageException e) {
            throw new RuntimeException("Error obtaining " + fileName + " from bucket " + bucketName, e);
        }
    }

This worked fine for me in the J8 standard environment, but in the flexible environment the Storage.get(BlobId) call fails with:

Caused 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().
	at com.google.cloud.storage.StorageException.translateAndThrow(StorageException.java:71) ~[google-cloud-storage-1.3.1.jar:1.3.1]
	at com.google.cloud.storage.StorageImpl.get(StorageImpl.java:196) ~[google-cloud-storage-1.3.1.jar:1.3.1]
	at com.google.cloud.storage.StorageImpl.get(StorageImpl.java:202) ~[google-cloud-storage-1.3.1.jar:1.3.1]
Caused by: com.google.apphosting.api.ApiProxy$RPCFailedException: The remote RPC to the application server failed for the call urlfetch.Fetch().
	at com.google.apphosting.vmruntime.VmApiProxyDelegate.runSyncCall(VmApiProxyDelegate.java:175) ~[appengine-managed-runtime-1.9.40.sync-SNAPSHOT.jar:201703172103]
	at com.google.apphosting.vmruntime.VmApiProxyDelegate.makeApiCall(VmApiProxyDelegate.java:155) ~[appengine-managed-runtime-1.9.40.sync-SNAPSHOT.jar:201703172103]
	at com.google.apphosting.vmruntime.VmApiProxyDelegate.makeSyncCallWithTimeout(VmApiProxyDelegate.java:143) ~[appengine-managed-runtime-1.9.40.sync-SNAPSHOT.jar:201703172103]
	at com.google.apphosting.vmruntime.VmApiProxyDelegate.makeSyncCall(VmApiProxyDelegate.java:132) ~[appengine-managed-runtime-1.9.40.sync-SNAPSHOT.jar:201703172103]
	at com.google.apphosting.vmruntime.VmApiProxyDelegate.makeSyncCall(VmApiProxyDelegate.java:75) ~[appengine-managed-runtime-1.9.40.sync-SNAPSHOT.jar:201703172103]
	at com.google.apphosting.api.ApiProxy.makeSyncCall(ApiProxy.java:118) ~[appengine-api-1.0-sdk-1.9.40.jar:na]
	at com.google.appengine.api.urlfetch.URLFetchServiceImpl.fetch(URLFetchServiceImpl.java:40) ~[appengine-api-1.0-sdk-1.9.40.jar:na]
	at com.google.api.client.extensions.appengine.http.UrlFetchRequest.execute(UrlFetchRequest.java:74) ~[google-http-client-appengine-1.22.0.jar:1.22.0]
	at com.google.api.client.http.HttpRequest.execute(HttpRequest.java:981) ~[google-http-client-1.22.0.jar:1.22.0]
	at com.google.api.client.googleapis.services.AbstractGoogleClientRequest.executeUnparsed(AbstractGoogleClientRequest.java:419) ~[google-api-client-1.22.0.jar:1.22.0]
	at com.google.api.client.googleapis.services.AbstractGoogleClientRequest.executeUnparsed(AbstractGoogleClientRequest.java:352) ~[google-api-client-1.22.0.jar:1.22.0]
	at com.google.api.client.googleapis.services.AbstractGoogleClientRequest.execute(AbstractGoogleClientRequest.java:469) ~[google-api-client-1.22.0.jar:1.22.0]
	at com.google.cloud.storage.spi.v1.HttpStorageRpc.get(HttpStorageRpc.java:337) ~[google-cloud-storage-1.3.1.jar:1.3.1]
	at com.google.cloud.storage.StorageImpl$5.call(StorageImpl.java:191) ~[google-cloud-storage-1.3.1.jar:1.3.1]
	at com.google.cloud.storage.StorageImpl$5.call(StorageImpl.java:188) ~[google-cloud-storage-1.3.1.jar:1.3.1]
	at com.google.api.gax.retrying.DirectRetryingExecutor.submit(DirectRetryingExecutor.java:94) ~[gax-1.5.0.jar:na]
	at com.google.cloud.RetryHelper.runWithRetries(RetryHelper.java:54) ~[google-cloud-core-1.3.1.jar:1.3.1]
	at com.google.cloud.storage.StorageImpl.get(StorageImpl.java:188) ~[google-cloud-storage-1.3.1.jar:1.3.1]

It doesn't say why the urlfetch call failed, unfortunately. This was built from a Gradle project with the following dependencies:

dependencies {
  providedCompile 'javax.servlet:javax.servlet-api:3.1.0'
  providedCompile 'com.google.appengine:appengine:+'
  testCompile 'org.eclipse.jetty:jetty-server:9.+'
  testCompile 'org.eclipse.jetty:jetty-servlet:9.+'
  compile group: 'com.google.guava', name: 'guava', version: '19.+'
  compile group: 'com.google.inject', name: 'guice', version: '4.+'
  compile(group: 'com.google.api-client', name: 'google-api-client', version: '1.+') {
     exclude(group: 'com.google.guava', module: 'guava-jdk5')
  }
  compile(group: 'com.google.api-client', name: 'google-api-client-appengine', version: '1.+') {
     exclude(group: 'com.google.guava', module: 'guava-jdk5')
  }
  compile 'com.google.auth:google-auth-library-credentials:0.+'
  compile 'com.google.cloud:google-cloud-core:1.+'
  compile('com.google.apis:google-api-services-cloudkms:v1-rev15-1.+') {
     exclude(group: 'com.google.guava', module: 'guava-jdk5')
  }
  compile 'com.google.cloud:google-cloud-storage:1.+'
  compile ('com.google.cloud:google-cloud-datastore:1.+')
  compile group: 'com.google.cloud', name: 'google-cloud-pubsub', version: '0.20+'
}

Activity

  1. neozwu commented on Aug 4, 2017

    @neozwu
    neozwu
    on Aug 4, 2017
    Contributor
    More actions

    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.

  2. neozwu
    self-assigned this
    on Aug 4, 2017
  3. neozwu
    added
    running on app engine
    on Aug 4, 2017
  4. jbaldassari commented on Aug 4, 2017

    @jbaldassari
    jbaldassari
    on Aug 4, 2017
    Author
    More actions

    I think I figured this out. The following dependency seemed to be required when I was using the J8 standard environment:

      compile(group: 'com.google.api-client', name: 'google-api-client-appengine', version: '1.+') {
         exclude(group: 'com.google.guava', module: 'guava-jdk5')
      }
    

    After removing it, I'm no longer seeing that issue in the flexible environment.

    It's pretty confusing that there are certain magic dependencies that need to be there in some cases but not in others. com.google.appengine:appengine-api-1.0-sdk is another one for the standard environment. Everything will compile fine without it, but it won't run in AE correctly. Anyway I just wanted to point out that it could be documented better. I'll close this issue because removing google-api-client-appengine fixed the problem. Sorry for the distraction.

  5. jbaldassari
    closed this as completedon Aug 4, 2017
  6. theacodes
    unassigned
    neozwu
    on Sep 28, 2018
  7. JustinBeckwith
    assigned
    jbaldassari
    on Feb 1, 2021
  8. chingor13
    added 2 commits that reference this issue on Feb 20, 2026

    fix: add native image configurations for com.google.rpc classes (#2305)

    3a771fd

    feat: Adding CDC sample (#2263)

    ba134e4
  9. suztomo
    added a commit that references this issue on Mar 23, 2026

    chore(main): release 2.34.1 (googleapis#2305)

    3d96a26
  10. meltsufin
    added 3 commits that reference this issue on Apr 29, 2026

    chore: Update generation configuration at Thu Jan 9 21:05:27 UTC 2025 (…

    9c166f7

    chore: Update generation configuration at Thu Jan 9 21:05:27 UTC 2025 (…

    e90cbb2

    chore: Update generation configuration at Thu Feb 12 02:58:10 UTC 2026 (

    aca0fd2
  11. benjaminp
    added a commit that references this issue on Jul 13, 2026

    chore(main): release 2.42.1-SNAPSHOT (googleapis#2305)

    281688e
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

  • @jbaldassari
    jbaldassari

Labels

running on app engine

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

    You are visitor 01402775 — GeezerVison does not store the pages you look up.
    Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.