[SOLVED] Bug in Bubble Implementation of Timezone API: randomly throws error (CONFIRMED: Bubble calls API without appending the Google API key)

[EDIT: This issue was in fact a bug and it has been resolved by Bubble. hooray!]

I’m submitting this as a bug right now, but there is an intermittent problem with Bubble’s calls to Google Timezone API. (This is a built-in feature related to Google Maps, Geocoding, etc.) Geographic address types in Bubble have a :Timezone ID and :timezone operator that can be used to fetch the location’s timezone.

At completely random times, this fetch will fail (you can tickle this by simply referencing:

any_geographic_address’s:Timezone ID

With the console open you will occasionally see an error (a very confusing and partially incorrect one!):

Uncaught Error: Timezone fetching issue {"errorMessage":"Keyless access to Google Maps Platform is deprecated. Please use an API key with all your API calls to avoid service interruption. For further details please refer to http://g.co/dev/maps-no-account","status":"OVER_QUERY_LIMIT"}

The first part is right: It looks to me like Bubble at times calls Timezone API without appending a key to the call (or something like that).

We can tell this because, if one uses one’s own key, the Google API Console will show the errors happening. They are 403 errors (forbidden), not overy_query_limit errors.

For my key (which has no restrictions and no special quotas enabled), the only way a 403 can happen is if a call is made to Timezone without a key (or perhaps with a malformed call?).

It’s very strange and can be reproduced just by pinging Timezone api via referencing the :timezone ID or :timezone operators in Bubble.

(You’ll see two effects: In the console, you’ll see the error message. Also, a null value will be returned so if you’re just reporting the value of :timezone id or :timezone in a text, you’ll see that go blank on failure.)

Update: It looks like the problem (AFAICT) is that Bubble does not pass an API key with calls to Google Timezone. This causes the deprecation warning and “OVER_QUERY_LIMIT” error which comes from Google.

This is being tracked as bug #3972.

Seems this is something that Bubble has simply overlooked when Google made changes to their APIs recently. The deprecation warning seems new in the last couple of days.

The weird/confusing thing is Google’s error STATUS should really be something like “HEY_SEND_A_KEY_DOOFUS”. (Because saying “OVER_QUERY_LIMIT” leads one to believe that one is overrunning one’s OWN query limit when, in fact, what’s going on is that the call is overrunning some unknown query limit that Google applies to Timezone calls that do not include a key.)

It is also somewhat baffling that Google is soft-limiting unsigned Timezone queries rather than enforcing the inclusion of the “key” parameter in Timezone API calls. In fact, it’s just a small percentage of calls to Timezone without a key that will generate this error and so it is sometimes hard to reproduce.

So, a warning to those who depend on being able to get :Timezone ID or :Timezone from a geographic address:

At the moment, some random percentage of your requests are failing and, depending upon what you do with the results from :Timezone ID and :Timezone, you may be setting those values to NULL in your app. (As my app will do.)

Hey Keith, can you clarify, is this happening even if you have your own key set up in Bubble?

FYI a similar problem is occurring with Google Maps, if the key isn’t setup.

It happens regardless of key settings. Demo project here:

Once there click login (there is only 1 user). Open console. Click “Random” to keep changing the address until error is triggered. Error might even trigger on page load.

In Network part of the console you’ll clearly see that Timezone calls are being made WITHOUT a key. So that’s THAT problem

There’s also a map on the page and it throws no errors.

(This project currently uses a key provided by me, but if those are removed, the same error happens for Bubble key. Because the issue is that NO KEYS ARE BEING USED anyway.)

1 Like

I spammed Random button about 30 times, didn’t see the error … maybe its quiet time right now?

I’ll stop spamming it in case my IP gets given a rate limit haha

Nice example, @keith

IT STILL errors out. It’s just Google… nobody knows how the rate limiting in unsigned calls works.

But I’ll tell you how to remove it: SIGN THE EFFING CALLS!

I am hoping this is fixed soon as it breaks my app.

For anyone this bug might impact: As a workaround, I simply configured a call to Google Timezone API in the API Connector. Like this:

The URL for the get is like this:

https://maps.googleapis.com/maps/api/timezone/json?location=[Latitude],[Longitude]&timestamp=[Timestamp]&key=[Key]

Then it can be called as data like this:

I’ve made [Key] private so it doesn’t show up here in the interface, but my properly configured Google API Key for maps/timezone/etc. is included in the API Connector setup.

Because this call is properly signed with the key parameter, it never gets the deprecation warning and does not fail.

I’d prefer not to keep using this as it’s much more convenient to use Bubble’s built-in :timezone id / :timezone operators, but it’s a necessity until this particular bug is fixed. I’ll keep this thread updated.

1 Like

I’m seeing the exact same behavior in the console even though I’ve provided google map API keys. Have you filed a bug report with Bubble?

As I note, there’s a bug report that I’m tracking. Also, if uwanna fix, see my reply about API call to configure. :+1:

1 Like

RBTW, @jjj230, depending on what you are interested in: you may not need to care about timestamp. I just retrieve Timezone IDs, which don’t give a crap about current time. They don’t change. Timezone does (like right now it’s daylight savings time in some places).

My use case is I make a lot of use of moment-Timezone, which depends on Timezone ID to do its magic.

The bug here is so obvious that it makes me cranky. This should not have been missed by the Bubble crew, but it took ME more than a day to track down.

They owe me a pizza or some shit like that.

I was informed by support today that a push has been fixed for this issue (Google Timezone API calls being made by Bubble without including API key) and checking my example app seems to confirm that the issue is solved. Yay! Thanks, Bubble folks and @neerja in support for the perseverance on this one!

2 Likes

This topic was automatically closed after 14 days. New replies are no longer allowed.