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.

Unable to connect to GeoClue. Unable to get location from provider. #318

Open

Description

@DimitriPapadopoulos

Unable to start redshift 1.11 on Fedora 23 since yesterday:

$ redshift
Trying location provider `geoclue2'...
Using provider `geoclue2'.
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.
$ 

This is similar to #158 but the proper fix - having both redshift.desktop and redshift-gtk.desktop files - doesn't help any more. Indeed both files are available in Fedora since #1309177 was closed:

$ rpm -qf /usr/share/applications/redshift.desktop
redshift-1.11-1.fc23.x86_64
$ rpm -qf /usr/share/applications/redshift-gtk.desktop
redshift-gtk-1.11-1.fc23.x86_64
$ 

Both alternative solutions work although they are supposed to be bad solutions:

  1. Run as sudo redshift-gtk
  2. Add to /etc/geoclue/geoclue.conf:
[redshift]
allowed=true
system=false
users=

Activity

  1. DimitriPapadopoulos commented on Feb 21, 2016

    @DimitriPapadopoulos
    Author

    I've found location services had been turned off. After turning on location services redshift runs smoothly.

    It makes sense that redshift needs a location. However instead of exiting with a cryptic error message, redshift could display a dialog to manually set a location or turn on location services.

    For example gnome-maps doesn't crash when location services are not running:

    • either you enter a location manually from the search bar,
    • or gnome-maps offers to turn on location services in settings.

    See attached screen capture of gnome-maps:
    gnome-maps

  2. mikeatlas commented on Feb 24, 2016

    @mikeatlas

    @DimitriPapadopoulos where can I "turn on location services" setting you are describing... gnome-maps doesn't work on 14.04. I presume there's an underlying package and not something inherently required about gnome-maps being installed to fix redshift's geoclue2 problems.

  3. DimitriPapadopoulos commented on Feb 25, 2016

    @DimitriPapadopoulos
    Author

    Gnome maps is just an example of an alternative way to handle missing location services. Other than that it is totally unrelated to redshift.
    I don't know about Ubuntu 14.04, I have Fedora 23 here and location services can be enabled/disabled from Settings.

  4. DimitriPapadopoulos commented on Feb 25, 2016

    @DimitriPapadopoulos
    Author

    As far as I can tell it is quite difficult to disable intrusive services like geoclue (location service) in Ubuntu:
    http://askubuntu.com/questions/106916/how-do-i-stop-geoip-from-connecting-to-the-internet-every-time-i-boot

    My guess is that location services are not disabled on your Ubuntu computer. Also I have just tried an Ubuntu 14.04 workstation and gnome-maps works pretty well once installed. Something might be broken on your computer.

  5. mikeatlas commented on Feb 25, 2016

    @mikeatlas

    I decided to just install the latest build 1.11 from source and specify my lat:lon manually in the config. Personally I don't travel with my workstation across time zones .... Like ever. So dynamic geoclue calls every time redshift starts aren't really worth the struggle to resolve. Thanks for the reply @DimitriPapadopoulos

  6. clayzermk1 commented on Nov 21, 2016

    @clayzermk1

    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 🍻

  7. eadebayo commented on Dec 12, 2016

    @eadebayo

    @clayzermk1
    Thanks for the post. Worked for me. Mint 18, MATE.

  8. clayzermk1 commented on Dec 13, 2016

    @clayzermk1

    At least in the .deb, it seems like geoclue-2.0 should be a requirement of the package if it's required. It seems like the .rpm could also use a dependency based on @DimitriPapadopoulos's original post. Can anyone on a .rpm distro comment as to the minimum set of packages they had to install to get redshift to work?

  9. mrschaal commented on Jan 8, 2017

    @mrschaal

    @clayzermk1 thank you very much, helped me a lot. Worked perfectly for me, using Linux Mint 18 KDE

  10. vbsteja commented on Apr 19, 2017

    @vbsteja

    @clayzermk1 it solved for me. thanks so much.

  11. artforlife commented on Oct 28, 2017

    @artforlife

    I am still having this issue on Ubuntu 16.04. I have tried every solution advised in this thread to no avail. Any idea how I can troubleshoot this?

  12. imflash217 commented on Nov 1, 2017

    @imflash217

    Based on the original post, the geo2 location provider is already installed.
    So there are two solutions to this:

    1. Run Redshift from command line as root sudo redshift
    2. Turn on Location services: Goto Settings --> Privacy --> Location Services (ON/OFF)
  13. sodomak commented on Feb 23, 2018

    @sodomak

    Ok, so it is not possible to run Redshift without location services? It would be nice to be able to set the location manualy (I think I know where I am:) ). I see it as the privacy issue.

  14. helo9 commented on Feb 24, 2018

    @helo9

    No you don't need any location service, simply pass
    -l LAT:LON
    as option on command line.

  15. saif-ellafi commented on Jun 18, 2018

    @saif-ellafi

    On Fedora 28 KDE, only thing that worked was redshift-gtk -l 0:0

  16. 74 remaining items

  17. ToddAndMargo commented on Jan 16, 2022

    @ToddAndMargo
  18. jakob1379 commented on Jan 17, 2022

    @jakob1379

    I got this error and instead of having to install yet another program I put this snippet together

    #!/usr/bin/env bash
    set -euo pipefail
    IFS=$'\n\t'
    
    if [ ! -z "$(pgrep redshift)" ]; then
        killall redshift
        wait
    fi
    
    gpsinfo="$(curl -s ipinfo.io | sed 's/[" ]//g')"
    lat=$(echo "$gpsinfo" | awk -F '[:,]' '/loc/{print $2}')
    lon=$(echo "$gpsinfo" | awk -F '[:,]' '/loc/{print $3}')
    
    redshift-gtk -l $lat:$lon 2>/dev/null &
    
    
  19. mhitza commented on May 6, 2022

    @mhitza

    To work around this issue, I've made the geoclue service autostart on multi-user.target (graphical.target definitely should work as well).

    In order to do that I've created the directory and file /etc/systemd/system/geoclue.service.d/multi-user.conf (a systemd drop-in file/override) with the following content.

    [Install]
    WantedBy=multi-user.target
    sudo systemctl daemon-reload
    sudo systemctl enable geoclue.service
  20. Reno-Sifana commented on Jul 8, 2022

    @Reno-Sifana

    Based on the original post, the geo2 location provider is already installed. So there are two solutions to this:

    1. Run Redshift from command line as root **`sudo redshift`**
    
    2. Turn on Location services: Goto **Settings --> Privacy --> Location Services (ON/OFF)**
    

    Yesterday I after restarting my linux at night I realized suddenly Redshift didn't detect my location. After morning to evening I reinstalled Redshift and changed the geoclue.conf configuration to no avail. instead there is a "Timeout was reached" error message when I run the sudo timeshift command in the terminal.
    Desktop Environment: Xfce
    Screenshot_2022-07-08_23-03-27

  21. goekce commented on Sep 18, 2022

    @goekce

    @Reno-Sifana I had the same output on Archlinux using i3. I solved it by running /usr/lib/geoclue-2.0/demos/agent in the background.

    For details, refer to the redshift page on Archwiki.

  22. Reno-Sifana commented on Sep 18, 2022

    @Reno-Sifana

    @Reno-Sifana I had the same output on Archlinux using i3. I solved it by running /usr/lib/geoclue-2.0/demos/agent in the background.

    For details, refer to the redshift page on Archwiki.

    Yes. At that time the geoclue agent was already in the Startup list. It turns out that the cause is because the internet connection at home is not reliable. (which I remember at that time)

  23. paxapy commented on Nov 18, 2022

    @paxapy

    @Reno-Sifana I had the same output on Archlinux using i3. I solved it by running /usr/lib/geoclue-2.0/demos/agent in the background.

    For details, refer to the redshift page on Archwiki.

    Can confirm on Ubuntu 22.04 solved with running an agent.
    Had to add it to autorun..
    Yet I prefer manually setting lon/lat but it seems like .config/redshift/redshift.conf ignored when installing as regular package.

  24. DeeDeeRanged commented on Dec 16, 2022

    @DeeDeeRanged

    @Reno-Sifana I had the same output on Archlinux using i3. I solved it by running /usr/lib/geoclue-2.0/demos/agent in the background.
    For details, refer to the redshift page on Archwiki.

    Can confirm on Ubuntu 22.04 solved with running an agent. Had to add it to autorun.. Yet I prefer manually setting lon/lat but it seems like .config/redshift/redshift.conf ignored when installing as regular package.

    On Debian you put the file here .config/redshift.conf and not ./config/redshift/redshift.conf
    This is mentioned in the man redshift.

  25. TomaszWaszczyk commented on Jun 1, 2023

    @TomaszWaszczyk

    On Debian same problem:

    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...
    
  26. raimue commented on Jul 9, 2023

    @raimue

    In my case the problem was two-fold on Ubuntu 22.04 LTS. I had the described problem with geoclue2 and tried overriding this in ~/.config/redshift.conf like this:

    [redshift]
    location-provider=manual
    [manual]
    lon=42
    lat=23
    

    However, it seemed like all configuration settings were ignored and it still tried to contact the geoclue2 service, which is not running. The problem was that my ~/.config/redshift.conf was a symlink to the real path ~/dotfiles/.config/redshift.conf. This caused a permission denied error that was also reproducable using redshift -c ~/dotfiles/.config/redshift.conf. The access was denied by apparmor, which is enabled by default on Ubuntu.

    The real fix for me was to allow access to my configuration file in the apparmor profile. Maybe this also helps others.

    --- a/apparmor.d/usr.bin.redshift
    +++ b/apparmor.d/usr.bin.redshift
    @@ -39,2 +39,3 @@
       owner @{HOME}/.config/redshift.conf r,
    +  owner @{HOME}/dotfiles/.config/redshift.conf r,
       owner /run/user/*/redshift-shared-* rw,
    
  27. wachin commented on Oct 12, 2023

    @wachin

    In my case the problem was two-fold on Ubuntu 22.04 LTS. I had the described problem with geoclue2 and tried overriding this in ~/.config/redshift.conf like this:

    [redshift]
    location-provider=manual
    [manual]
    lon=42
    lat=23
    

    Thanks, work in Linux Mint 21 Vanessa using Fluxbox Window Manager. I found the latitude and longitude in: https://www.geodatos.net/

  28. tremby commented on Oct 15, 2023

    @tremby

    @Reno-Sifana I had the same output on Archlinux using i3. I solved it by running /usr/lib/geoclue-2.0/demos/agent in the background.

    For details, refer to the redshift page on Archwiki.

    This is what did it for me, only on Ubuntu 22 it was at /usr/libexec/geoclue-2.0/demos/agent.

  29. fonzi commented on Jun 17, 2024

    @fonzi

    Since this is still open, and it seems to be some obscure issue on Debian + XFCE especially, something is using wayland in debian XFCE. I've read it's lightDM but not sure, tried to solve it. So, I went ahead and wrote a little script that uses xsct wrapped with yad to provide a super simple screen red light alternative

    https://github.com/fonzi/bash-tools/tree/master/debian/screen-temp

  30. DeeDeeRanged commented on Jun 19, 2024

    @DeeDeeRanged

    Main issue is that redshift depends on geoclue running see previous comments. above.

  31. unxed commented on Feb 12, 2025

    @unxed

    Fixed the problem by using solution from Linux Mint forum:

    Create a file ~/.config/redshift.conf

    The content of the file can be minimal, only the configuration that is different than default:

    [redshift]
    location-provider=manual
    
    [manual]
    lat=49.01
    lon=8.40
    
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions