jonaswinkler/paperless-ng

[Other] Check all mail accounts fails with error "[Errno -3] Temporary failure in name resolution"

duko1234 opened this issue · 4 comments

Hi,

I have installed paperless-ng in a docker on a synology NAS. So far everything works fine, except pulling documents from e-mail.
The regular "check all mail accounts" task fails with the following error message:

[Errno -3] Temporary failure in name resolution : Traceback (most recent call last):
File "/usr/local/lib/python3.8/dist-packages/django_q/cluster.py", line 432, in worker
res = f(*task["args"], **task["kwargs"])
File "/app/paperless/src/paperless_mail/tasks.py", line 14, in process_mail_accounts
total_new_documents += MailAccountHandler().handle_mail_account(
File "/app/paperless/src/paperless_mail/mail.py", line 157, in handle_mail_account
with get_mailbox(account.imap_server,
File "/app/paperless/src/paperless_mail/mail.py", line 97, in get_mailbox
mailbox = MailBox(server, port)
File "/usr/local/lib/python3.8/dist-packages/imap_tools/mailbox.py", line 290, in __init__
super().__init__()
File "/usr/local/lib/python3.8/dist-packages/imap_tools/mailbox.py", line 32, in __init__
self.box = self._get_mailbox_client()
File "/usr/local/lib/python3.8/dist-packages/imap_tools/mailbox.py", line 305, in _get_mailbox_client
return imaplib.IMAP4_SSL(self._host, self._port, self._keyfile, self._certfile, self._ssl_context)
File "/usr/lib/python3.8/imaplib.py", line 1297, in __init__
IMAP4.__init__(self, host, port)
File "/usr/lib/python3.8/imaplib.py", line 198, in __init__
self.open(host, port)
File "/usr/lib/python3.8/imaplib.py", line 1310, in open
IMAP4.open(self, host, port)
File "/usr/lib/python3.8/imaplib.py", line 303, in open
self.sock = self._create_socket()
File "/usr/lib/python3.8/imaplib.py", line 1300, in _create_socket
sock = IMAP4._create_socket(self)
File "/usr/lib/python3.8/imaplib.py", line 293, in _create_socket
return socket.create_connection((host, self.port))
File "/usr/lib/python3.8/socket.py", line 787, in create_connection
for res in getaddrinfo(host, port, 0, SOCK_STREAM):
File "/usr/lib/python3.8/socket.py", line 918, in getaddrinfo
for res in _socket.getaddrinfo(host, port, family, type, proto, flags):
socket.gaierror: [Errno -3] Temporary failure in name resolution

I also have a pi-hole running in a docker on the same NAS.

Does anybody have any suggestions how to solve that problem?

Thanks in advance!

Andreas

  • Try to do name resolution from within the container.
docker ps -a
docker exec -it <container name/id> sh
  • Are you using Pi-Hole as DHCP server? And does your NAS has a static or dynamic DHCP address? If DHCP of Pi-Hole is used, Pi-Holes DNS are pushed to the client.
  • Check /etc/resolv.conf on host and container.
  • Try to hardcode DNS servers in /etc/resolv.conf of host and container temporarily.

Hi,

thanks for the reply!

Are you using Pi-Hole as DHCP server? And does your NAS has a static or dynamic DHCP address? If DHCP of Pi-Hole is used, Pi-Holes DNS are pushed to the client.

  • PiHole is not my DHCP server, the router is.
  • The NAS has a dynamic DHCP address.
  • I also get the correct DNS server from the DHCP server.

Check /etc/resolv.conf on host and container.
Try to hardcode DNS servers in /etc/resolv.conf of host and container temporarily.

  • The IP of the PiHole was automatically configured in the resolv.conf files both on the host and in the container.

Once I set the DNS on the synology to 8.8.8.8, paperless could access the mail server.
There seems to be a problem with accessing a local DNS server in another docker container.

The pi-hole has network mode host, paperless has bridge mode. I will try to change bridge mode to host mode for paperless as well in order to get it to run with my local DNS.

Did you set the port of your Mailserver in paperless?

Did you set the port of your Mailserver in paperless?

I set imap.gmail.com and 993 for the mailserver.