geoclue mozilla location api key rate limited

Bug #1826290 reported by Junaid Rasheed
42
This bug affects 6 people
Affects Status Importance Assigned to Milestone
geoclue-2.0 (Ubuntu)
Triaged
High
Unassigned

Bug Description

I am using Ubuntu 19.04

geoclue version: 0.12.99-4ubuntu2
geoclue2 version: 2.5.2-1ubuntu1

The key used by geoclue in ubuntu to access the mozilla location service appears to be rate limited.

Here's the relevant lines in /etc/geoclue/geoclue.conf

# URL to the wifi geolocation service. The key can currenty be anything, just
# needs to be present but that is likely going to change in future.
url=https://location.services.mozilla.com/v1/geolocate?key=geoclue

The comment is wrong, using an invalid key gives a 400 error.

$ curl https://location.services.mozilla.com/v1/geolocate\?key=random_key
{"error":{"code":400,"message":"Missing or invalid API key.","errors":[{"domain":"usageLimits","message":"Missing or invalid API key.","reason":"keyInvalid"}]}}%

Using the current key gives a limit reached error

$ curl https://location.services.mozilla.com/v1/geolocate\?key=geoclue
{"error":{"code":403,"message":"You have exceeded your daily limit.","errors":[{"domain":"usageLimits","message":"You have exceeded your daily limit.","reason":"dailyLimitExceeded"}]}}%

summary: - geoclue mozilla location key rate limited
+ geoclue mozilla location api key rate limited
Revision history for this message
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in geoclue-2.0 (Ubuntu):
status: New → Confirmed
Revision history for this message
Matti Pulkkinen (heap) wrote :

I would imagine that the currently shipped API key of "geoclue" is some kind of universal default. Now that the use of keys is apparently being monitored and limited, perhaps it would be possible for Ubuntu to register its own key, and then ship that with this package?

Revision history for this message
Olivier Tilloy (osomon) wrote :

Tested just now (25 April, 10:00 UTC) and a query to the service with the "geoclue" key returns a valid location. I wonder if someone already increased the quota for that key and the issue can be considered solved, or if it's just a lucky coincidence and the daily limit was reset before I tried.

If the problem persists, there are two possible approaches:

 - Ensure the daily limit for the "geoclue" key is high enough (unlimited?) that it can reasonably sustain all the requests coming from Ubuntu (and other distros), and check with upstream geoclue that they are fine with distros using the upstream key

 - Request an Ubuntu-specific key (see https://location.services.mozilla.com/api) and distro-patch geoclue-2.0 to use that key

Revision history for this message
Junaid Rasheed (jrasheed178) wrote :

I tried it around 02:00 UTC on 25 April so the daily limit was probably reset by the time you tested it. I did check around and came across this issue on geoclue's GitLab https://gitlab.freedesktop.org/geoclue/geoclue/issues/101

The geoclue key probably has a high daily limit but it's probably being reached a few hours before the daily limit is reset.

Revision history for this message
Matti Pulkkinen (heap) wrote :

I tried it again just now (roughly around the same time of day I tried this previously):

$ curl https://location.services.mozilla.com/v1/geolocate?key=geoclue
{"error":{"code":403,"message":"You have exceeded your daily limit.","errors":[{"domain":"usageLimits","message":"You have exceeded your daily limit.","reason":"dailyLimitExceeded"}]}}

Revision history for this message
Junaid Rasheed (jrasheed178) wrote :

Same.

$ curl https://location.services.mozilla.com/v1/geolocate\?key=geoclue
{"error":{"code":403,"message":"You have exceeded your daily limit.","errors":[{"domain":"usageLimits","message":"You have exceeded your daily limit.","reason":"dailyLimitExceeded"}]}}

Hopefully we can get Mozilla to up the limit for the API key.

Changed in geoclue-2.0 (Ubuntu):
importance: Undecided → High
status: Confirmed → Triaged
assignee: nobody → Olivier Tilloy (osomon)
Revision history for this message
Sebastien Bacher (seb128) wrote :

Is anyone still getting the issue? It seems to work fine here now, GNOME was also discussing the issue so maybe they got the quota increased?

Revision history for this message
Sebastien Bacher (seb128) wrote :

(seems like GNOME got it somehow resolved for now, https://gitlab.gnome.org/Teams/Board/issues/97 mentions it)

Revision history for this message
Ian Weisser (ian-weisser) wrote :

Updated upstream bug: https://gitlab.freedesktop.org/geoclue/geoclue/-/issues/136, opened 20 OCT 2020

Looks like the Mozilla MLS maintainer has proposed to deprecate the default key in order to force downstreams to get their own keys:

From the linked bug:

"My proposal is to deprecate the default key in Geoclue and give downstream users a good window (1 year?) in which to apply for their own MLS keys. Any Gnome or OSS apps that currently rely on Geoclue would effectively be rubber-stamped when they applied for their own MLS keys. At the end of the deprecation window, Mozilla would throttle the old key at a suitable threshold (probably 1M requests/day) so that old/unmaintained apps in the wild wouldn't be completely unsupported."

Revision history for this message
Olivier Tilloy (osomon) wrote :

For the record, back in April 2019 Canonical requested a separate MLS API key to use in geoclue in Ubuntu, and the request was initially acknowledged, but then it was put on hold on Mozilla's end and we never heard back from them, despite a couple of follow-up e-mails.

From the discussion in the upstream geoclue bug, it looks like the process to request separate keys is now working better, so we should have better luck if/when we issue a new request.

Revision history for this message
Robin (tezaro) wrote :

Can confirm that this stopped working 2 days ago. But when called manually from a script:

https://location.services.mozilla.com/v1/geolocate?key=geoclue

Can someone clarify: Is the shared "geoclue" key likely to come to life again, and if so is there any timeline?

Revision history for this message
Robin (tezaro) wrote :

Update: key is working again.

Revision history for this message
Robin (tezaro) wrote :

Update: key has not worked for several days.

Revision history for this message
Sebastien Bacher (seb128) wrote :

@Robin, how do you trigger the issue exactly? could you describe what website you try and what error you get?

Revision history for this message
Adrien (sparklingyeast) wrote :

@osomon any news on the key request for Ubuntu ? I'm hitting usage limits randomly with the generic "geoclue" key which makes redshift not work sometimes. It's the same error as @heap

Revision history for this message
Robin (tezaro) wrote :

@Sebastien Bacher Just doing an occasional Python GET request to the same URL others are using: https://location.services.mozilla.com/v1/geolocate?key=geoclue

Alternatively, calling that URL in a browser. It works occasionally, but mostly it just returns a 403. The JSON string: {"error":{"errors":[{"domain":"usageLimits","reason":"dailyLimitExceeded","message":"You have exceeded your daily limit."}],"code":403,"message":"You have exceeded your daily limit."}}

Olivier Tilloy (osomon)
Changed in geoclue-2.0 (Ubuntu):
assignee: Olivier Tilloy (osomon) → nobody
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.