FS#37014 - [colord] failed to get session

Attached to Project: Arch Linux
Opened by Lorenzo Porta (Vindex17) - Saturday, 21 September 2013, 16:12 GMT
Last edited by Antonio Rojas (arojas) - Tuesday, 15 October 2019, 17:22 GMT
Task Type Bug Report
Category Packages: Extra
Status Closed
Assigned To Ionut Biru (wonder)
Jan Alexander Steffens (heftig)
Architecture All
Severity Low
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 5
Private No

Details

Description:
set 21 17:58:24 ArchLinuxPC colord[712]: (colord:712): Cd-WARNING **: failed to get session [pid 702]: unknown error -2

Additional info:
* package version: 1.0.2-2
I don't know if it matters with the session but I use KDE as DE

Steps to reproduce:
every boot
This task depends upon

Closed by  Antonio Rojas (arojas)
Tuesday, 15 October 2019, 17:22 GMT
Reason for closing:  Fixed
Comment by Jelle van der Waa (jelly) - Sunday, 22 September 2013, 09:47 GMT
With this minimal input, no one can help you. It also seems to be just a warning which might not be harmful.
Comment by Doug Newgard (Scimmia) - Saturday, 31 May 2014, 07:11 GMT
Any more information? If we don't get anything else, this might as well just be closed.
Comment by Philip (nuc) - Friday, 20 June 2014, 11:22 GMT
I also get this error with SDDM as Login Manager (don't know if it matters). What further info do you need?
Comment by Torben Andresen (tapsiturtle) - Tuesday, 01 July 2014, 07:08 GMT
I have the same error on boot but no problems on using any software. But it seems that this error is relevant with cups:
Jun 30 20:43:15 turtlebook colord[333]: Profile added: HP_Photosmart_C4200_series-Gray..
Jun 30 20:43:15 turtlebook colord[333]: Profile added: HP_Photosmart_C4200_series-RGB..
Jun 30 20:43:15 turtlebook colord[333]: (colord:333): Cd-WARNING **: failed to get session [pid 299]: Unknown error -2
Jun 30 20:43:15 turtlebook colord[333]: Device added: cups-HP_Photosmart_C4200_series
Jun 30 20:43:15 turtlebook colord[333]: Profile added: Virtual_PDF_Printer-Gray..
Jun 30 20:43:15 turtlebook colord[333]: Profile added: Virtual_PDF_Printer-RGB..
Jun 30 20:43:15 turtlebook colord[333]: (colord:333): Cd-WARNING **: failed to get session [pid 299]: Unknown error -2

If you search the internet there are some entries with this relationship: https://bbs.archlinux.org/viewtopic.php?pid=1370717 & https://answers.launchpad.net/hplip/+question/236658

But the last time i printed something i had no problems.
Comment by mattia (nTia89) - Saturday, 15 November 2014, 16:29 GMT
I confirm: I get a similar output on my KDE system when I power on the printer
Comment by Troy Engel (TE) - Friday, 16 January 2015, 20:22 GMT
I think I found a clue - going through colord source, this error is emitted via what appears the be a D-bus callback, and a change in cups with systemd idle exits. There's a new config option that's not documented (that I can find), but I found this:

https://lists.debian.org/debian-printing/2014/06/msg00019.html

The colord source code sets up a listener on the dbus; when the CreateDevice call happens, it loops through a bunch of code then finally takes the caller (connection/pid) and attempts to get a session object:

https://github.com/hughsie/colord/blob/master/src/cd-main.c#L535

/* get session the process belongs to */
rc = sd_pid_get_session (pid, &sd_session);
if (rc != 0) {
g_warning ("failed to get session [pid %i]: %s",


The source code of cups - when systemd is present - "idle exits" after 60s:

./scheduler/conf.h-#if defined(HAVE_LAUNCHD) || defined(HAVE_SYSTEMD)
./scheduler/conf.h:VAR int IdleExitTimeout VALUE(60);

./scheduler/conf.c-#if defined(HAVE_LAUNCHD) || defined(HAVE_SYSTEMD)
./scheduler/conf.c: { "IdleExitTimeout", &IdleExitTimeout, CUPSD_VARTYPE_TIME },
./scheduler/conf.c-#endif /* HAVE_LAUNCHD || HAVE_SYSTEMD */

./scheduler/conf.c-#if defined(HAVE_LAUNCHD) || defined(HAVE_SYSTEMD)
./scheduler/conf.c: IdleExitTimeout = 60;
./scheduler/conf.c-#endif /* HAVE_LAUNCHD || HAVE_SYSTEMD */

It sort of makes sense, colord is trying to get session info about cupsd but it might have idled out due to this new code? I'm not sure if setting 'IdleExitTimeout 0' in cupsd.conf is really a good fix or not, or who actually owns this problem. In my case, I have a wifi printer that is powered off but is configured in cupsd - both cups and colord services start on boot (colord for ICC video profiles, not really printing), and get the same error on startup.

# journalctl -l -a | egrep -i "(cups|colord)"

Jan 16 12:29:58 grimm systemd[1]: Starting CUPS Scheduler.
Jan 16 12:29:58 grimm systemd[1]: Started CUPS Scheduler.
Jan 16 12:29:58 grimm systemd[1]: Starting CUPS Scheduler.
Jan 16 12:29:58 grimm systemd[1]: Listening on CUPS Scheduler.
Jan 16 12:29:58 grimm systemd[1]: Starting CUPS Scheduler...
Jan 16 12:29:58 grimm systemd[1]: Started CUPS Scheduler.
Jan 16 12:30:01 grimm dbus[492]: [system] Activating via systemd: service name='org.freedesktop.ColorManager' unit='colord.service'
Jan 16 12:30:04 grimm colord[548]: (colord:548): Cd-WARNING **: failed to get session [pid 485]: Unknown error -2
Jan 16 12:30:04 grimm colord[548]: /usr/lib/colord/colord-sane: error while loading shared libraries: libsane.so.1: cannot open shared object file: No such file or directory

$ ps -ef | grep [4]85
root 485 1 0 12:29 ? 00:00:00 /usr/bin/cupsd -l


That last shared library error is because I don't have the sane package installed, unpleasant but expected since it's listed as an optional dep. Could it be somehow related though?
Comment by Torben Andresen (tapsiturtle) - Thursday, 14 April 2016, 07:38 GMT
This Bug is not longer present on my machine. Can't say exactly since when.
Comment by Troy Engel (TE) - Thursday, 14 April 2016, 17:05 GMT
Same here, I don't see the errors anymore outlined above but wasn't tracking when they disappeared.
Comment by Juan Simón (j1simon) - Wednesday, 17 April 2019, 10:56 GMT
Still fails:
mar 17 11:01:05 arch-juan colord[585]: failed to get session [pid 572]: No hay datos disponibles
Comment by Jan de Groot (JGC) - Wednesday, 17 April 2019, 12:08 GMT
The original report is a bug in colord. The "Unknown error: -2" is because sd_pid_get_session returns 0 or a positive integer. Colord checks if return value is 0, if it isn't, the return value is negated and translated to an error message. Colord should not check rc != 0, but rc < 0 instead. This is also what the systemd testsuite uses.

As for the warning in the reopen request, the warning is not a bug but valid. From the manual:
Note that not all processes are part of a
login session (e.g. system service processes, user processes that are
shared between multiple sessions of the same user, or kernel
threads). For processes not being part of a login session, this
function will fail with -ENODATA.
Comment by Jan Alexander Steffens (heftig) - Wednesday, 17 April 2019, 14:47 GMT
Please try colord 1.4.4-2.
Comment by mattia (nTia89) - Wednesday, 17 April 2019, 16:45 GMT
Just updated to 1.4.4-2 and I still have this issue BUT with a difference:
instead of having "unknown error -2", I get "No data available" !!!

(Honestly I do not know if it is really the same issue now)

Anyway, the only thing I can add is, issue has already "changed" prior latest big upgrade to gnome 3.32.
I can state that because latest log, dated back to 2nd of March, doesn't contain "unknown error -2".

Comment by David (Marzal) - Wednesday, 17 April 2019, 18:27 GMT
No change for me either:
may 16 23:56:05 zerowaste colord[553]: failed to get session [pid 531]: No hay datos disponibles
journalctl -b | grep -i color
abr 17 20:22:58 zerowaste dbus-daemon[568]: [system] Activating via systemd: service name='org.freedesktop.ColorManager' unit='colord.service' requested by ':1.20' (uid=0 pid=594 comm="/usr/bin/cupsd -l ")
abr 17 20:22:58 zerowaste systemd[1]: Starting Manage, Install and Generate Color Profiles...
abr 17 20:22:58 zerowaste dbus-daemon[568]: [system] Successfully activated service 'org.freedesktop.ColorManager'
abr 17 20:22:58 zerowaste audit[1]: SERVICE_START pid=1 uid=0 auid=4294967295 ses=4294967295 msg='unit=colord comm="systemd" exe="/usr/lib/systemd/systemd" hostname=? addr=? terminal=? res=success'
abr 17 20:22:58 zerowaste systemd[1]: Started Manage, Install and Generate Color Profiles.
abr 17 20:22:58 zerowaste colord[618]: failed to get session [pid 594]: No hay datos disponibles

But maybe is just as explained normal...
Comment by Martin Mísař (misarm) - Tuesday, 08 October 2019, 20:49 GMT
I have also in the journalctl log
říj 08 20:11:50 jitkaNB dbus-daemon[745]: [system] Activating via systemd: service name='org.freedesktop.ColorManager' unit='colord.service' requested by ':1.2' (uid=0 pid=810 comm="/usr/bin/cupsd -l ")
říj 08 20:11:50 jitkaNB systemd[1]: Starting Manage, Install and Generate Color Profiles...
říj 08 20:11:46 jitkaNB kernel: audit: type=1130 audit(1570558306.966:41): pid=1 uid=0 auid=4294967295 ses=4294967295 msg='unit=tlp comm="systemd" exe="/usr/lib/systemd/systemd" hostname=? addr=? terminal=? res=success'
říj 08 20:11:50 jitkaNB dbus-daemon[745]: [system] Activating via systemd: service name='org.freedesktop.ColorManager' unit='colord.service' requested by ':1.2' (uid=0 pid=810 comm="/usr/bin/cupsd -l ")
říj 08 20:11:50 jitkaNB systemd[1]: Starting Manage, Install and Generate Color Profiles...
říj 08 20:11:51 jitkaNB dbus-daemon[745]: [system] Successfully activated service 'org.freedesktop.ColorManager'
říj 08 20:11:51 jitkaNB systemd[1]: Started Manage, Install and Generate Color Profiles.
říj 08 20:11:51 jitkaNB audit[1]: SERVICE_START pid=1 uid=0 auid=4294967295 ses=4294967295 msg='unit=colord comm="systemd" exe="/usr/lib/systemd/systemd" hostname=? addr=? terminal=? res=success'
říj 08 20:11:51 jitkaNB kernel: audit: type=1130 audit(1570558311.956:42): pid=1 uid=0 auid=4294967295 ses=4294967295 msg='unit=colord comm="systemd" exe="/usr/lib/systemd/systemd" hostname=? addr=? terminal=? res=success'
říj 08 20:11:53 jitkaNB dhcpcd[809]: enp0s25: no IPv6 Routers available
říj 08 20:11:54 jitkaNB colord[1018]: failed to get session [pid 810]: Data nejsou k dispozici
říj 08 20:11:54 jitkaNB colord[1018]: failed to get session [pid 810]: Data nejsou k dispozici
říj 08 20:11:54 jitkaNB colord[1018]: failed to get session [pid 810]: Data nejsou k dispozici
říj 08 20:11:54 jitkaNB colord[1018]: failed to get session [pid 810]: Data nejsou k dispozici
říj 08 20:11:54 jitkaNB dbus-daemon[745]: [system] Activating via systemd: service name='org.freedesktop.Avahi' unit='dbus-org.freedesktop.Avahi.service' requested by ':1.7' (uid=0 pid=810 comm="/usr/bin/cupsd -l ")
říj 08 20:11:54 jitkaNB dbus-daemon[745]: [system] Activation via systemd failed for unit 'dbus-org.freedesktop.Avahi.service': Unit dbus-org.freedesktop.Avahi.service not found.
říj 08 20:11:54 jitkaNB systemd[1]: Started CUPS Scheduler.
Comment by mattia (nTia89) - Wednesday, 09 October 2019, 07:29 GMT
Since GNOME 3.34, the issue has been fixed for me!
extra/colord 1.4.4-2 [installed]
Comment by Torben Andresen (tapsiturtle) - Monday, 14 October 2019, 10:53 GMT
I can confirm that the error seems to be fixed because i also don't have this meesage anymore in the logs.

Loading...