Redshift color temperature adjustment

Redshift fails to start with session if no external location provider in available

Reported by Roger Binns on 2011-10-06
558
This bug affects 142 people
Affects Status Importance Assigned to Milestone
Redshift
High
Unassigned
Ubuntu GeoIP
Undecided
Unassigned
redshift (Ubuntu)
High
Unassigned
ubuntu-geoip (Ubuntu)
Medium
Unassigned

Bug Description

Since switching to oneiric redshift won't start. It is listed as a startup application and these lines are present in .xsession-error from it:

    Unable to get location from provider.
    Started Geoclue provider `Geoclue Master'.
   Using provider `geoclue'.

There is also no process in a ps listing. If I start it from the command prompt then it starts just fine often with substantially similar messages.

ProblemType: Bug
DistroRelease: Ubuntu 11.10
Package: redshift 1.7-0ubuntu1
ProcVersionSignature: Ubuntu 3.0.0-12.19-generic 3.0.4
Uname: Linux 3.0.0-12-generic x86_64
NonfreeKernelModules: nvidia
ApportVersion: 1.23-0ubuntu2
Architecture: amd64
Date: Wed Oct 5 22:39:15 2011
SourcePackage: redshift
UpgradeStatus: No upgrade log present (probably fresh install)

Roger Binns (ubuntu-rogerbinns) wrote :
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in redshift (Ubuntu):
status: New → Confirmed
Erik (eedlun) wrote :

I'm a complete novice here but could this have something to do with the startup command "gtk+redshift" and gtk in general?

Clint Byrum (clint-fewbar) wrote :

This seems to be a problem with the way the geoclue provider is done.. it should probably block and retry for a while before giving up, as geoclue just might be unable to determine the location at this moment.

Changed in redshift (Ubuntu):
importance: Undecided → High
summary: - Redshift fails to start with session
+ Redshift fails to start with session due to geoclue failure

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in redshift (Ubuntu Oneiric):
status: New → Confirmed
Rafał Błaszczyk (rblaszczyk) wrote :

The workaround in Oneiric is to install geoclue and geoclue-hostip It works without additional configuration after installing these two. I think it could be a problem with installed (by default) geoclue-ubuntu-geoip.

rodlaycock (rod-laycock) wrote :

I installed geoclue and geoclue-hostip and now Redshift won't start automatically or manually.

Roger Binns (ubuntu-rogerbinns) wrote :

geoclue was already installed for me and so geoclue-hostip was added. The consequence was that I couldn't start redshift at all, and even uninstalling didn't help. Totally hosed the setup.

In the end the fix is to make redshift not use geoclue at all until Ubuntu fix that package. Use 'redshift -l list' to see a list of other providers it can use. I'm using 'redshift -l gnome-clock' which works perfectly.

Daniel Hahler (blueyed) wrote :

It works for me in Oneiric, having the following geoclue packages installed:
    geoclue, geoclue-ubuntu-geoip and libgeoclue0

I am affected by another bug, where it crashes during startup, related to geoclue apparently: bug 888661.

Changed in redshift:
status: New → Confirmed
importance: Undecided → High
tellapu (tellapu) wrote :

Thanks Roger (#8) for the tip, but it does not work for me in Ubuntu 11.10, although gnome-clock is listed as provider, I get his output in the terminal:
$ redshift -l gnome-clock
Cannot list GNOME panel applets.
Initialization of gnome-clock failed.

Anything I can change to make it run?

I use gnome-shell as my desktop, not Unity. That is probably what makes it work.

Don Myers (donmyers) wrote :

On two machines with Ubuntu 11.10, it will not start automatically even though startup applications shows it is supposed to start. When booting it looks like it is trying to start, but then stalls, the desktop picture flashes, and then the boot completes normally. If I click the dash button, then type in redshift, and then left click the icon, it loads, and I get an icon for it in the top bar. Then everything works fine until shutdown. If I don't click on the button in the top bar and select to quit redshift, both computers freeze during shutdown. The only way to turn them off is to hold the power button down.

Jon Lund Steffensen (jonls) wrote :

The workaround is to ensure that redshift can start successfully at boot even though network and such is not up yet. This may be possible with some geoclue providers. Otherwise a configuration file with the location entered manually can be created.

This is a duplicate of bug #808006 i guess.

Simba MacDhuibh (spacesimba08) wrote :

After installing geoclue-hostip it worked, but produced bug #808006 kindof, which means they are not duplicates.
geoclue-hostip should definitely be included in dependancies so apt-get/yum can work the magic. Ubuntu 11.10 AMD64.

ethanay (ethan-y-us) wrote :

does the workaround exist yet? is it possible to specificy a "manual fallback location" in a config file if/when redshift fails to start?

ideally, if redshift starts without network access, would the program fall back to its last known good location setting, and then wait for an internet connection to confirm or update location?

it was really nice when redshift played nice w/the gnome clock applet's location settings, esp for mobile users. maybe we can work with gnome or cinnamon to restore that functionality?

What I use as a workaround is defining the latitude and longitude at startup. I don't travel that much to benefit from the service to look it up every time I boot.

1) use http://itouchmap.com/latlong.html or any other service to find your latitude/longitude
2) adjust the startup command of redshift to: gtk-redshift -l <latitude>:<longitude>
Example of latitude/longitude of Amsterdam for redshift: gtk-redshift -l 52.37:4.9

Adjusting the startup command in Ubuntu 11.10:
Start the dash and enter "startup applications", select Redshift and click "Edit", adjust the command as mentioned above.

Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in ubuntu-geoip (Ubuntu Oneiric):
status: New → Confirmed
Changed in ubuntu-geoip (Ubuntu):
status: New → Confirmed
Daniel Hahler (blueyed) on 2012-02-24
Changed in redshift (Ubuntu):
status: Confirmed → Triaged
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package redshift - 1.7-1ubuntu2

---------------
redshift (1.7-1ubuntu2) precise; urgency=low

  * d/patches/retry-geoclue.patch: Retry geoclue a few times so
    redshift does not explode at startup. (LP: #868904)
 -- Clint Byrum <email address hidden> Fri, 02 Mar 2012 19:14:43 -0800

Changed in redshift (Ubuntu):
status: Triaged → Fix Released
Clint Byrum (clint-fewbar) wrote :

It appears to me that the problem is that geoclue_position_get_position() is not blocking until a response comes from geoclue *OR* its possible that the ubuntu-geoip is doing the wrong thing and is fooling geoclue into thinking there's a response, but since the fields come back as not set, I think its geoclue working in a confusing way.

As a workaround, I added a sleep loop that waits 1 second between retries, which should be long enough if you boot up with network connectivity.

Long term, redshift should be trying repeatedly to get a location forever, not just at startup. If I put my laptop to sleep in Los Angeles, and get on a plane to New York, I'd like for redshift to adjust. This would also make it more resilient to not having a defined location at startup. It should basically just refuse to start messing with the display until a location is available.

Changed in redshift (Ubuntu):
assignee: nobody → Clint Byrum (clint-fewbar)

It doesn't work at 12.04 when there are not internet connection.

Excerpts from Jose Luis Navarro's message of 2012-06-02 11:31:56 UTC:
> It doesn't work at 12.04 when there are not internet connection.
>

Indeed, redshift needs a bit of refactoring to keep trying even w/o a
location result.

Fred (eldmannen+launchpad) wrote :

I didn't have this issue in Ubuntu 12.04 LTS, but now I got this in 12.10.

$ redshift
Started Geoclue provider `Geoclue Master'.
Using provider `geoclue'.
Could not get location (3 retries left): Geoclue master client has no
usable Position providers.
Unable to get location from provider.

$ redshift -l gnome-clock
Cannot list GNOME panel applets.
Initialization of gnome-clock failed.

zEn (der-eremit) wrote :

also started experiencing that exact same problem when switching to quantal beta 1

Ari (ari-lp) wrote :
Prasanna K (onlineprasanna) wrote :

Above mentioned work around works without active internet connection. i.e, redshift doesn't go looking for geolocations if you use this workaround.

But if we tuse terminal and use command : $ redshift
(it shows)

** (process:3248): WARNING **: Metadata for error domain "geoclue-error-quark" already registered

Started Geoclue provider `Geoclue Master'.
Using provider `geoclue'.
Could not get location (3 retries left): Geoclue master client has no usable Position providers.
Unable to get location from provider.

But when you type command $ gtk-redshift -l LAT:LONG (Where LAT and LONG correspond with your coordinates.)
it runs soomthly as send in the above question. Hence forth a startup application is created using this command.

By the way when you click Applications>Accessories>Redshift it works through geolocation and needs a active internet connection every time where as the little workout in http://askubuntu.com/questions/194525/does-redshift-need-active-internet-connection-to-work/194582#194582 helps the otherway by mannually creating the geolocation.

ethanay (ethan-y-us) wrote :

The -l lat:lon is what I use and sufficient for me, but the workaround is insufficient, though, from a design perspective. For example, both my parents and my girlfriend just think the program is completely broken if they try to use it while not connected to the internet.

Both Unity and Gnome allow setting your current location. Redshift should probably do the following automatically by default unless given a manual over-ride (such as using the -l lat:lon option):

1. Try to find current location using geoclue and internet connection
2. If #1 doesn't work, fall back to using Unity / Gnome location in the clock applet
3. If #2 doesn't work, fall back to using last-known good startup location
4. If #3 doesn't work, prompt use to enter a location manually at least once using the -l switch (so it can create a config file and fall back to #3 next time)

jawz101 (jawz101) wrote :

holy crap this bug has been ongoing for a year

Derek Roberts (derek-roberts) wrote :

A fix for 12.10 would be great, because I'm having this problem as well.

Jonathan Davies (jpds) wrote :

Installing the 'geoclue-hostip' package fixes it for me on 12.10.

Kay (ksthiele) wrote :

Could we just add an option to remove geo clue and let work with the clock?

Kay (ksthiele) wrote :

btw I handled it this way:

open "Startup Applications"
Add -> Name: Redshift
-> Command gtk-redshift -l <your coordinations (00.00:00:00)>

works perfectly

jc00ke (jesse-jc00ke) wrote :

@ksthiele nice, I was doing that too, but I didn't want to always find my lat/long. Installing geoclude-hostip didn't fix it for me, so I whipped up a little Ruby script to grab my coordinates: https://gist.github.com/4180325

Ian Nicholson (imnichol) wrote :

So has a fix been released? Because I'm still experiencing this on an up to date 12.10 machine.

Robin (r1579) wrote :

redshift will not load from the startup programs or the terminal in my Ubuntu 12.04

In terminal I have tried

redshift
/usr/bin/redshift

In both cases it hangs and gives no error message.

It does start when the redshift icon is clicked in the unity dock.

I have set up the ~/.config/redshift.conf
so that it uses the lat/ long within the conf file.

Internet always starts on startup.

valent (valent-turkovic) wrote :

Same issue on Fedora 17 with geoclue installed redshift doesn't start:

Started Geoclue provider `Geoclue Master'.
Using provider `geoclue'.
Could not get location: Router mac address query failed.
Unable to get location from provider.

and then crashes

Sylvhem (sylvhem) wrote :

There is the same issue on Ubuntu 12.10 Quantal Quetzal. The command line return:

Started Geoclue provider `Geoclue Master'.
Utilisation du fournisseur « geoclue ».

** (process:8284): WARNING **: Could not get location, 3 retries left.

** (process:8284): WARNING **: Could not get location, 2 retries left.

** (process:8284): WARNING **: Could not get location, 1 retries left.

** (process:8284): WARNING **: Provider does not have a valid location available.
Impossible d'obtenir une localisation du fournisseur.

Sasa Paporovic (melchiaros) wrote :

In respect to the comments the tags precise and quantal were added.

My own observation brings this bug also to raring.

tags: added: precise quantal raring
Sasa Paporovic (melchiaros) wrote :

@Clint Byrum

Your patch do not solv the problem. It is only shifting it a bit to:

 redshift
Started Geoclue provider `Geoclue Master'.
Dienst »geoclue« wird benutzt.

** (process:2886): WARNING **: Could not get location, 3 retries left.

** (process:2886): WARNING **: Could not get location, 2 retries left.

** (process:2886): WARNING **: Could not get location, 1 retries left.

** (process:2886): WARNING **: Provider does not have a valid location available.

Matt Zimmerman (mdz) wrote :

geoclue_position_get_position is returning a latitude, but not a longitude, i.e. fields contains GEOCLUE_POSITION_FIELDS_LATITUDE but not GEOCLUE_POSITION_FIELDS_LONGITUDE. I'm not sure why this is, since when I run geoclue-test-gui, it shows both latitude and longitude.

Matt Zimmerman (mdz) wrote :

The issue I'm experiencing with getting latitude but not longitude seems to be covered by bug #1060645

O Gopal (jswami) wrote :

Comment 29 by ethanay is right on target. He has rightly understood the problem, and his proposed behavior would admirably solve it.

Olivier Berger (olivierberger) wrote :

See my suggestions for solving these geoclue-hostip issues : https://bugs.launchpad.net/redshift/+bug/808006/comments/15

I have now in my ~/.config/redshift.conf :

[redshift]
              location-provider=geoclue

[geoclue]
name=org.freedesktop.Geoclue.Providers.Hostip
path=/org/freedesktop/Geoclue/Providers/Hostip

; The location provider and adjustment method settings
; are in their own sections.
[manual]
lat=48.530344
lon=2.250073

and can the switch to gtk-redshift -l manual if needed for a fallback when geoclue-hostip won't work (and when I'm in Paris).

I'm not sure the DEFAULT_PROVIDER and DEFAULT_PROVIDER_PATH in src/location-geoclue.c are valid outside the Ubuntu world, so hence the name and path...

Hope this helps

gcb (descartavel1) wrote :

On the first time i installed redshift on ubuntu 12.10 it worked. on all other tries i get the geolocation error

I'm also having the same problem with redshift and gtk-redshift. Here's the debugging info I've compiled so far:

$ redshift
Started Geoclue provider `Geoclue Master'.
Using provider `geoclue'.
** (process:11896): WARNING **: Could not get location, 3 retries left.
** (process:11896): WARNING **: Could not get location, 2 retries left.
** (process:11896): WARNING **: Could not get location, 1 retries left.
** (process:11896): WARNING **: Provider does not have a valid location available.
Unable to get location from provider.

$ redshift -l list
Available location providers:
  geoclue
  gnome-clock
  manual

$ redshift -l gnome-clock
Cannot list GNOME panel applets.
Initialization of gnome-clock failed.

$ lsb_release -d
Description: Ubuntu 12.10

$ dpkg --get-selections|grep geoclue
geoclue install
geoclue-ubuntu-geoip install
libgeoclue0 install

I've recently started using f.lux and settled on this program for when I'm using Linux. I ran into this and investigated the issue a bit. It appears that the problem is hostip.info simply isn't reliable. Geoclue via hostip was working fine until my ability to reach the server ended. I assume the problem lies with hostip server and when it cannot even establish a connection geoclueinstantly fails rather than ping it on some schedule.

For those wanting to use this program reliably without having to depend on either geoclue OR gnome-clock as a location provider, I'd recommend manual configuration. You can do this using the legacy manual lat/lon command. Find your current location using another service such as http://www.itouchmap.com/latlong.html. Some people above seemed confused by the format for redshift's manual command, it follows standard +/- notation where +latitude is north and - latitude is south and + longitude is east while -longitude is west.

Command example:
redshift -t 6500:3400 -l 43.63:-79.33 &

The above command starts redshift with coordinates for Toronto area of Canada, I have also provided new defaults for daytime/night color values (same values as f.lux) with -t. The & makes the process execute in the background.

Likely redshift should find a more reliable internet mechanism than hostip.info for the future though it isn't really the programs fault.

As a final note, if you are like me and don't want to have to execute that on each reboot. I'd advise putting that in a tiny script and having it execute on startup via whatever startup manager/process your flavor of Ubuntu uses.

mike beqiri (mxls10) wrote :

shift doesn't work on ubuntu 12.04 LTS, I had a edition of ubuntu, Cylon 12.04 LTS in with Gnome user face, which was working fine, but in Unity doesn't seem to work. Also I installed Grome user face.changed desktop to Gnome user face.was same anyway. Any helf please!!

Changed in redshift (Ubuntu):
assignee: Clint Byrum (clint-fewbar) → mike beqiri (mxls10)
Jan Vlnas (jnv) wrote :

The problem is still present in Raring (13.04). If gtk-redshift is added as a startup application, geoclue-ubuntu-geoip crashes after login.

To build upon's Jeremy's workaround (#48), you can also specify provider and your location in ~/.config/redshift.conf – this way, gtk-redshift always uses correct settings. Configuration example follows:

[redshift]
location-provider=manual

[manual]
lat=<latitude>
lon=<longitude>

What works for me (13.04)

1.Add this to startup applications "redshift -l 22.00:77.00 -t 4500:4000 -v "

2.Replace "22.00:77.00" with your location.(hint : find your location here "http://whatsmylatlng.com/" )

3.This sets the location manually , bypassing geoclue ( hint : "redshift -l lists")

4. The -t 4500:4000 is of the form -t DAY:NIGHT , replace with desired values

5. -v is for verbose output

Changed in ubuntu-geoip (Ubuntu):
importance: Undecided → Medium
no longer affects: redshift (Ubuntu Oneiric)
no longer affects: ubuntu-geoip (Ubuntu Oneiric)
Fred (eldmannen+launchpad) wrote :

Hmm... this problem goes away after I install 'geoclue-hostip' and 'geoclue-yahoo'.
Even though 'geoclue-ubuntu-geoip' already was installed.

valent (valent-turkovic) wrote :

I can confirm this. After installing "geoclue-hostip" RedShift works. So it is a simple missing dependency issue.
Package maintainter can fix this issue really fast...

 $ gtk-redshift
Started Geoclue provider `Geoclue Master'.
Using provider `geoclue'.
Could not get location (3 retries left): Geoclue master client has no usable Position providers.
Unable to get location from provider.

$ sudo apt-get install geoclue-hostip

$ gtk-redshift
Started Geoclue provider `Geoclue Master'.
Using provider `geoclue'.
According to the geoclue provider we're at: 45.80, 15.78
Using method `randr'.

Mark Russell (marrusl) wrote :

Thank you @Fred and @valent! This has been bugging me for ages. Though I lived with it by hardcoding my location, it was still really annoying when traveling.

I prepared a debdiff for saucy adding a dependency on geoclue-hostip. But I also took a look for geoclue-ubuntu-geoip bugs and sure enough, I found LP bug 1239082 which seems to confirm that it is broken in general.

So I'll upload this first debdiff, as adding a dependency on geoclue-hostip does solve the problem alone, and perhaps the ubuntu-geoip provider will be fixed later.

Mark Russell (marrusl) wrote :

Here's another debdiff with a patch to add the dependency _and_ change the default provider in source from

#define DEFAULT_PROVIDER "org.freedesktop.Geoclue.Providers.UbuntuGeoIP"
#define DEFAULT_PROVIDER_PATH "/org/freedesktop/Geoclue/Providers/UbuntuGeoIP"

to:

#define DEFAULT_PROVIDER "org.freedesktop.Geoclue.Providers.Hostip"
#define DEFAULT_PROVIDER_PATH "/org/freedesktop/Geoclue/Providers/Hostip"

I'm not sure this proves anything but I also noticed that UbuntuGeoIP is not on Freedesktop.org's list of providers:
http://www.freedesktop.org/wiki/Software/GeoClue/Providers/

Really, redshift should have some sort of dependency on a working provider regardless. geoclue-ubuntu-geoip was only there on Unity-based desktops because it happens to already be pulled in by indicator-datetime and unity-webapps-service. The dependency was always missing, it just happened to work as long as geoclue-ubuntu-geoip was there and still working.

The attachment "redshift.saucy.debdiff" seems to be a debdiff. The ubuntu-sponsors team has been subscribed to the bug report so that they can review and hopefully sponsor the debdiff. If the attachment isn't a patch, please remove the "patch" flag from the attachment, remove the "patch" tag, and if you are member of the ~ubuntu-sponsors, unsubscribe the team.

[This is an automated message performed by a Launchpad user owned by ~brian-murray, for any issue please contact him.]

tags: added: patch
mike beqiri (mxls10) on 2013-10-17
Changed in ubuntu-geoip:
assignee: nobody → mike beqiri (mxls10)
status: New → Confirmed
mike beqiri (mxls10) on 2013-11-08
Changed in redshift (Ubuntu):
assignee: mike beqiri (mxls10) → nobody
Changed in ubuntu-geoip:
assignee: mike beqiri (mxls10) → nobody

Still a bug in Ubuntu 13.10.

> Still a bug in Ubuntu 13.10.

Confirming - I'm seeing the same, with redshift 1.7. As others have said above, confirming that I was also able to workaround the clearly missing dependency via manually doing:

sudo apt-get install geoclue-hostip

Still using 1.7 instead of 1.8 as that's the vesion you still get when you do sudo apt-get install redshift today in 13.10; if this is fixed in 1.8, maybe 1.8 could be released for 13.10 as well?

summary: - Redshift fails to start with session due to geoclue failure
+ Redshift fails to start with session - missing dependency? (geoclue-
+ hostip)

Still present in 14.04 (even with the new dependency installed). Please see attachments in https://bugs.launchpad.net/redshift/+bug/1283794

Igor Ribeiro Sucupira (igorrs) wrote :

I still hit this bug in Ubuntu 13.10.
With geoclue-hostip installed, redshift works IF there's a network connection when Unity starts up.

My workaround is to start gtk-redshift with this simple Bash script (added to Startup Applications):
https://gist.github.com/igorrs/9480073

Thanks for your comment, Igor.

So how can we relay this to the upstream developers?

summary: - Redshift fails to start with session - missing dependency? (geoclue-
- hostip)
+ Redshift fails to start with session if no external location provider in
+ available

I commented upstream and let a link to this ticket: https://github.com/jonls/redshift/issues/36#issuecomment-37524429

To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers