Bug 89838 - GNOME Maps fails to get location from geoclue
Summary: GNOME Maps fails to get location from geoclue
Status: RESOLVED FIXED
Alias: None
Product: GeoClue
Classification: Unclassified
Component: service (show other bugs)
Version: unspecified
Hardware: x86-64 (AMD64) Linux (All)
: medium normal
Assignee: Geoclue Bugs
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-03-31 12:39 UTC by Donald Buchan
Modified: 2015-04-20 08:24 UTC (History)
2 users (show)

See Also:
i915 platform:
i915 features:


Attachments

Description Donald Buchan 2015-03-31 12:39:01 UTC
I opened up gnome-maps in Fedora 21, and it displayed New York City; the computer is located in Montreal, Quebec, Canada.  I understand that gnome-maps uses geoip information supplied by GeoClue from the Mozilla servers in order to determine where the map should default to.

The computer is hooked up to a router which is hooked up to a modem getting signal from the phone company (Bell Canada https://en.wikipedia.org/wiki/Bell_Canada ).  I am not employing a VPN nor connecting through a corporate network.
Comment 1 Michael Catanzaro 2015-03-31 13:35:05 UTC
I get New York City as well. But I'm inclined to suspect that Maps just picks New York City when it doesn't get a location from geoclue. It definitely picks New York City even if I've never before enabled geoclue before (System Settings -> Privacy -> Location Services, it's off by default) so it can't be geoclue providing the wrong location.

However, there must be a bug as well. In Fedora 21, after enabling Location Services, Maps still picks New York City for my location. I would guess geoclue is providing no location. I'm hooked up directly to a modem from my cable company, so if geoclue were to simply look at my IP address it would be able to pinpoint my location to the nearest city.

I found the little demo tool in the source directory, but it doesn't work:

$ ./where-am-i 
Client object: /org/freedesktop/GeoClue2/Client/1

** (where-am-i:5511): CRITICAL **: Failed to start GeoClue2 client: GDBus.Error:org.freedesktop.DBus.Error.AccessDenied: Access denied
Comment 2 Zeeshan Ali 2015-03-31 14:45:45 UTC
Could you please run geoclue manually as 'geoclue' user with debug enabled, i-e `G_MESSAGES_DEBUG=Geoclue /usr/libexec/geoclue` and tell me what it says when you run the demo client?
Comment 3 Donald Buchan 2015-03-31 22:52:33 UTC
(In reply to Zeeshan Ali from comment #2)
> Could you please run geoclue manually as 'geoclue' user with debug enabled,
> i-e `G_MESSAGES_DEBUG=Geoclue /usr/libexec/geoclue` and tell me what it says
> when you run the demo client?

[root@malak malak]# G_MESSAGES_DEBUG=Geoclue /usr/libexec/geoclue
(geoclue:22321): Geoclue-DEBUG: Available accuracy level from GClueWifi: 4

(geoclue:22321): Geoclue-CRITICAL **: Failed to acquire name 'org.freedesktop.GeoClue2' on system bus or lost it.
Comment 4 Michael Catanzaro 2015-04-01 02:46:19 UTC
$ sudo passwd geoclue
$ sudo usermod geoclue --shell=/bin/bash
$ su geoclue
Password: 
bash-4.3$ G_MESSAGES_DEBUG=Geoclue /usr/libexec/geoclue
(geoclue:6590): Geoclue-DEBUG: Available accuracy level from GClueWifi: 4
(geoclue:6590): Geoclue-DEBUG: New agent for user ID '1000'
(geoclue:6590): Geoclue-DEBUG: Number of connected clients: 1
(geoclue:6590): Geoclue-DEBUG: 'org.gnome.Maps' not in configuration or not allowed
(geoclue:6590): Geoclue-DEBUG: GClueLocator now active
(geoclue:6590): Geoclue-DEBUG: GClueWifi now active
(geoclue:6590): Geoclue-DEBUG: 'org.gnome.Maps' started.

"'org.gnome.Maps' not in configuration or not allowed" <-- that looks bad?
Comment 5 Donald Buchan 2015-04-01 02:59:26 UTC
(In reply to Michael Catanzaro from comment #4)
> $ sudo passwd geoclue
> $ sudo usermod geoclue --shell=/bin/bash
> $ su geoclue
> Password: 
> bash-4.3$ G_MESSAGES_DEBUG=Geoclue /usr/libexec/geoclue
> (geoclue:6590): Geoclue-DEBUG: Available accuracy level from GClueWifi: 4
> (geoclue:6590): Geoclue-DEBUG: New agent for user ID '1000'
> (geoclue:6590): Geoclue-DEBUG: Number of connected clients: 1
> (geoclue:6590): Geoclue-DEBUG: 'org.gnome.Maps' not in configuration or not
> allowed
> (geoclue:6590): Geoclue-DEBUG: GClueLocator now active
> (geoclue:6590): Geoclue-DEBUG: GClueWifi now active
> (geoclue:6590): Geoclue-DEBUG: 'org.gnome.Maps' started.
> 
> "'org.gnome.Maps' not in configuration or not allowed" <-- that looks bad?

Here's my output doing it from the perspective of the user geoclue instead of root:

[root@malak malak]# passwd geoclue
Changing password for user geoclue.
New password: 
Retype new password: 
passwd: all authentication tokens updated successfully.
[root@malak malak]# usermod geoclue --shell=/bin/bash
[root@malak malak]# G_MESSAGES_DEBUG=Geoclue /usr/libexec/geoclue
(geoclue:25198): Geoclue-DEBUG: Available accuracy level from GClueWifi: 4

(geoclue:25198): Geoclue-CRITICAL **: Failed to acquire name 'org.freedesktop.GeoClue2' on system bus or lost it.
[root@malak malak]# su geoclue
bash-4.3$ G_MESSAGES_DEBUG=Geoclue /usr/libexec/geoclue
(geoclue:25207): Geoclue-DEBUG: Available accuracy level from GClueWifi: 4

(geoclue:25207): Geoclue-CRITICAL **: Failed to acquire name 'org.freedesktop.GeoClue2' on system bus or lost it.
bash-4.3$
Comment 6 Donald Buchan 2015-04-01 03:02:35 UTC
Please note that there could be a simple problem that exists between the keyboard and the chair. :)  I understand that there may be some "obvious" setting I haven't set without my knowing what it is.
Comment 7 Zeeshan Ali 2015-04-01 13:05:36 UTC
(In reply to Donald Buchan from comment #3)
> (In reply to Zeeshan Ali from comment #2)
> > Could you please run geoclue manually as 'geoclue' user with debug enabled,
> > i-e `G_MESSAGES_DEBUG=Geoclue /usr/libexec/geoclue` and tell me what it says
> > when you run the demo client?
> 
> [root@malak malak]# G_MESSAGES_DEBUG=Geoclue /usr/libexec/geoclue
> (geoclue:22321): Geoclue-DEBUG: Available accuracy level from GClueWifi: 4
> 
> (geoclue:22321): Geoclue-CRITICAL **: Failed to acquire name
> 'org.freedesktop.GeoClue2' on system bus or lost it.

You need to first kill the existing geoclue service.
Comment 8 Zeeshan Ali 2015-04-01 13:20:06 UTC
(In reply to Michael Catanzaro from comment #4)
> "'org.gnome.Maps' not in configuration or not allowed" <-- that looks bad?

No, ignore that. This just means its not in whitelisted list that is not authorized through the agent.

Is that all the log you get?
Comment 9 Michael Catanzaro 2015-04-01 13:54:45 UTC
Yup, that's the entirety of the output.
Comment 10 Zeeshan Ali 2015-04-01 15:23:20 UTC
(In reply to Michael Catanzaro from comment #9)
> Yup, that's the entirety of the output.

That is very weird. Can you check which version of geoclue do you have?
Comment 11 Zeeshan Ali 2015-04-01 15:28:02 UTC
(In reply to Zeeshan Ali from comment #10)
> (In reply to Michael Catanzaro from comment #9)
> > Yup, that's the entirety of the output.
> 
> That is very weird. Can you check which version of geoclue do you have?

Oh my! 2.1.10 never mad it to F21. :( /me fixes..
Comment 12 Zeeshan Ali 2015-04-01 15:37:31 UTC
(In reply to Zeeshan Ali from comment #8)
> (In reply to Michael Catanzaro from comment #4)
> > "'org.gnome.Maps' not in configuration or not allowed" <-- that looks bad?
> 
> No, ignore that. This just means its not in whitelisted list that is not
> authorized through the agent.

Actually you are likely correct about this being the issue. There was a related fix just after 2.1.9 that should fix this issue. Since this is upstream bz and not for tracking downstream issues, I'll mark this as FIXED for now. Please re-open if you can reproduce against 2.1.10.
Comment 13 Zeeshan Ali 2015-04-01 16:15:10 UTC
I've pushed to F21 updates-testing so please test it out and leave karma so its pushed to main repo: https://admin.fedoraproject.org/updates/geoclue2-2.1.10-1.fc21
Comment 14 Donald Buchan 2015-04-01 21:52:46 UTC
(In reply to Zeeshan Ali from comment #7)
> (In reply to Donald Buchan from comment #3)
> > (In reply to Zeeshan Ali from comment #2)
> > > Could you please run geoclue manually as 'geoclue' user with debug enabled,
> > > i-e `G_MESSAGES_DEBUG=Geoclue /usr/libexec/geoclue` and tell me what it says
> > > when you run the demo client?
> > 
> > [root@malak malak]# G_MESSAGES_DEBUG=Geoclue /usr/libexec/geoclue
> > (geoclue:22321): Geoclue-DEBUG: Available accuracy level from GClueWifi: 4
> > 
> > (geoclue:22321): Geoclue-CRITICAL **: Failed to acquire name
> > 'org.freedesktop.GeoClue2' on system bus or lost it.
> 
> You need to first kill the existing geoclue service.

all processes connected to geoclue killed via htop.

[root@malak malak]# G_MESSAGES_DEBUG=Geoclue /usr/libexec/geoclue
(geoclue:835): Geoclue-DEBUG: Available accuracy level from GClueWifi: 4

(geoclue:835): Geoclue-CRITICAL **: Failed to acquire name 'org.freedesktop.GeoClue2' on system bus or lost it.
[root@malak malak]# 

and yes, this is complete.
Comment 15 Zeeshan Ali 2015-04-02 00:50:03 UTC
(In reply to Donald Buchan from comment #14)
> (In reply to Zeeshan Ali from comment #7)
> > (In reply to Donald Buchan from comment #3)
> > > (In reply to Zeeshan Ali from comment #2)
> > > > Could you please run geoclue manually as 'geoclue' user with debug enabled,
> > > > i-e `G_MESSAGES_DEBUG=Geoclue /usr/libexec/geoclue` and tell me what it says
> > > > when you run the demo client?
> > > 
> > > [root@malak malak]# G_MESSAGES_DEBUG=Geoclue /usr/libexec/geoclue
> > > (geoclue:22321): Geoclue-DEBUG: Available accuracy level from GClueWifi: 4
> > > 
> > > (geoclue:22321): Geoclue-CRITICAL **: Failed to acquire name
> > > 'org.freedesktop.GeoClue2' on system bus or lost it.
> > 
> > You need to first kill the existing geoclue service.
> 
> all processes connected to geoclue killed via htop.
> 
> [root@malak malak]# G_MESSAGES_DEBUG=Geoclue /usr/libexec/geoclue
> (geoclue:835): Geoclue-DEBUG: Available accuracy level from GClueWifi: 4
> 
> (geoclue:835): Geoclue-CRITICAL **: Failed to acquire name
> 'org.freedesktop.GeoClue2' on system bus or lost it.
> [root@malak malak]# 
> 
> and yes, this is complete.

As I said before, you need to launch it as 'geoclue' user as you demonstrated in comment#5. :)
Comment 16 Zeeshan Ali 2015-04-07 13:17:11 UTC
(In reply to Zeeshan Ali from comment #15)
> (In reply to Donald Buchan from comment #14)
> 
> As I said before, you need to launch it as 'geoclue' user as you
> demonstrated in comment#5. :)

So could you please repeat what you did in comment#5 with packages installed from https://admin.fedoraproject.org/updates/geoclue2-2.1.10-1.fc21 ?
Comment 17 Zeeshan Ali 2015-04-07 16:08:27 UTC
(In reply to Zeeshan Ali from comment #16)
> (In reply to Zeeshan Ali from comment #15)
> > (In reply to Donald Buchan from comment #14)
> > 
> > As I said before, you need to launch it as 'geoclue' user as you
> > demonstrated in comment#5. :)
> 
> So could you please repeat what you did in comment#5 with packages installed
> from https://admin.fedoraproject.org/updates/geoclue2-2.1.10-1.fc21 ?

Never mind! This wont fix it. The fix has already been in master for a while now but we haven't had a release since then. :( I'll roll out a new release and push it to Fedora once its out..
Comment 18 Zeeshan Ali 2015-04-16 20:54:11 UTC
I have pushed the new release with the fix to updates-testing in fedora 22:

https://admin.fedoraproject.org/updates/geoclue2-2.2.0-1.fc22

Could any of you please check if it helps and give karma so it goes to stable soon?
Comment 19 Zeeshan Ali 2015-04-17 16:32:24 UTC
Oh and I have also pushed fixes to f21, Same karma request applies there :)

https://admin.fedoraproject.org/updates/geoclue2-2.1.10-2.fc21
Comment 20 rjt@zygous.co.uk 2015-04-20 08:24:24 UTC
I can confirm that GNOME Maps 3.16.1 now correctly finds my location in an up-to-date Fedora 22.


Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.