NixOS / nixpkgs

Nix Packages collection & NixOS
MIT License
18.31k stars 14.27k forks source link

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

Open leon-erd opened 5 months ago

leon-erd commented 5 months ago

Describe the bug

Since June 12 Mozilla has shutdown their location service (see https://gitlab.freedesktop.org/geoclue/geoclue/-/issues/186, https://github.com/mozilla/ichnaea/issues/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 :+1: reaction to issues you find important.

bobby285271 commented 5 months ago

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 commented 5 months ago

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 commented 5 months ago

Do we have a workaround for this in the meantime?

Janrupf commented 5 months ago

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 commented 5 months ago

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 commented 5 months ago

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 commented 5 months ago

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

tylerjl commented 4 months ago

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:

lucasmz-dev commented 4 months ago

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 commented 4 months ago

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 commented 4 months ago

👀 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 commented 2 months ago

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

fufexan commented 2 months ago

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 commented 2 months ago

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 commented 1 month ago

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 commented 1 month ago

(Yubikey sneeze + tridactyl, sorry)

99linesofcode commented 1 month ago

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 commented 1 month ago

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.