Redshift: Failed to run Redshift: Trying location provider `geoclue2`...

Created on 6 Mar 2017  路  45Comments  路  Source: jonls/redshift

Dear all,

Can you please assist me with the following issue?

Steps to reproduce:

  1. Start OS without active internet connection.
  2. Start Redshift
  3. Redshift is unable to get the geolocation
  4. Connect to the internet
  5. Redshift is still unable to get the geolocation
  6. Quit Redshift
  7. The below message appears
  8. Restart Redshift
  9. Redshift is now able to get the geolocation

image

Most helpful comment

I had this problem right now, and running sudo redshift seems to do the trick.

EDIT: I think the solution is to turn on Settings > Privacy > Location Services. I did this right now, and it works without sudo.

All 45 comments

bump
ive got same problem

same problem

same problem here

See this comment from clayzermk1 (https://github.com/jonls/redshift/issues/318)
It may help.

clayzermk1 commented on 21 Nov 2016

Was encountering this and have a clean fix.
Currently using redshift 1.10-5ubuntu on Linux Mint 18 Sarah (straight from repo).

Installed redshift and redshift-gtk packages.
Attempted to run redshift-gtk and encountered this issue.
Ran redshift from command line and got:

$ redshift
Trying location provider geoclue2'... Using providergeoclue2'.
Unable to connect to GeoClue.
Unable to get location from provider.
Installed geoclue-2.0 sudo apt-get install geoclue-2.0.
Ran another time from the terminal.
Started no problems.
Exited the terminal process and started redshift-gtk, no problems.

Hope this helps someone else :beers:

Dear @davyguedes,

Sadly not in my case. I already have the package installed.

I guess it is not the problem that the function does not exist. But it cannot be run because of a missing internet connection. Once the connection is established, it does not recognise it and does not re-check using geoclue2.

Just an idea:

What if there was a way to provide a fallback lat and long value whenever geoclue2 cannot automatically fetch these values due to a missing internet connection?

I had this problem right now, and running sudo redshift seems to do the trick.

EDIT: I think the solution is to turn on Settings > Privacy > Location Services. I did this right now, and it works without sudo.

@thkim1011

EDIT: I think the solution is to turn on Settings > Privacy > Location Services. I did this right now, and it works without sudo.

Where can I find this setting? What desktop environment are you using?

@orschiro Oh I'm currently using gnome. I feel like other desktop environment should have a similar option.

@thkim1011 a more distro-agnostic solution would be great. I am using MATE and I don't have such an option, for example. :-(

me too i'm using Ubuntu Mate, well it seems redshift need online internet access to determine our excact location on the globe. I'm wondering too how can we tell te redshift to used .cached parameter, and manual geo location.
image

Dear developers please consider add this offline feature, thank you =)

Redshift does not directly require internet access, it just uses Geoclue2 by default to obtain the current location. Most commonly, Geoclue2 is setup to obtain the location from the IP address which only works with an internet connection. Also, more recently, as @thkim1011 mentioned, location services may need to be enabled or Redshift may need to be added to a list of applications that are allowed to use location services.

As a workaround, you can switch away from geoclue2 as the location provider and use the manual location provider instead. The easiest way to do this, is by creating a configuration file as shown here: http://jonls.dk/redshift/

Ideally we would have continuous location updates and a fallback if the location cannot be obtained automatically but nobody has had the time to work on that yet. It will require some significant rework of the core code of Redshift to get that working correctly.

Thank you for your clarifying statement, @jonls!

So, the manual config approach is the way to go then and remembering to update the location in the config file when moving places.

For your interest, I moved from Ubuntu MATE to Solus Budgie and there this automatic geo-location feature works out of the box. Meaning, I start without internet connection and my screen is "white". But as soon as I connect to the internet, Redshift automatically gets the right geolocation and applies the colour temperature.

Running with sudo solves the problem for me. You need root privileges to use the geolocation service. Not ideal however...

same

The problem seems to be Redshift's inability to determine your location. By default, Redshift works by tracking the natural light in your location. I use Ubuntu 16.04 and had the same issue. The fix for me was to manually set the latitude longitude values.
You can do this by running "redshift -l latitudeValue : longitudeValues"

This started happening to me after I updated from ubuntu 16.04 to 17.10, which has location turned off by default. I turned on location services in the privacy settings, and it worked

They made some changes in user groups in 17.10. Maybe it is no longer in an admin group.

Bdw, 17.10 has a great built-in night light mode. Just search it under settings.

That worked for me.

Add to /etc/geoclue/geoclue.conf:

[redshift]
allowed=true
system=false
users=

EDIT: It is enough to have internet connection before the first time you log in after starting the OS which is why:

ORIGINAL COMMENT: I had a very similar problem because I had unticked "All users may connect to this network" and restricted the password access to "Remember the password only for this user" in my network connection's settings. Undoing this solved it.

EDIT continued: Now I also need to wait for the internet connection to be established before logging in.

https://itsfoss.com/install-redshift-linux-mint/

Open a terminal and use the command below:

sudo apt-get install geoclue-2.0

I have the same problem and all the solutions you guys mention seem unfriendly
Looking up my longitude and latitude and writing to a config file huh. real classy bros
Why not just cache it, or determine it from system location or just use the time ...
anyway its up to you. blame it on the dependency

Hi

I had this problem because my proxy doesn't let me connect.

My Solution came from http://jonls.dk/redshift/ like jonls said.

In my case: (Colombia)

Open a terminal and write this
redshift -l 4.65:-74.06 -t 5700:3600 -g 0.8 -m randr -v &

Wait a couple of seconds and push ctr + c. And That's it.

In your case

Open a terminal ant write this
redshift -l [your latitude]:[your longitude] -t 5700:3600 -g 0.8 -m randr -v &
Wait a couple of seconds and push ctr + c. And That's it.

i had the same problem, easiest answer is to downgrade your geoclue package
for me using fedora : "sudo dnf downgrade geoclue2.x86_64"

I'm having this issue as of a few days ago. My /etc/geoclue/geoclue.conf has the entry for redshift but I'm still getting the same message.

@MarcosCosmos if your system has systemd, try restarting the services after updating the config and logout to restart

systemctl enable --user redshift.service # or redshift-gtk.service if you use system tray icon
systemctl start --user redshift.service

https://wiki.archlinux.org/index.php/redshift#Automatic_location_based_on_GeoClue2

@NearHuscarl It does. Previously I was using including redshift in a startup script associated with my DE.

Switching it to a systemctl service has had no affect on the issue, I'm still getting the same message - now it just tries again every time I close the prompt haha. (And yes I have reboot, repeatedly).

I am avoiding file-configured manual at the moment out of a habit to keep information out of my dotfiles. I suppose I could stop syncing redshift.conf...

I solved it by making a conf file.
~/.config/redshift.conf

Contents of the redshift.conf file:

; Global settings for redshift
[redshift]
; Set the day and night screen temperatures
temp-day=5700
temp-night=3500

; Enable/Disable a smooth transition between day and night
; 0 will cause a direct change from day to night screen temperature.
; 1 will gradually increase or decrease the screen temperature.
transition=1

; Set the screen brightness. Default is 1.0.
;brightness=0.9
; It is also possible to use different settings for day and night
; since version 1.8.
;brightness-day=0.7
;brightness-night=0.4
; Set the screen gamma (for all colors, or each color channel
; individually)
gamma=0.8
;gamma=0.8:0.7:0.8
; This can also be set individually for day and night since
; version 1.10.
;gamma-day=0.8:0.7:0.8
;gamma-night=0.6

; Set the location-provider: 'geoclue', 'geoclue2', 'manual'
; type 'redshift -l list' to see possible values.
; The location provider settings are in a different section.
location-provider=manual

; Set the adjustment-method: 'randr', 'vidmode'
; type 'redshift -m list' to see all possible values.
; 'randr' is the preferred method, 'vidmode' is an older API.
; but works in some cases when 'randr' does not.
; The adjustment method settings are in a different section.
adjustment-method=randr

; Configuration of the location-provider:
; type 'redshift -l PROVIDER:help' to see the settings.
; ex: 'redshift -l manual:help'
; Keep in mind that longitudes west of Greenwich (e.g. the Americas)
; are negative numbers.
[manual]
lat=
lon=

; Configuration of the adjustment-method
; type 'redshift -m METHOD:help' to see the settings.
; ex: 'redshift -m randr:help'
; In this example, randr is configured to adjust screen 1.
; Note that the numbering starts from 0, so this is actually the
; second screen. If this option is not specified, Redshift will try
; to adjust _all_ screens.
[randr]
screen=0

Set your screen number, lat and lon.

Fedora 28 with Mate
as Nicemak said earlier, (Jan 11th 2018) I had to modify the config file for geoclue and add the [redshift] section

Add to /etc/geoclue/geoclue.conf:

[redshift]
allowed=true
system=false

This solved the problem for me.
users=

@edwintorresmoya This fixed my issue!

In my case the problem was: Exiting Redshift won't kill the process. When I kill it manually and restart Redshift after the internet connection was established, everything worked.

2 things to get it working for me:

  1. Add redshift to geoclue.conf as suggested by nicemak. This alone did not solve the issue.
  2. Add "/usr/lib/geoclue-2.0/demos/agent" to startup applications so that geoclue runs on bootup, and redshift can utilize it.

Most people having this problem are using the API-Key provided by default from geoclue. I changed mine under /etc/geoclue/geoclue.conf and now it works fine. Just make sure whatever API you are using is returning something along the lines of

{"location": {"lat": 9999.9999, "lng": 9999.9999}, "accuracy": 1999.0}

where the "999" are your actual co-ordinates (roughly)

If you're having this issue after upgrading to Ubuntu 18.04 / 18.10 (and I higher I guess), make sure to enable location services in Settings > Privacy > Location services. Once enabled, start redshift once again, and you'll be prompted to give geoclue permission to use your location

As a workaround you can also install "fluxgui".

I had this problem right now, and running sudo redshift seems to do the trick.

EDIT: I think the solution is to turn on Settings > Privacy > Location Services. I did this right now, and it works without sudo.

Thank you very much. It is working for me in Debian 9.9 Stretch.

I'm using manjaro linux and @rwithik response works for me

I solved it by putting my geolocation inside the file ~/.config/redshift/redshift.conf like so:

[manual]
; Bermuda
lat=32.3212
lon=-64.7386

one also needs to set the location provider as manual. According to this documentation, this is how it should look like:

[redshift]
...
; Set the location-provider: 'geoclue2', 'manual'
; type 'redshift -l list' to see possible values.
; The location provider settings are in a different section.
location-provider=manual

...

; Keep in mind that longitudes west of Greenwich (e.g. the Americas)
; are negative numbers.
[manual]
lat=48.864716
lon=2.349014

I solved this by grabbing the configuration file from here and changing the lat and lon to my values.
Location-provider is set to manual, so it will use those values instead of attempting to connect to geoclue2.

After all this time, I'm still a little confused that this issue is closed and the main solution is to circumvent the failing feature entirely.

Manually defining the coordinates is fine and all but it doesn't actually erase the issue.

As far as I can tell, it remains to be seen what causes the issue, and whether or not there is a persisting bug in redshift or else somewhere upstream.

Should there be (or is there) some new/other issue more specifically about redshift failing to utilise geoclue2? If the feature no longer works it should probably be either fixed or removed or at the very least documentation should be updated.

That worked for me.

Add to /etc/geoclue/geoclue.conf:

[redshift]
allowed=true
system=false
users=

and after that i had to:

sudo service geoclue restart

and then start redshift.

I have this same problem. Has it been solved? In a convenient way, I mean.

I have this same problem. Has it been solved? In a convenient way, I mean.

Yes, this is the most definitive solution -> https://github.com/jonls/redshift/issues/445#issuecomment-410494059

Was this page helpful?
0 / 5 - 0 ratings

Related issues

deutrino picture deutrino  路  6Comments

lynysys picture lynysys  路  5Comments

ForsakenHarmony picture ForsakenHarmony  路  4Comments

freedomd1v3 picture freedomd1v3  路  4Comments

da2x picture da2x  路  6Comments