Skip to content
This repository was archived by the owner on Apr 1, 2026. It is now read-only.
This repository was archived by the owner on Apr 1, 2026. It is now read-only.

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

Closed

Description

@orschiro

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

Activity

  1. serhiirepn commented on Mar 22, 2017

    @serhiirepn

    same problem

  2. LuisBL commented on Mar 25, 2017

    @LuisBL

    same problem here

  3. orschiro commented on Apr 2, 2017

    @orschiro
    Author

    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.

  4. orschiro commented on Apr 13, 2017

    @orschiro
    Author

    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?

  5. thkim1011 commented on May 11, 2017

    @thkim1011

    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.

  6. orschiro commented on May 11, 2017

    @orschiro
    Author

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

  7. thkim1011 commented on May 11, 2017

    @thkim1011

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

  8. orschiro commented on May 12, 2017

    @orschiro
    Author

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

  9. azispratama92 commented on May 25, 2017

    @azispratama92

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

  10. jonls commented on May 25, 2017

    @jonls
    Collaborator

    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.

  11. orschiro commented on Jun 13, 2017

    @orschiro
    Author

    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.

  12. orschiro commented on Jun 23, 2017

    @orschiro
    Author

    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.

  13. 31 remaining items

  14. Pinche-Dev commented on Apr 29, 2021

    @Pinche-Dev

    it helped me
    sudo apt-get remove redshift
    sudo apt-get install reshift-2.0
    sudo apt-get install redshift

    after:
    Trying location provider geoclue2'... Using provider geoclue2'.
    Could not connect to wayland display, exiting.
    Failed to start adjustment method wayland.
    Trying next method...
    Using method `randr'.
    Waiting for initial location to become available...
    Location: 27.74 N, 85.46 E

  15. Hunanbean commented on Jun 3, 2021

    @Hunanbean

    This is a bad design decision. Have the option to disable auto location and just let it use the system clock, if that is what the user wants. A paranoid person may view this as just another data gathering tool instead of a convenient, simple utility(who knows what/how they think). I simply prefer the choice of functional control.

  16. artforlife commented on Jul 15, 2021

    @artforlife

    I have the following in ~/.config/redshift.conf

    ; Global settings for redshift
    [redshift]
    ; Set the day and night screen temperatures
    temp-day=5000
    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.8
    ; It is also possible to use different settings for day and night since version 1.8.
    brightness-day=0.9
    brightness-night=0.7
    ; Set the screen gamma (for all colors, or each color channel individually)
    gamma=0.8
    ;gamma=0.8:0.7:0.8
    
    ; Set the location-provider: 'geoclue', 'gnome-clock', 'manual'
    ; type 'redshift -l list' to see possible values
    ; The location provider settings are in a different section.
    location-provider=geoclue2
    
    ; 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'
    [manual]
    ; set these values if you've set the location-provider to manual instead of geoclue
    ;lat=51.522698
    ;lon=-0.085358
    
    ; Configuration of the adjustment-method
    ; type 'redshift -m METHOD:help' to see the settings
    ; ex: 'redshift -m randr:help'
    
    [randr]
    screen=0
    

    I have also done sudo apt install geoclue-2.0.

    I have also added the following to /etc/geoclue/geoclue.conf

    [redshift]
    allowed=true
    system=false
    users=
    

    It works perfectly.

  17. Hunanbean commented on Jul 16, 2021

    @Hunanbean

    I did not see 'gnome-clock' as an option for location provider. If that works as i suspect it does, please disregard my previous rant. :)

  18. rbalint commented on Aug 17, 2021

    @rbalint

    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.

    Proposed adding this snippet at https://gitlab.freedesktop.org/geoclue/geoclue/-/merge_requests/92 to make redshift work out of the box.

  19. rbalint commented on Aug 22, 2021

    @rbalint

    GeoClue developers would add this snippet to the default config file if Redshift implemented a pop-up for user consent, but this is not their recommendation.

  20. rbalint commented on Aug 22, 2021

    @rbalint

    IMO this issue could be reopened to reflect that there is something that could be done on Redshift's side.

  21. hankyoTutorials commented on Dec 10, 2021

    @hankyoTutorials

    "redshift - slove geoclue2 redshift not working error"
    #redshift/software/extension geoclue2 not working/stopping error
    #ERROR:
    Trying location provider geoclue2'... Using provider geoclue2'.
    Unable to connect to GeoClue.
    Unable to get location from provider.
    #OR:
    Unable to start GeoClue client:
    GDBus.Error:org.freedesktop.DBus.Error.AccessDenied: Geolocation
    disabled for UID 1000. Unable to connect to GeoClue.
    Unable to get location from provider.

    #solution1) turn on the location:
    e.g:
    Gnome Settings > Privacy > location
    #unfortunatly most Desktop environment settings doesn't have location ON/OFF feature, but dont worry, we can install gnome settings manually:
    sudo apt install gnome-control-center
    #then enable location services
    gnome control center > privacy > location services

    #solution2) install geoclue2
    e.g:
    #on fedora:
    sudo dnf install geoclue2 geoclue2-libs geoclue2-devel geoclue2-demos
    #on debian:
    sudo apt install geoclue-2.0

    #solution3) run redshift with sudo
    e.g:
    sudo redshift

    #solution4) add these lines to /etc/geoclue/geoclue.conf:
    e.g:
    [redshift]
    allowed=true
    system=false
    users=

    #then run:
    sudo service geoclue restart

    #solution5) create a configuaration file(THIS SOLUTION WORKED FOR ME)
    e.g:
    #YOU NEED TO SET latitude(45th line) and longitude(46th line) manually
    #visit this site the file your lat & lon: https://www.latlong.net/
    #goto ~ /.config directory & created a file "redshift.conf" and put below lines in the redshift configuration file(~/.config/redshift.conf)
    ; 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=48.1
    lon=11.6

    ; 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

    #solution6) run redshift in background(if above solutions didn't work? you can try this):
    #remove redshift-gtk extension from panel and stop autostarting redshift in startup programs
    #then add this startup command to run redshift in background after login
    redshift -l 7:81 -t 5700:3600 -g 0.8 -m randr -v
    #you can change 0.8 to adust brightness(0.1 - 1)

    #links:
    #445
    https://askubuntu.com/questions/1061453/redshift-permission-error-gdbus-errororg-freedesktop-dbus-error-accessdenied

  22. ZishanAdThandar commented on Jan 25, 2022

    @ZishanAdThandar

    SOLUTION 1

    Simple working solutions:
    redshift -l LAT:LONG
    May be you are living in Kolkata and your latitude and longitude is approx 22 and 88, so use,
    redshift -l 22:88

    SOLUTION 2

    sudo apt-get install geoclue-2.0

  23. leonp5 commented on Aug 15, 2024

    @leonp5

    geoclue uses the location service from Mozilla which is no longer available.
    https://discourse.mozilla.org/t/retiring-the-mozilla-location-service/128693

    If you want, you can use Googles API instead. In the geoclue.conf it is described how to do this.

    # URL to the wifi geolocation service. The key can currenty be anything, just
    # needs to be present but that is likely going to change in future.
    url=https://location.services.mozilla.com/v1/geolocate?key=geoclue
    
    # To use the Google geolocation service instead of mozilla's, simply uncomment
    # this url while changing API_KEY to your Google API key and comment out or
    # remove the url above.
    #
    # WARNING: Please make sure that you are complying with the Google's ToS and
    #          policies if you uncomment this:
    #
    # https://developers.google.com/maps/documentation/geolocation/policies
    #
    #url=https://www.googleapis.com/geolocation/v1/geolocate?key=YOUR_KEY
    
  24. daviewales commented on Sep 9, 2024

    @daviewales

    Might be worth looking at https://beacondb.net/.
    I haven't been able to get it to work, but that might be because I only have one WiFi MAC address to try.
    (It should be in the database, because I've contributed with NeoStumbler.)

    See: https://konstantintutsch.com/blog/beacondb-geolocation-on-linux-gnome/

    Edit: I can confirm that geoclue-2 works with beacondb.

    Just ensure that you have the following in your /etc/geoclue/geoclue.conf:

    [wifi]
    enabled=true
    url=https://beacondb.net/v1/geolocate

    Note that it only works if there are multiple WiFi MAC addresses available. It doesn't appear to work when there is only one MAC address. (Also, you'll need to ensure that your local WiFi MAC addresses are in the location database, which you can do with NeoStumbler as described on the beacondb site.

  25. wojakcafe commented on Nov 20, 2024

    @wojakcafe

    Still an issue. I do not want to get a google API key. Why can't we have default long/lat along with an error code? Shit is busted:

    user@libre:~$ redshift -l (censored cords...) -b .7
    Failed to start adjustment method wayland.
    Trying next method...
    Using method `randr'.
    Waiting for initial location to become available...

  26. lukasz-piotr-jan-wieczorek commented on Feb 26, 2025

    @lukasz-piotr-jan-wieczorek

    I alread have geoclue2 and runned sudo service geoclue restart and it did not help. I am on Fedora.

  27. olmanqj commented on Aug 28, 2025

    @olmanqj

    [redshift]
    allowed=true
    system=false
    users=

    e

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions