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

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

Closed
orschiro opened this Issue Mar 6, 2017 · 34 comments

Comments

Projects
None yet
@orschiro
Copy link

orschiro commented Mar 6, 2017

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

@Antinatalist

This comment has been minimized.

Copy link

Antinatalist commented Mar 9, 2017

bump
ive got same problem

@serhiirepin

This comment has been minimized.

Copy link

serhiirepin commented Mar 22, 2017

same problem

@LuisBL

This comment has been minimized.

Copy link

LuisBL commented Mar 25, 2017

same problem here

@ghost

This comment has been minimized.

Copy link

ghost commented Apr 1, 2017

See this comment from clayzermk1 (#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 provider geoclue2'.
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 🍻

@orschiro

This comment has been minimized.

Copy link
Author

orschiro commented Apr 2, 2017

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.

@orschiro

This comment has been minimized.

Copy link
Author

orschiro commented Apr 13, 2017

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?

@thkim1011

This comment has been minimized.

Copy link

thkim1011 commented May 11, 2017

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.

@orschiro

This comment has been minimized.

Copy link
Author

orschiro commented May 11, 2017

@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?

@thkim1011

This comment has been minimized.

Copy link

thkim1011 commented May 11, 2017

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

@orschiro

This comment has been minimized.

Copy link
Author

orschiro commented May 12, 2017

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

@azispratama92

This comment has been minimized.

Copy link

azispratama92 commented May 25, 2017

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 =)

@jonls

This comment has been minimized.

Copy link
Owner

jonls commented May 25, 2017

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.

@orschiro

This comment has been minimized.

Copy link
Author

orschiro commented Jun 13, 2017

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.

@orschiro

This comment has been minimized.

Copy link
Author

orschiro commented Jun 23, 2017

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.

@jonls jonls closed this Jul 26, 2017

@jo-ruch

This comment has been minimized.

Copy link

jo-ruch commented Sep 27, 2017

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

@vv7v7

This comment has been minimized.

Copy link

vv7v7 commented Nov 11, 2017

same

@ovieu

This comment has been minimized.

Copy link

ovieu commented Dec 4, 2017

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"

@trbedwards

This comment has been minimized.

Copy link

trbedwards commented Dec 29, 2017

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

@jo-ruch

This comment has been minimized.

Copy link

jo-ruch commented Dec 29, 2017

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.

@nicemak

This comment has been minimized.

Copy link

nicemak commented Jan 12, 2018

That worked for me.

Add to /etc/geoclue/geoclue.conf:

[redshift]
allowed=true
system=false
users=

@knizinski

This comment has been minimized.

Copy link

knizinski commented Jan 26, 2018

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.

@ekam230

This comment has been minimized.

Copy link

ekam230 commented Feb 4, 2018

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

Open a terminal and use the command below:

sudo apt-get install geoclue-2.0

@JoshKisb

This comment has been minimized.

Copy link

JoshKisb commented Feb 8, 2018

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

@edwintorresmoya

This comment has been minimized.

Copy link

edwintorresmoya commented May 2, 2018

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.

@HadyAhmed

This comment has been minimized.

Copy link

HadyAhmed commented Jun 27, 2018

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

@MarcosCosmos

This comment has been minimized.

Copy link

MarcosCosmos commented Jul 22, 2018

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.

@NearHuscarl

This comment has been minimized.

Copy link

NearHuscarl commented Jul 31, 2018

@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

@MarcosCosmos

This comment has been minimized.

Copy link

MarcosCosmos commented Aug 1, 2018

@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...

@rwithik

This comment has been minimized.

Copy link

rwithik commented Aug 5, 2018

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.

@rlengland

This comment has been minimized.

Copy link

rlengland commented Aug 6, 2018

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=

@ghost

This comment has been minimized.

Copy link

ghost commented Sep 7, 2018

@danielroehrborn

This comment has been minimized.

Copy link

danielroehrborn commented Jan 15, 2019

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.

@JeMorriso

This comment has been minimized.

Copy link

JeMorriso commented Jan 28, 2019

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.
@pm-steiner

This comment has been minimized.

Copy link

pm-steiner commented Jan 30, 2019

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)

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