davesteele / cloudprint-service

Debian packaging for the Python cloudprint proxy utility
GNU General Public License v3.0
71 stars 4 forks source link

cloudprintd dies randomly #42

Open bits01 opened 9 years ago

bits01 commented 9 years ago

This is on Linux Mint 17.2, running cloudprint-service_0.13-1+deb8u1+ppa1_all.deb

The cloudprintd process seems to just randomly die. I don't see anything interesting in /var/log/syslog, the last thing I see before the process is gone:

Nov  5 11:44:49 server cloudprint.py: Polling for jobs on HP

Any suggestions on how to troubleshoot or enable more debugging?

bits01 commented 9 years ago

I see some errors such as the one below but there are more log entries after the promised 60 sec. so the process is not dead after these errors:

ERROR: Could not Connect to Cloud Service. Will Try again in 60 Seconds#012Traceback (most recent call last):#012  File "/usr/share/cloudprint/cloudprint/cloudprint.py", line 418, in process_jobs#012    xmpp_conn.await_notification(cpp.sleeptime)#012  File "/usr/share/cloudprint/cloudprint/xmpp.py", line 214, in await_notification#012    self._read_socket()#012  File "/usr/share/cloudprint/cloudprint/xmpp.py", line 84, in _read_socket#012    raise Exception("xmpp socket closed")#012Exception: xmpp socket closed
davesteele commented 9 years ago

It didn't die. It is printing a trace to aid debugging, but the services is continuing to run.

It is unable to connect to the print notification service. If this problem persists, check networking and authentication.

bits01 commented 9 years ago

It did die. There's no trace of the process when I run ps. But it didn't die because of the ERROR I posted above, there were more lines in the log after, it tried to connect after the promised 60 sec. and it was able to, it ran for a bit after and then it disappeared, nothing in the syslog anymore and when I needed to print I couldn't, looked for the process and was nowhere to be found, gone.

davesteele commented 9 years ago

There should be a log entry, if it is crashing. I don't have any short advice on how to track what happened.

For others who may be reading this investigating the same problem, the later versions of cloudprint-service, running under systemd, will automatically restart the service on a crash. It will run on Debian Testing/Sid, and apparently Ubuntu 15.10 or later.

mfraser commented 8 years ago

I'm seeing this almost every hour: Sep 22 08:52:40 Server cloudprintd[54877]: Sending XMPP keepalive Sep 22 08:52:40 Server cloudprintd[54877]: ERROR: Could not Connect to Cloud Service. Will Try again in 60 Seconds Sep 22 08:52:40 Server cloudprintd[54877]: Traceback (most recent call last): Sep 22 08:52:40 Server cloudprintd[54877]: File "/usr/share/cloudprint/cloudprint/cloudprint.py", line 457, in process_jobs_once Sep 22 08:52:40 Server cloudprintd[54877]: xmpp_conn.await_notification(cpp.sleeptime) Sep 22 08:52:40 Server cloudprintd[54877]: File "/usr/share/cloudprint/cloudprint/xmpp.py", line 253, in await_notification Sep 22 08:52:40 Server cloudprintd[54877]: self._read_socket() Sep 22 08:52:40 Server cloudprintd[54877]: File "/usr/share/cloudprint/cloudprint/xmpp.py", line 85, in _read_socket Sep 22 08:52:40 Server cloudprintd[54877]: data = self._wrappedsock.recv(1024) Sep 22 08:52:40 Server cloudprintd[54877]: File "/usr/lib/python2.7/ssl.py", line 756, in recv Sep 22 08:52:40 Server cloudprintd[54877]: return self.read(buflen) Sep 22 08:52:40 Server cloudprintd[54877]: File "/usr/lib/python2.7/ssl.py", line 643, in read Sep 22 08:52:40 Server cloudprintd[54877]: v = self._sslobj.read(len) Sep 22 08:52:40 Server cloudprintd[54877]: error: [Errno 104] Connection reset by peer Sep 22 08:53:41 Server cloudprintd[54877]: Polling for jobs on DYMO_LabelManager Sep 22 08:53:42 Server cloudprintd[54877]: Polling for jobs on HP_HP_Photosmart_Premium_C309g-m Sep 22 08:53:42 Server cloudprintd[54877]: Polling for jobs on Samsung_M2020_Series Sep 22 08:53:43 Server cloudprintd[54877]: Establishing connection to xmpp server talk.google.com:5223 Sep 22 08:53:43 Server cloudprintd[54877]: xmpp connection established

davesteele commented 8 years ago

The keepalive is sent whenever there is no activity on the persistent XMPP connection for 5 minutes. In practice, that never happens, because Google sends a keepalive more often than that (I don't see the log entry here). Something appears to be interfering with your connection.

If you would like to try something, edit /usr/share/cloudprint/cloudprint/cloudprint.py and change KEEPALIVE to something smaller, say 60.0.

Let me know if this helps.

bits01 commented 8 years ago

FWIW, I'm still seeing the same problem on Linux Mint 17: the process cloudprintd just disappears randomly, there's nothing in the logs that I can find. Not sure how or why it exits/crashes. Using 0.13-1+deb8u1+ppa2

davesteele commented 8 years ago

Could it have been this?

https://github.com/armooo/cloudprint/pull/130

bits01 commented 8 years ago

Willing to try it if you can make a new package for non-systemd distros.