Skip to content
This repository has been archived by the owner on Feb 19, 2021. It is now read-only.

Consumer stops working #474

Closed
Ulli2k opened this issue Jan 11, 2019 · 1 comment
Closed

Consumer stops working #474

Ulli2k opened this issue Jan 11, 2019 · 1 comment

Comments

@Ulli2k
Copy link

Ulli2k commented Jan 11, 2019

Hello,
After several times the consumer stops working with the following error.

`aperless-consumer.service - Paperless consumer
Loaded: loaded (/home/paperless/script/paperless-consumer.service; enabled; vendor preset: enabled)
Active: failed (Result: exit-code) since Fri 2019-01-11 12:58:45 CET; 2h 43min ago
Process: 1233 ExecStart=/usr/bin/python3 /home/paperless/paperless/src/manage.py document_consumer (code=exited, status=1/FAILURE)
Main PID: 1233 (code=exited, status=1/FAILURE)

Jan 11 12:58:44 nuc python3[1233]: sock = IMAP4._create_socket(self)
Jan 11 12:58:44 nuc python3[1233]: File "/usr/lib/python3.6/imaplib.py", line 289, in _create_socket
Jan 11 12:58:44 nuc python3[1233]: return socket.create_connection((host, self.port))
Jan 11 12:58:44 nuc python3[1233]: File "/usr/lib/python3.6/socket.py", line 704, in create_connection
Jan 11 12:58:44 nuc python3[1233]: for res in getaddrinfo(host, port, 0, SOCK_STREAM):
Jan 11 12:58:44 nuc python3[1233]: File "/usr/lib/python3.6/socket.py", line 745, in getaddrinfo
Jan 11 12:58:44 nuc python3[1233]: for res in _socket.getaddrinfo(host, port, family, type, proto, flags):
Jan 11 12:58:44 nuc python3[1233]: socket.gaierror: [Errno -2] Name or service not known
Jan 11 12:58:45 nuc systemd[1]: paperless-consumer.service: Main process exited, code=exited, status=1/FAILURE
Jan 11 12:58:45 nuc systemd[1]: paperless-consumer.service: Failed with result 'exit-code'.`

Any idea to fix this?

@syntonym
Copy link
Contributor

It looks like it tried to connect to the email address you configured with PAPERLESS_CONSUME_MAIL_HOST and can't find the address. Maybe DNS was down for whatever reason? I think a better response for paperless would be to log an error and retry later, but currently paperless just crashes apparently. If you are sure that email generally works and this is just temporarly (vs. you mistyped the email host or your dns setup is broken) you can workaround by letting systemd restart paperless on an error by adding Restart=on-failure to the symsted service file. If you never edited a systemd service file you can do that by systemctl edit paperless-consumer and then add

[Service]
Restart=on-failure

in the just opened (probably empty) file. This restarts paperless-consumer on every failure, so it can happen that it gets restarted constantly. Systemd has some advanced options to e.g. restart 3 times every 90 seconds, see e.g. this serverfault question.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants