2

My /var/log/syslog on my Ubuntu 24.10 is filled with the following geoclue error:

geoclue[3863]: Failed to query location: Query location SOUP error: Not Found

To see the error(s) on your system, do:

grep SOUP /var/log/syslog*

This is because Mozilla Location Service shut down June 12, 2024.

https://bugzilla.redhat.com/show_bug.cgi?id=2284621

Google has a similar location service, but it requires a Google API and a config file edit.

Is there a way to fix my location service, and get rid of the continuous error message?

heynnema
  • 73,649

2 Answers2

2

Location services now fail due to Mozilla Location Service being shut down on June 12, 2024. Here, I show a way to obtain geoclue information by hard-coding a location using lat/long, instead of a wireless connection to a now non-existent Mozilla service.

To see the failure:

sudo systemctl status geoclue

Here is a way to use a hard-coded location to make geoclue/location services work again.

Use https://www.gps-coordinates.net/my-location to obtain your current static location.

Create a textfile /etc/geolocation containing your coordinates, e.g.:

50.12345   # latitude
5.12345    # longitude
5          # altitude
1          # accuracy radius 

Note: For extra security, the static location file can be made readable just by the geoclue user:

sudo chown geoclue /etc/geolocation
sudo chmod 600 /etc/geolocation

Then in /etc/geoclue/geoclue.conf you can disable the geolocation options and enable the static location, e.g.:

# Enable WiFi source
enable=false

Enable the static source

If you make use of this source, you probably should disable other location

sources in this file so they won't override the configured static location.

enable=true

https://discussion.fedoraproject.org/t/geoclue-location-query-broken-due-to-mozilla-service-retirement/128262

Then restart geoclue:

sudo systemctl restart geoclue
heynnema
  • 73,649
0

Using static location can be incorrect for users who are frequently on the move. Debian packages now use BeaconDB for geoclue as noted in the launchpad bug report which should appear in future updated packages. For current installations, configure geoclue to use BeaconDB as below (after reverting the static geolocation option in /etc/geoclue/geoclue.conf, if set):

sudo tee /etc/geoclue/conf.d/99-beacondb.conf <<EOF
[wifi]
enable=true
url=https://api.beacondb.net/v1/geolocate
EOF

Then restart geoclue with sudo systemctl restart geoclue.service. Note that the geoclue agent should also be running for this to work which should be auto-started by most DEs -- check with ps -xo cmd | grep '^/usr/.*/demos/agent$'. If one is using a window manager like i3/awesome/... that don't auto-start /etc/xdg/autostart apps, add /usr/libexec/geoclue-2.0/demos/agent to the list of startup programs.

sumwale
  • 576