3
votes

Since this morning all my applications using gapi are down.

I'm using: https://apis.google.com/js/client.js

to communicate with the Endpoints of my Google Appengine applications, for example:

gapi.client.load('public', 'v2', function(){
    gapi.client.public.organizations().execute(function(response){ 
        console.log(response); 
    }); 
}, 'https://XXX.appspot.com/_ah/api');

As of today all calls are responded with the following error message:

[{"error":{"code":404,"message":"Not Found","data":[{"domain":"global","reason":"notFound","message":"Not Found"}]},"id":"gapiRpc"}]

My applications are not logging any errors. I can reach the Endpoint API explorer (/_ah/api/explorer) without errors. I can make HTTP-request calls without errors, e.g

https://XXX.appspot.com/_ah/api/public/v2/organizations

The "gapi"-object is loaded without errors. My "public" endpoint is also loaded and I can list all methods using the javascript console.

I have reported this error to Google.

Anybody else having this issue? Does anybody have any quick solutions or workarounds? Have I perhaps missed some Google updates or API-changes?

Thanks

2
Same issues for me. And the Google appengine dashboard does not report any problem - thedayofcondor
Google have confirmed that there is a problem. You can follow the issue here - groups.google.com/forum/#!topic/… I recommend everyone to subscribe to the Google App Engine Downtime Notify group if you haven't done so already - groups.google.com/forum/#!forum/… - R4h1mH
The issue seems to be resolved. My applications are back up again! From Goolgle support: "Google API JavaScript client functionality has already been restored for some users, and we expect a resolution for all users in the near future. Please note this time frame is an estimate and may change." - user3510146

2 Answers

6
votes

It seems to be a general issue with the JS Client library at the moment, not limited to Endpoints APIs, but affecting all Google APIs.

https://code.google.com/p/google-api-javascript-client/issues/detail?id=136

Only real "work around" is not to depend on the JS Client Library (which had stability issues in the past as well) and construct the HTTP Requests yourself, which I know isn't a quick solution.

You can also try using the gapi.client.request method for direct REST requests which seems to be working for one of my endpoints APIs. (again, not a quick solution, but probably better/easier since you still have the authentication working via the client library).

gapi.client.request({
  "path": "/public/v2/organizations",
  "root": "https://XXX.appspot.com/_ah/api"
}).execute(function (response) { 
  console.log(response); 
});

Edit: Update from the linked issue

They will be rolling back the broken update which will take several hours to complete (no exact ETA yet).

As a "quick" fix you can explicitely add the apiVersion to each request (careful: the B might change after the rollback, but it works now):

var request = gapi.client.public.organizations();
request.B.apiVersion = "v2";
request.execute(function (response) {
  console.log(response);
});

Edit 2: Everything seems to be back to normal now.

0
votes

The another workaround can be done by passing discovery document url. Sample discovery document url is

Example :-

window.gapi.client.load("http://localhost:8080/_ah/api/discovery/v1/apis/[endpoint-api-name]/v1/rest").then(() => { Your promise return callback function })

or

window.gapi.client.load(" http://[application-id].appspot.com/_ah/api/discovery/v1/apis/[endpoint-api-name]/v1/rest").then(() => { Your promise return callback function })