Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

nixos/geoclue2: not working because Mozilla Location Service is retiring #321121

Open
leon-erd opened this issue Jun 19, 2024 · 22 comments
Open

nixos/geoclue2: not working because Mozilla Location Service is retiring #321121

leon-erd opened this issue Jun 19, 2024 · 22 comments
Labels
0.kind: bug Something is broken

Comments

@leon-erd
Copy link
Contributor

Describe the bug

Since June 12 Mozilla has shutdown their location service (see https://gitlab.freedesktop.org/geoclue/geoclue/-/issues/186, mozilla/ichnaea#2065). This means that the nixos geoclue service in its current state does not work anymore.
Quoting the upstream maintainer: "It is up to the distros and individual users to decide what backend they use for wifi and cell location and to get the necessary API keys. MLS already required distro-specific keys."

Steps To Reproduce

Steps to reproduce the behavior:

  1. set services.geoclue2.enable = true;

Expected behavior

Geoclue service working out of the box.

Additional information

Geoclue service logs:

Jun 19 23:34:26 leon-inspiron .geoclue-wrappe[294835]: Failed to query location: Query location SOUP error: Not Found
Jun 19 23:35:31 leon-inspiron .geoclue-wrappe[294835]: Failed to query location: Query location SOUP error: Not Found
Jun 19 23:36:44 leon-inspiron .geoclue-wrappe[294835]: Failed to query location: Could not connect to location.services.mozilla.com: No route to host
Jun 19 23:36:49 leon-inspiron .geoclue-wrappe[294835]: Failed to query location: Query location SOUP error: Not Found
Jun 19 23:38:56 leon-inspiron .geoclue-wrappe[294835]: Failed to query location: Query location SOUP error: Not Found
Jun 19 23:41:02 leon-inspiron .geoclue-wrappe[294835]: Failed to query location: Query location SOUP error: Not Found
Jun 19 23:41:34 leon-inspiron .geoclue-wrappe[294835]: Failed to query location: Query location SOUP error: Not Found
Jun 19 23:41:52 leon-inspiron .geoclue-wrappe[294835]: Failed to query location: Query location SOUP error: Not Found
Jun 19 23:42:55 leon-inspiron .geoclue-wrappe[294835]: Failed to query location: Query location SOUP error: Not Found
Jun 19 23:46:20 leon-inspiron .geoclue-wrappe[294835]: Failed to query location: Query location SOUP error: Not Found

Notify maintainers

@davidak @bobby285271 @lovesegfault @peterhoeg @worldofpeace


Add a 👍 reaction to issues you find important.

@leon-erd leon-erd added the 0.kind: bug Something is broken label Jun 19, 2024
@bobby285271
Copy link
Member

bobby285271 commented Jun 19, 2024

https://gitlab.freedesktop.org/geoclue/geoclue/-/merge_requests/177 removes/disables MLS stuff in default config, the relevant NixOS options are services.geoclue2.enable3G, services.geoclue2.enableWifi, services.geoclue2.geoProviderUrl, services.geoclue2.submissionUrl.

cc @NixOS/freedesktop

@Janrupf
Copy link

Janrupf commented Jun 22, 2024

I'd like to note that for anyone who comes across this issue and has enabled services.automatic-timezoned.enable = true;, this is now the reason it no longer works.

@zoriya
Copy link
Member

zoriya commented Jun 22, 2024

Do we have a workaround for this in the meantime?

@Janrupf
Copy link

Janrupf commented Jun 22, 2024

None of the solution I came across would work for large scale distribution, other services seem to require an API key. I for now have set up a Google Maps API key for my system, but that obviously wouldn't work for putting it into nixpkgs.

@Nemo157
Copy link

Nemo157 commented Jun 22, 2024

In the meantime it would be useful to expose config for the static-source in the module so we can manually set it and keep using services dependent on geoclue.

@tylerjl
Copy link
Contributor

tylerjl commented Jun 24, 2024

Should we consider emitting a warning when the Mozilla location server is set? I also got bitten by this and given that we all now what's going on, any user that 1) has enabled geoclue and also 2) leaves the provider URL to the now-defunct Mozilla server is going to be in a broken state we can detect just by the nature of the options that are set. At the very least we can short-circuit users' debugging at the module option level (I also ended up plugging in a Google API key which sucks, but at least it's working again).

Arch just loaded up a static API key, is that... an okay thing to do? I imagine that they might be in a precarious position over there if it's just a normal user API key that the entire distribution is using now, but if that's permissible from Google's perspective, maybe it's a workaround at the nixos-level (albeit kind of... icky).

Long term a viable third-party location provider would be good (though who knows who'd run it), medium-term maybe we can ensure that all possible configuration options are available at the module level to configure geoclue2 and provide some wiki docs about it, and immediate-term we can warn users about what's going on at system build-time.

@l0b0
Copy link
Contributor

l0b0 commented Jun 26, 2024

In the meantime, timedatectl set-timezone CONTINENT/CITY works.

dmarcoux added a commit to dmarcoux/dotfiles that referenced this issue Jun 30, 2024
This reverts commit ade34b3.

I understand now why redshift wasn't working this time. See [this
issue](NixOS/nixpkgs#321121).
tylerjl added a commit to tylerjl/nixpkgs that referenced this issue Jul 8, 2024
This provider is now-defunct and will not work correctly.
For additional information, refer to: NixOS#321121
@tylerjl
Copy link
Contributor

tylerjl commented Jul 8, 2024

Module update PR is up at #325430. Not ideal, but it should help lead users to solutions in broken installations.

I'd argue that next steps here are:

  • Update the module to accept all available settings in case users need to customize it further to find resolution
  • Long term, find an alternative to default to. The recent announcement of https://beacondb.net/ might be the sort of thing we're looking for.

@lucasmz-dev
Copy link

positon.xyz is also an option that might have more availability due to having the benefit of using commercial data, instead of having a bunch of computer nerds collect data with their phone

@jtojnar
Copy link
Member

jtojnar commented Jul 21, 2024

Re: position.xyz https://grapheneos.org/articles/positon-location-service

Edit: I have not verified the veracity of the above article, but there are some serious accusations in it, that warrant investigation.

@NovaViper
Copy link
Contributor

👀 Wow I thought something was fishy on initial glance but reading that article revealed a much deeper rabbit hole that shows just how dishonest the people over the project are. Thanks for sharing that @jtojnar, this needs to blow up more so people are aware of their antics and stop giving them support.

@99linesofcode
Copy link

99linesofcode commented Aug 29, 2024

Perhaps something like https://beacondb.net would qualify* as a worthy FOSS alternative to MLS?

@fufexan
Copy link
Contributor

fufexan commented Aug 29, 2024

Could be a good option. The maintainer is looking for beta testers in order to gauge the potential load on a server, and plan hardware upgrades accordingly. https://codeberg.org/beacondb/beacondb/issues/5

@nyabinary
Copy link
Contributor

Could be a good option. The maintainer is looking for beta testers in order to gauge the potential load on a server, and plan hardware upgrades accordingly. https://codeberg.org/beacondb/beacondb/issues/5

The developer also uses NixOS which is pretty cool and nice (On an actual on topic thing I have been using it for a while, and it has been working pretty well for me :))

@joelkoen
Copy link
Member

joelkoen commented Oct 1, 2024

Hey, BeaconDB dev + fellow NixOS user here.

There has been some discussion in various channels about transferring Mozilla's dataset to a trusted organisation that can sign a legal contract with Mozilla, so that an organisation can host MLS's DB while merging new data for the open source community.

As the NixOS foundation is based in The Netherlands (not the US, no silly patents), and the NixOS community seems to be quite keen on working towards a solution for an MLS replacement, is this something the NixOS foundation could look in to? Keen to hear any thoughts on this.

Edit: I'd like to make clear that I have not confirmed this with the Mozilla side of things just yet. Am in touch with them now though

@lovesegfault
Copy link
Member

(Yubikey sneeze + tridactyl, sorry)

@99linesofcode
Copy link

99linesofcode commented Oct 15, 2024

Hey, BeaconDB dev + fellow NixOS user here.

There has been some discussion in various channels about transferring Mozilla's dataset to a trusted organisation that can sign a legal contract with Mozilla, so that an organisation can host MLS's DB while merging new data for the open source community.

As the NixOS foundation is based in The Netherlands (not the US, no silly patents), and the NixOS community seems to be quite keen on working towards a solution for an MLS replacement, is this something the NixOS foundation could look in to? Keen to hear any thoughts on this.

Edit: I'd like to make clear that I have not confirmed this with the Mozilla side of things just yet. Am in touch with them now though

@joelkoen I applaud your effort. Was told on Matrix that the timing on this wasn't great (the foundation is undergoing some governance changes) but @refroni would be the person to talk to. Perhaps you can reach out to him to see whether it's something the NixOS foundation would be interested in?

@joelkoen
Copy link
Member

joelkoen commented Oct 16, 2024

Unfortunately, a week ago Mozilla responded saying that for privacy reasons they are unable to share the WiFi database with another organisation, which I understand.

I replied a day later asking if they would consider temporarily making their data available again on a server they would own. If it was read only, it would also be much simpler+cheaper for them to run, and this would greatly benefit the open source software community given the amount of coverage they have. They have not responded to that idea yet.

workflow added a commit to workflow/dotfiles that referenced this issue Oct 19, 2024
Mozilla discontinued its gelocation service, used by Geoclue2 as default
See: NixOS/nixpkgs#321121
kira-bruneau added a commit to kira-bruneau/nixpkgs that referenced this issue Oct 30, 2024
The Mozilla API key option was removed since the Mozilla location
service is now defunct, see NixOS#321121
kira-bruneau added a commit to kira-bruneau/nixpkgs that referenced this issue Oct 30, 2024
The Mozilla API key option was removed since the Mozilla location
service is now defunct, see NixOS#321121
kira-bruneau added a commit to kira-bruneau/nixpkgs that referenced this issue Oct 30, 2024
The Mozilla API key option was removed since the Mozilla location
service is now defunct, see NixOS#321121
kira-bruneau added a commit to kira-bruneau/nixpkgs that referenced this issue Oct 30, 2024
https://gitlab.freedesktop.org/geoclue/geoclue/-/blob/2.7.2/NEWS

The Mozilla API key option was removed since the Mozilla location service is now defunct, see NixOS#321121

Fixes NixOS#325430
kira-bruneau added a commit to kira-bruneau/nixpkgs that referenced this issue Oct 30, 2024
https://gitlab.freedesktop.org/geoclue/geoclue/-/blob/2.7.2/NEWS

The Mozilla API key option was removed since the Mozilla location service is now defunct, see NixOS#321121

Fixes NixOS#327464
Shawn8901 pushed a commit to Shawn8901/nixpkgs that referenced this issue Nov 3, 2024
https://gitlab.freedesktop.org/geoclue/geoclue/-/blob/2.7.2/NEWS

The Mozilla API key option was removed since the Mozilla location service is now defunct, see NixOS#321121

Fixes NixOS#327464
jakobkukla added a commit to jakobkukla/nixos-config that referenced this issue Nov 12, 2024
@yajo
Copy link
Contributor

yajo commented Dec 3, 2024

I found out https://reallyfreegeoip.org/ with the promise to be always free without tokens or auth. The API endpoint https://reallyfreegeoip.org/json/ seems to give a lot of details.

However, I enabled it with services.geoclue2.geoProviderUrl = "https://reallyfreegeoip.org/json"; but it fails with:

dic 03 09:54:03 yajothink .geoclue-wrappe[30661]: json_object_get_object_member: assertion 'node != NULL' failed
dic 03 09:54:03 yajothink .geoclue-wrappe[30661]: json_object_get_double_member: assertion 'object != NULL' failed
dic 03 09:54:03 yajothink .geoclue-wrappe[30661]: json_object_get_double_member: assertion 'object != NULL' failed
dic 03 09:54:03 yajothink .geoclue-wrappe[30661]: json_object_get_double_member: assertion 'node != NULL' failed

Is there some way to wire that service with geoclue2? (Reported upstream FWIW)

@sim6
Copy link

sim6 commented Dec 3, 2024

@yajo services.geoclue2.geoProviderUrl is the url to the wifi based geolocation service like https://beacondb.net (https://github.com/NixOS/nixpkgs/blob/732ec1a9eaae7759f086bd6d796877854842da1f/nixos/modules/services/desktops/geoclue2.nix#L128C11-L128C51). It is not for a IP based geolocation service like https://reallyfreefeoip.org.

@joelkoen
Copy link
Member

joelkoen commented Dec 16, 2024

I've given the OK for distros to start setting BeaconDB as a default if they are interested. I would be happy to open a PR here in nixpkgs if the NixOS community is keen on using BeaconDB by default?

Also, forgot to update here with regards to my previous comment - Mozilla has unfortunately said they're not interested in temporarily hosting their data read-only.

@nyabinary
Copy link
Contributor

I've given the OK for distros to start setting BeaconDB as a default if they are interested. I would be happy to open a PR here in nixpkgs if the NixOS community is keen on using BeaconDB by default?

Also, forgot to update here with regards to my previous comment - Mozilla has unfortunately said they're not interested in temporarily hosting their data read-only.

Might as well open a PR :3 and have the discussion there

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
0.kind: bug Something is broken
Projects
None yet
Development

No branches or pull requests