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

geoclue2 provider: Unable to start GeoClue client #158

Closed
ajacoutot opened this Issue Jan 10, 2015 · 73 comments

Comments

Projects
None yet
@ajacoutot
Copy link

ajacoutot commented Jan 10, 2015

Hi.

Using redshift 1.10 on OpenBSD, I cannot use the geoclue2 provider.
It fails with:

$ redshift
Trying location provider geoclue2'... Using providergeoclue2'.
Unable to start GeoClue client: GDBus.Error:org.freedesktop.DBus.Error.AccessDenied: Access denied.
Unable to connect to GeoClue.
Unable to get location from provider.

All other apps using geoclue2 work fine (e.g. gnome-maps).
Is there an obvious configuration tweak that I missed?
Thanks.

@jonls jonls added the bug label Jan 10, 2015

@jonls

This comment has been minimized.

Copy link
Owner

jonls commented Jan 12, 2015

None that I know of. Please report back if you figure out what the cause is.

@ajacoutot

This comment has been minimized.

Copy link

ajacoutot commented Jan 12, 2015

No cause sorry. But it's fully reproducible on Arch Linux as well.

@joelmarty

This comment has been minimized.

Copy link

joelmarty commented Jan 13, 2015

I can reproduce it in archlinux as well

@spikebike

This comment has been minimized.

Copy link

spikebike commented Jan 13, 2015

On 01/13/2015 02:20 PM, Joël Marty wrote:

I can reproduce it in archlinux as well


Reply to this email directly or view it on GitHub:
#158 (comment)

Ubuntu-14.04 as well.

@monkeydump

This comment has been minimized.

Copy link

monkeydump commented Jan 18, 2015

Anyone worked out a solution for this yet? I too am running arch & have this error.

@zbyna

This comment has been minimized.

Copy link

zbyna commented Jan 22, 2015

Mint 17.1 kde the same issue :
Failed to run Redshift
Trying location provider `geoclue2'...
Unable to connect to GeoClue.
Unable to get location from provider.

console output:
./redshift-gtk

** (redshift-gtk:13902): WARNING **: Error retrieving accessibility bus address: org.freedesktop.DBus.Error.ServiceUnknown: The name org.a11y.Bus was not provided by any .service files

@zbyna

This comment has been minimized.

Copy link

zbyna commented Jan 22, 2015

Slightly progress:
after installing:
Commit Log for Thu Jan 22 21:51:18 2015
at-spi2-core (2.10.2.is.2.10.1-0ubuntu1)
disappeared :
** (redshift-gtk:13902): WARNING **: Error retrieving accessibility bus address: org.freedesktop.DBus.Error.ServiceUnknown: The name org.a11y.Bus was not provided by any .service files
and /usr/share/dbus-1/services/org.a11y.Bus.service was created
output:
./redshift-gtk
Failed to run Redshift
Trying location provider `geoclue2'...
Unable to connect to GeoClue.
Unable to get location from provider.

console output:
nothing
without gui:
./redshift
Zkouší se poskytovatel polohy geoclue2'... trying location provider .. Používám poskytovatelegeoclue2'. using location provider ...
Unable to connect to GeoClue.
Nebylo možné získat polohu od poskytovatele. Unable to get location from provider.

@robr3rd

This comment has been minimized.

Copy link

robr3rd commented Jan 23, 2015

Ditto on up-to-date Arch, except my error message leaves out the last two lines (even after waiting 1.5 hours before hitting CTRL+C):

Trying location provider `geoclue2'...
Using provider `geoclue2'.
Unable to start GeoClue client: GDBus.Error:org.freedesktop.DBus.Error.AccessDenied: Access denied.
@zbyna

This comment has been minimized.

Copy link

zbyna commented Jan 23, 2015

It works, here are all my libs related "geoclue" installed, geoclue-2.0 seems to be the problem (at-spi2-core which I mentioned in previous post can be uninstalled without affecting redshift running 😕 ):


ii  geoclue                               0.12.99-3ubuntu1        amd64                   Geographic information framework
ii  geoclue-2.0                           2.0.0-4                 amd64                   geoinformation service
ii  geoclue-geonames                      0.12.99-3ubuntu1        amd64                   Geocoder provider for GeoClue (geonames)
ii  geoclue-gpsd                          0.12.99-2ubuntu2        amd64                   Position server for GeoClue (GPS)
ii  geoclue-gsmloc                        0.12.99-3ubuntu1        amd64                   Position server for GeoClue (GSM)
ii  geoclue-gypsy                         0.12.99-2ubuntu2        amd64                   Position server for GeoClue (GYPSY)
ii  geoclue-hostip                        0.12.99-3ubuntu1        amd64                   Position server for GeoClue (hostip)
ii  geoclue-localnet                      0.12.99-3ubuntu1        amd64                   Position server for GeoClue (local network)
ii  geoclue-manual                        0.12.99-3ubuntu1        amd64                   Position server for GeoClue (manual)
ii  geoclue-nominatim                     0.12.99-3ubuntu1        amd64                   Geocoding and reverse-geocoding server for GeoClue (Nominatim)
ii  geoclue-plazes                        0.12.99-3ubuntu1        amd64                   Position server for GeoClue (Plazes)
un  geoclue-provider                      <žádná>                 <none>                  (popis není k dispozici)
ii  geoclue-skyhook                       0.12.99-3ubuntu1        amd64                   Map and geocode server for GeoClue (Skyhook)
ii  geoclue-ubuntu-geoip                  1.0.2+14.04.20131125-0u amd64                   Provide positioning for GeoClue via Ubuntu GeoIP services
ii  geoclue-yahoo                         0.12.99-3ubuntu1        amd64                   Map and geocode server for GeoClue (Yahoo)
ii  libgeoclue-dev                        0.12.99-3ubuntu1        amd64                   C API for GeoClue (development files)
ii  libgeoclue0:amd64                     0.12.99-3ubuntu1        amd64                   C API for GeoClue
ii  python-geoclue                        0.1.0-4build1           all                     Python module to access Geoclue data
@jonls

This comment has been minimized.

Copy link
Owner

jonls commented Jan 24, 2015

@ajacoutot @joelmarty @monkeydump Did any of you Arch people try to change /etc/geoclue/geoclue.conf? It seems from this post that it is locked down to a few programs by default.

@ajacoutot

This comment has been minimized.

Copy link

ajacoutot commented Jan 24, 2015

That's correct. Adding this to geoclue.conf did the trick.
Thanks for the link!

[redshift]
allowed=true
system=false
users=

@ajacoutot ajacoutot closed this Jan 24, 2015

@jonls

This comment has been minimized.

Copy link
Owner

jonls commented Jan 24, 2015

Great, thanks for testing. This appears to actually be the default setup for more recent versions of GeoClue2 so it will probably also be a problem in other distributions when GeoClue2 is updated.

@yafp

This comment has been minimized.

Copy link

yafp commented Feb 21, 2015

had the same issue on fedora 21 - adding the 3 lines mentioned above in the .conf solved the issue as expected.

Thanks.

@heyakyra

This comment has been minimized.

Copy link

heyakyra commented Apr 24, 2015

If this is not a bug with redshift, then it should be reported with upstream geoclue or at least with individual distributions' packaging of it. I have filed a report for Fedora GNU here, and encourage others to do the same for their distros: https://bugzilla.redhat.com/show_bug.cgi?id=1214978

@naufraghi

This comment has been minimized.

Copy link

naufraghi commented Jun 4, 2015

IMHO this is a redshift bug too, it should continue with a manual fallback in case of error.

@bigon

This comment has been minimized.

Copy link
Contributor

bigon commented Jul 6, 2015

I've reported the bug to geoclue upstream, see:

https://bugs.freedesktop.org/show_bug.cgi?id=91237

@bigon

This comment has been minimized.

Copy link
Contributor

bigon commented Jul 6, 2015

As mentioned in the upstream bugreport, adding a redshift.desktop file is fixing the issue for me

bigon added a commit to bigon/redshift that referenced this issue Jul 6, 2015

Add a redshift desktop file (jonls#158)
This should fix the fact that redshift cannot query its location using
geoclue 2

bigon added a commit to bigon/redshift that referenced this issue Jul 6, 2015

Add a redshift desktop file (jonls#158)
This should fix the fact that redshift cannot query its location using
geoclue 2

bigon added a commit to bigon/redshift that referenced this issue Jul 6, 2015

Add a redshift desktop file (jonls#158)
This should fix the fact that redshift cannot query its location using
geoclue 2

jonls added a commit that referenced this issue Jul 19, 2015

Merge pull request #237 from bigon/master
Add a redshift desktop file (#158)
@jamb0ss

This comment has been minimized.

Copy link

jamb0ss commented Aug 17, 2015

The same 3 lines in /usr/lib/geoclue/geoclue.conf (Ubuntu 14.04) have not solved this issue

@praest76

This comment has been minimized.

Copy link

praest76 commented Aug 17, 2015

Adding those lines to geoclue.conf worked for me after a reboot.

@jcrace

This comment has been minimized.

Copy link

jcrace commented Aug 17, 2015

Like jamb0ss I am running Ubuntu 14.04 and cannot get redshift to work with geoclue. I'd prefer not having to hardcode the latitude and longitude.

@bigon

This comment has been minimized.

Copy link
Contributor

bigon commented Aug 18, 2015

You can try to add this file https://github.com/bigon/redshift/blob/master/data/applications/redshift.desktop.in in /usr/share/applications/redshift.desktop

jonls added a commit that referenced this issue Sep 8, 2015

Merge pull request #250 from bigon/master
redshift.desktop: Use NoDisplay instead of Hidden keyword (#158)
@bokiscout

This comment has been minimized.

Copy link

bokiscout commented Sep 20, 2015

For this issue You can use manual configuration file '~/.config/redshift.conf' with content similar to one provided in archwiki

Note: I had to change my location (obviously) and to change monitor from 1 to 0.

@scottymiller9

This comment has been minimized.

Copy link

scottymiller9 commented Aug 5, 2016

yeah all I had to do was install geoclue 2.0!

@FreddyFernando

This comment has been minimized.

Copy link

FreddyFernando commented Sep 9, 2016

Installing geoclue-2.0 did the trick.

@unxed

This comment has been minimized.

Copy link

unxed commented Oct 10, 2016

sudo apt-get remove geoclue*
sudo apt-get install geoclue-2.0

fixed an issue for me

@kindlychung

This comment has been minimized.

Copy link

kindlychung commented May 7, 2017

Appending to /etc/geoclue/geoclue.conf solved the problem for me on a ubuntu 16.04 machine.

@PedroMAlves

This comment has been minimized.

Copy link

PedroMAlves commented Aug 28, 2017

In my case the issue does not always happens. If I have no internet connection at startup redshift will not work. But even after getting web I need to restart redshift a few times until it works. It should save my location so it won't have to go online every time the system boots. Tried a few of these solutions, let's see if it works now.

@nkkollaw

This comment has been minimized.

Copy link

nkkollaw commented Mar 16, 2018

Still having Geoclue problems in 03/2018.

None of the solutions work on Xfce, only manually setting the lat/lng:

redshift-gtk -l 51:17

(in my case)

@fleamour

This comment has been minimized.

Copy link

fleamour commented Jun 5, 2018

Reproducible under Tumbleweed (05/06/18.)

@hovancik

This comment has been minimized.

Copy link

hovancik commented Jun 11, 2018

still problem under debian xfce

conta@debianbook:~$ sudo redshift
Trying location provider `geoclue2'...
Using provider `geoclue2'.
Unable to start GeoClue client: GDBus.Error:org.freedesktop.DBus.Error.AccessDenied: 'redshift' disallowed, no agent for UID 0.
Unable to connect to GeoClue.
Unable to get location from provider.
@fleamour

This comment has been minimized.

Copy link

fleamour commented Jun 11, 2018

One solution is to manually set lat:long.

@baryluk

This comment has been minimized.

Copy link

baryluk commented Jun 13, 2018

It would be much better, if redshift continue even if access is denied. Or present more useful error message with hints what to do.

On a side note, I personally think that geoclue is way too restrictive, and should by default provide some minimal level of geolocation, i.e. GeoIP data to a level of city or state, because redshift is already capable of doing own TCP/HTTP connections to external serverer and figure this out without use of geoclue services.

https://bugs.debian.org/900936 for related geoclue bug.

Notice the "no agent for UID ...". I guess agent, is some auxilary program, that pops up to ask user in secure context to allow or disallow dynamically new applications.

I am using MATE DE, and that is probably the problem. Again this is a design flaw in geoclue, as one cannot implement all possible agents for various services directly in desktop manager.

In Debian sid/unstable, one can find a package geoclue-2-demo, version 2.4.10-1, and an executable /usr/lib/geoclue-2.0/demos/agent, that implements generic agent. Try running it. (In fact is also mentioned in /etc/xdg/start/, so it should autostart in all reasonable desktop environments). And if Debian maintainer is reading this, I would suggest to split geoclue-2-demo into separate package with demo and with agent (and put agent into /usr/bin with reasonable name!). Then in redshift-gtk add Recommends to install this geoclue-2-gtk-agent. (and also to libgeoclue-2-0 package itself, so any app using C library also recommends agent).

Anyhow when I run geoclue demo agent, and where-am-i demos, I receive briefly a notification from MATE in corner with timeout and question yes, no, if I want to allow access to location information. But clicking Yes does nothing, or it disappears quicker than timeout. Sometimes it doesn't show at all. No idea what is going on.

@joshmule

This comment has been minimized.

Copy link

joshmule commented Jun 13, 2018

Same issue in Fedora 28:
screenshot from 2018-06-13 12-39-18

@baryluk

This comment has been minimized.

Copy link

baryluk commented Jun 13, 2018

Update: Installing geoclue-2-demo in Debian, and restarting my DE (or logging again), seems to solved the issue.

@justinkterry

This comment has been minimized.

Copy link

justinkterry commented Jun 14, 2018

Reproduced in Ubuntu 16.04.

@hovancik

This comment has been minimized.

Copy link

hovancik commented Jun 14, 2018

Debian sid with XFCE: I've installed geoclue-2-demo. After restart it asks me if I wanna allow redshift to access location, but it still doesn't work, same error

@bigon

This comment has been minimized.

Copy link
Contributor

bigon commented Jun 14, 2018

I think that an other bug should be opened for that.

The initial bug here was that redshift was not providing a .desktop file

The recent new issues are related to a change in geoclue 2.4.10 and is completely different. As a side note, bugs should be opened in the different DE (KDE, Mate,....) to support the geoclue agent

@smetj

This comment has been minimized.

Copy link

smetj commented Jun 22, 2018

On Fedora KDE, you will need to add yourself to the geoclue group.
Logout & login and it works

@darioseidl

This comment has been minimized.

Copy link

darioseidl commented Jun 23, 2018

None of the suggestions worked for me (Debian Sid with xfce), except for providing the location manually in ~/.config/redshift.conf:

[redshift]
location-provider=manual

[manual]
lat=48.2
lon=16.4
@nycjv321

This comment has been minimized.

Copy link

nycjv321 commented Jul 6, 2018

@darioseidl your solution, manual redshift.conf, worked. thanks!

@tangxinfa

This comment has been minimized.

Copy link

tangxinfa commented Jul 23, 2018

The geoclue-demo-agent.desktop will activate geoclue.service through DBUS, but
geoclue.service will auto exit if no use in 5 seconds, this is the problem.

It works on archlinux with following steps:

1, Append configuration section to /etc/geoclue/geoclue.conf

[redshift]
allowed=true
system=false
users=

2, Startup geoclue-demo-agent.desktop and redshift-gtk.desktop one by one

dex /etc/xdg/autostart/geoclue-demo-agent.desktop
dex /usr/share/applications/redshift-gtk.desktop
@stpeters00

This comment has been minimized.

Copy link

stpeters00 commented Jul 23, 2018

In the second (Startup) step, when editing the .desktop files with dex, what is supposed to be added, changed, or removed?

@waldauf

This comment has been minimized.

Copy link

waldauf commented Jul 24, 2018

I proceeded according @tangxinfa instructions. But instead dex I used kioclient exec (KDE command for run .desktop files):

  1. First console:
$ kioclient exec /usr/share/applications/geoclue-demo-agent.desktop
Geolocation service not in use
Geolocation service in use  # ... displayed after run redshift command
  1. Second console:
$ redshift-qt 
"Using provider `geoclue2'."
"Solar elevations: day above 3.0, night below -6.0"
"Temperatures: 6500K at day, 4500K at night"
"Brightness: 1.00:1.00"
"Gamma (Daytime): 1.000, 1.000, 1.000"
"Gamma (Night): 1.000, 1.000, 1.000"
"Using method `randr'."
"Location: 52.28 N, 9.97 E"
"Color temperature: 6500K"
"Brightness: 1.00"
"Status: Enabled"
"Period: Daytime"
Redshift status change:  disabled
"Status: Disabled"
"Period: None"
Redshift status change:  enabled
"Status: Enabled"
"Period: Daytime"

... now redshift seems to be started and run (I'll checked it later now I have 9.00 AM :] )

@stpeters00

This comment has been minimized.

Copy link

stpeters00 commented Jul 24, 2018

Is there a dex that does something similar to kioclient exec?

I'd never heard of a dex command, but a Fedora 28 dnf search dex turned up a package for a text editor called dex. Some googling turned up other things called dex, but none of them look like a program to run .desktop files.

Also, where did redshift-qt come from?

@MarcinWieczorek

This comment has been minimized.

Copy link

MarcinWieczorek commented Jul 24, 2018

Trying location provider `geoclue2'...
Using provider `geoclue2'.
Using method `randr'.
Waiting for initial location to become available...
Unable to start GeoClue client: GDBus.Error:org.freedesktop.DBus.Error.NoReply: Message recipient disconnected from message bus without replying.
Unable to get location from provider.

Downgrading geoclue (2.4.10-1 => 2.4.7-1) worked like a charm.

@RatanRSur

This comment has been minimized.

Copy link

RatanRSur commented Aug 13, 2018

I'm also getting this on Arch Linux even after adding the lines to the config:
redshift 1.12
geoclue2 2.4.11

@bbaserdem

This comment has been minimized.

Copy link

bbaserdem commented Aug 24, 2018

Same issue here, adding lines to geoconf config does not fix the issue.

@jonls

This comment has been minimized.

Copy link
Owner

jonls commented Aug 24, 2018

It looks like some of you are seeing the same error as #636. Please take a look at the summary here: #636 (comment) for workarounds and take a look at the comments by zeenix in that issue.

This issue has been closed for a while and the original issue was resolved with a workaround. What some of you are experiencing is probably different issues that don't belong here so I'll lock this thread and you can go ahead and open new issues if you are still having issues. However, please take a minute to consider if you issue is with your distro or with GeoClue, in which case you should open an issue with those projects instead of here!

Repository owner locked as off topic and limited conversation to collaborators Aug 24, 2018

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.