Bug: 500 Internal Server Error while calling Google Static Maps API - static

Good afternoon.
We've recently noticed a growing number a API call failure when trying to reach your Google Static Maps API.
Issues initially seemed intermittent, but seems to happen a lot more frequently, if not: all the time.
What steps will reproduce the problem? Please provide a link to a
demonstration page if at all possible, or attach code.
Totally works locally or in a web browser
Sends out a 500 Internal Server Error when on our staging/production systems
Could that be related to authentication? To my knowledge, API keys aren't really enforced locally, but definitely checked for when application runs on a live system.
Doesn't report as an error in our Google API Console. Just as a regular successful call.
Sample URL:
https://maps.googleapis.com/maps/api/staticmap?center=38.121504,-122.590525&scale=2&visual_refresh=true&size=280x188&key=OUR_BROWSER_API_KEY&markers=icon:http://stage.hometrendsreport.com/images/mini_orange.png|shadow:false|38.121504,-122.590525&markers=icon:http://stage.hometrendsreport.com/images/mini_blue.png|shadow:false|38.121073,-122.5932|38.123742,-122.591363|38.123981,-122.590448|38.124226,-122.589497|38.118754,-122.588585|38.119648,-122.587095|38.123877,-122.587494|38.118187,-122.592065|38.118038,-122.591357&markers=icon:http://stage.hometrendsreport.com/images/mini_gray.png|shadow:false|38.118442,-122.589865|38.118442,-122.589865|38.12166,-122.602269|38.116919,-122.571937
Here's our code snippet, using ruby/paperclip:
self.picture = URI.parse(google_map_url.to_s)
return self.save
Any idea why this is happening?
Any help gladly appreciated.
Best regards,
For developers viewing this issue: please click the 'star' icon to be
notified of future changes, and to let us know how many of you are
interested in seeing it resolved.

When I access the link I get an "invalid API key", so the API Key may be the problem. I believe there are also much lower quota for requests to the static map API, while testing you may have exceeded your quota.

Related

I have got "403 Forbidden" using custom search engine on payed account

I am trying to use google search engine via python script. It was working fine at the beginning but later I have got "HTTP Error 403: Forbidden". I thing it is due to 100 requests per day limitation. But I have payed account and billing support told me that everyting is ok. Is it possible somehow to solve this problesm?
Thanks, Ilia
There are lot of reasons for which API will throw Error 403. You can find them all here : GOOGLE DOC FOR 403 Forbidden
Your 403 error might indicate that the API key you are using may have lost it's permissions, or that the quota of your API requests may have been exceeded and the new quota (The one you have when you already have a billing account) might not have been updated.
I assume you are using this API; If not, don't worry, the following advice might also help you.
You first need to see if your API key is still working or you might want to generate new ones. You can do this here. Your code should make reference to the new API Key file.
If it is not the case then you should wait a little bit until your Billing account is updated and the quota gets readjusted. You can read a bit more about how to monitor the requests to your APIs here.
You can always find more help with your particular issue if you describe a little the symptoms and your attempts or hypothesis to solve it.
At last you may find more info on the community page of the API.

Recover Cloud functions default service account with the undelete POST call

I have used Google Cloud Functions for quite a long time, with no real authentication problem for now.
Today I meet this error while deploying a new function
ERROR: (gcloud.functions.deploy) ResponseError: status=[400], code=[Bad Request], message=[Default service account 'PROJECT-ID#appspot.gserviceaccount.com' doesn't exist. Please recreate this account (for example by disabling and enabling the Cloud Functions API), or specify a different account.]
I tried several things :
disable/enable GCF API : no service account recovered
gcloud beta app repair reference here
No default service account recovered
the undelete API POST call
If I understand well the current GCP features, using the last option is my best solution, but somehow I keep getting a 400 error
I found my unique-id in my log activity at the creation of the default service account
I really can't see where is the problem in the undelete API call and would be really thankful if you could help with it
Thanks to #Maxim, I know now that my problem comes from the fact that the deleting of this service account happened more than 30 days ago. Which means that it has already been purged from the system and it's not recoverable anymore.
In case you meet this same kind of problem, please try out this link :
https://cloud.google.com/iam/docs/creating-managing-service-accounts#undeleting_a_service_account
I see three alternative ways in how to proceed here next:
Create a new project from scratch to work from.
File a support case via the support center.
Open a private issue by providing your project number in the following component.
I believe it's convenient in reaching out GCP Support for help at this stage, and recommend you to do so; seeing as you've attempted most if not all ways of Service Account recovery to no success.
On a last note, as for the latter option, the contents of the private issue will only be visible to you, and to the GCP Support staff (us). If you choose this option, please let me know when it's opened, and I'll start working on it as soon as possible.

Java IOException during API request to Stripe (APIConnectionException)

The specific action we are trying to performe is to create a charge request with Stripe:
Charge charge = Charge.create(params);
Using Stripe's Java implementation (version 5.35.1) we encounter a APIConnectionException when running the application on the deployed App Engine server. Interestingly, the issue does not occur using App Engine's local dev server.
We contacted Stripe and they said everything is fine on their side. They explained that "this error indicates that your server is not able to contact our API and that it ends up timing out waiting for an answer. Usually, this is due to something misconfigured on your server such as a DNS not redirecting to Stripe properly."
We were wondering if there are some configuration settings on App Engine which cause the problem. However, since there is no specific error message we cound not figure out what might cause the connection problem.
Similar problems which did not provide enough help to resolve this issue: https://issuetracker.google.com/35901039
Thanks for your help!
The problem seems to have solved itself. It occured for a couple of days and since a few hours the exact same code is working fine. Just like in https://issuetracker.google.com/issues/35901039 the problem is suddenly gone for some reason.

Invalid and/or missing SSL certificate when using Google App Engine

UPDATE: Please, if anyone can help: Google is waiting for inputs and examples of this problem on their bug tracking tool. If you have reproducible steps for this issue, please share them on: https://code.google.com/p/googleappengine/issues/detail?id=10937
I'm trying to fetch data from the StackExchange API using a Google App Engine backend. As you may know, some of StackExchange's APIs are site-specific, requiring developers to run queries against every site the user is registered in.
So, here's my backend code for fetching timeline data from these sites. The feed_info_site variable holds the StackExchange site name (such as 'security', 'serverfault', etc.).
data = json.loads(urllib.urlopen("%sme/timeline?%s" %
(self.API_BASE_URL, urllib.urlencode({"pagesize": 100,
"fromdate": se_since_timestamp, "filter": "!9WWBR
(nmw", "site": feed_info_site, "access_token":
decrypt(self.API_ACCESS_TOKEN_SECRET, self.access_token), "key":
self.API_APP_KEY}))).read())
for item in data['items']:
... # code for parsing timeline items
When running this query on all sites except Stack Overflow, everything works OK. What's weird is, when the feed_info_site variable is set to 'stackoverflow', I get the following error from Google App Engine:
HTTPException: Invalid and/or missing SSL certificate for URL:
https://api.stackexchange.com/2.2/me/timeline?
filter=%219WWBR%28nmw&access_token=
<ACCESS_TOKEN_REMOVED>&fromdate=1&pagesize=100&key=
<API_KEY_REMOVED>&site=stackoverflow
Of course, if I run the same query in Safari, I get the JSON results I'm expecting from the API. So the problem really lies in Google's URLfetch service. I found several topics here on Stack Overflow related to similar HTTPS/SSL exceptions, but no accepted answer solved my problems. I tried removing cacerts.txt files. I also tried making the call with validate_certificate=False, with no success.
I think the problem is not strictly related to HTTPS/SSL. If so, how would you explain that changing a single API parameter would make the request to fail?
Wait for the next update to the app engine (scheduled one soon) then update.
Replace browserid.org/verify with another service (verifier.loogin.persona.org/verify is a good service hosted by Mozilla what could be used)
Make sure cacerts.txt doesnt exist (looks like you have sorted but just in-case :-) )
Attempt again
Good luck!
-Brendan
I was facing the same error, google has updated the app engine now, error resolved, please check the updated docs.

Increase Per-User Limit for Google API: Saving not possible, always error message "Your input was invalid"

I've the same problem as this user:
http://productforums.google.com/forum/#!topic/analytics/mOOrYoTVWgo
"I am trying to increase the Per-User Limit from 1 requests/second/user to 10 requests/second/user for the Analytics API. I keep getting an error that says "Your input was invalid". I even tried updating without any changes and I keep getting the same error. It appears that there may be a bug with increasing Per-User Limits?"
What can I do?
I was facing the exact same issue & found a workaround. I disabled all the other API services from the "Services" menu in my Google API Console. I turned "off" every other service except the Analytics API, then managed to update the per-user limit for Analytics API. After doing this, I then went back and re-activated the other API services.
Update: Google has fixed the bug, now it works.
If you are still having this issue, limits may have changed on one of the apis you already are using. Play around with some of your higher rate services and see if kicking them down allows you to update your limits.

Resources