Bug 1093592

Summary: redshift doesn't work after geoclue2 update
Product: [openSUSE] openSUSE Tumbleweed Reporter: Dany Marcoux <dmarcoux>
Component: X11 ApplicationsAssignee: Tejas Guruswamy <masterpatricko>
Status: CONFIRMED --- QA Contact: E-mail List <qa-bugs>
Severity: Normal    
Priority: P5 - None CC: abogical, Andreas.Stieger, duge, ftefrjbhfvasf32, matthias, rs.opensuse, tzotsos
Version: Current   
Target Milestone: ---   
Hardware: Other   
OS: Other   
Found By: --- Services Priority:
Business Priority: Blocker: ---
Marketing QA Status: --- IT Deployment: ---
Attachments: redshift error

Description Dany Marcoux 2018-05-16 21:52:59 UTC
Created attachment 770512 [details]
redshift error


I updated to the latest snapshot (2018 05 15) and since then, redshift with geoclue2 doesn't work. After launching, it displays an error (see attachment). This wasn't happening with the previous snapshot I had, but I'm not sure which one. The issue seems to arise due to changes within the recent revisions of the geoclue2 package, so as far as 2 months ago. So by looking at the snapshots, I suspect it is in one of those:

- 2018 03 04
- 2018 04 24
- 2018 05 11
- 2018 05 13

The workaround is to provide the latitude and longitude manually with the option -l.
Comment 1 Ɓukasz Konieczny 2018-06-18 09:14:19 UTC
I have the same problem. I'm using KDE Plasma with redshift plasmoid. I have tried to run geoclue from services manager in YaST and then i had the popup window with message that there is no install section in description file of geoclue service. I have looked into /usr/lib/systemd/system/geoclue.service and indeed there is no [Install] section.
Comment 2 Dany Marcoux 2018-08-22 19:30:41 UTC
I have found a fix for this. The file '/etc/geoclue/geoclue.conf' needs to have the following lines:


Source: https://wiki.archlinux.org/index.php/redshift#Automatic_location_based_on_GeoClue2
Comment 3 robert spitzenpfeil 2019-05-05 21:59:56 UTC
Currently it's not working for me.

The location service URL given in the config files throws an error when pointed at with a web browser. This may go away spontaneously, but still...


{"error":{"code":403,"message":"You have exceeded your daily limit.","errors":[{"domain":"usageLimits","message":"You have exceeded your daily limit.","reason":"dailyLimitExceeded"}]}}


You can put in other keys, right now "test" seems to work, but that's not a permanent solution.

For the time being I'll just provide coordinates to redshift manually.
Comment 4 Moritz Duge 2022-06-08 18:06:29 UTC
Since version 15.4 openSUSE-LEAP is affected too.
(was working fine until 15.3)

See: bug 1200355
Comment 5 Tejas Guruswamy 2022-11-20 08:03:56 UTC
*** Bug 1200355 has been marked as a duplicate of this bug. ***
Comment 6 Tejas Guruswamy 2022-11-20 08:17:03 UTC
After a long investigation I finally understand the situation -- see https://gitlab.freedesktop.org/geoclue/geoclue/-/issues/143 and https://github.com/jonls/redshift/issues/636 for background.

Essentially redshift queries geoclue for a location, which fires up a system DBUS service. This then checks with a user authentication agent if you are allowed to get the location. The system service exists again after 60 seconds of inactivity.

Failure point #1 is if no user agent is running. In the current geoclue package the user authentication agent is started by desktop autostart (/etc/xdg/autostart/geoclue-demo-agent.desktop) so if you are not running a desktop login, you cannot use GeoClue. This failure is consistent and can be avoided by manually starting the demo agent first.
In GeoClue prior to 2.5.7, you could work around the need for an agent by adding a stanza to the geoclue.conf file. But with GeoClue 2.5.7 (in Leap 15.4) the agent checks became more strict and that no longer applies.
This is intentional by the GeoClue devs.

Failure point #2 is that the GeoClue system service was not waiting long enough for the authentication agent to respond. (Hence why running the query twice sometimes works). This failure is essentially a GeoClue bug and can be fixed by upgrading to GeoClue 2.6.0 (already in Tumbleweed).

If those still using redshift on Leap 15.4 can detail exactly what their expectations and use cases are for redshift+geoclue, I can see if any other workarounds are possible; but the core problems are not with redshift.
Note that both GNOME and KDE Plasma now have built-in equivalents to redshift so it's unlikely to receive any further upstream maintenance.