Where is the log regarding how ERPNext processes email kept?


I had an issue where no emails were being sent or could be received on my instance for about a day with my own hosted ERPNext server. Looking at the various logs in :-

/frappe-bench/logs did not show anything about the problem with sending or reception of emails.

Where should I look so I can investigate the problem further?

In the ERPNext error log it says this :

Error in retrieving email.
Traceback (most recent call last):
File “/home/frappe/frappe-bench/apps/frappe/frappe/email/receive.py”, line 230, in retrieve_message
status, message = self.imap.uid(‘fetch’, message_meta, ‘(BODY.PEEK[] BODY.PEEK[HEADER] FLAGS)’)
File “/usr/lib/python2.7/imaplib.py”, line 773, in uid
typ, dat = self._simple_command(name, command, *args)
File “/usr/lib/python2.7/imaplib.py”, line 1088, in _simple_command
return self._command_complete(name, self._command(name, *args))
File “/usr/lib/python2.7/imaplib.py”, line 910, in _command_complete
typ, data = self._get_tagged_response(tag)
File “/usr/lib/python2.7/imaplib.py”, line 1017, in _get_tagged_response
File “/usr/lib/python2.7/imaplib.py”, line 974, in _get_response
data = self.read(size)
File “/usr/lib/python2.7/imaplib.py”, line 1184, in read
return self.file.read(size)
File “/usr/lib/python2.7/socket.py”, line 384, in read
data = self._sock.recv(left)
File “/usr/lib/python2.7/ssl.py”, line 756, in recv
return self.read(buflen)
File “/usr/lib/python2.7/ssl.py”, line 643, in read
v = self._sslobj.read(len)
File “/home/frappe/frappe-bench/env/local/lib/python2.7/site-packages/rq/timeouts.py”, line 51, in handle_death_penalty
‘value ({0} seconds)’.format(self._timeout))
JobTimeoutException: Job exceeded maximum timeout value (300 seconds)


Error in retrieving email.
Traceback (most recent call last):
File “/home/frappe/frappe-bench/apps/frappe/frappe/email/receive.py”, line 231, in retrieve_message
raw, header, ignore = message
ValueError: too many values to unpack

But this doesn’t explain why emails were completely stopped from being sent or received. Perhaps the error was just the start of the problem from which it couldnt recover ?

Note I restarted the server and this fixed the issue but I still want to find out what was causing the problem?

I’m using Ubuntu 16.04 with the easy install:-

Installed Apps

ERPNext: v8.0.13 (master)
Frappe Framework: v8.0.18 (master)
Mandrill Integration: v0.0.1 (master) (although not being used)

Check if you are able to save your Email Account master fine. This will validate if credentials provided in the Email Account are valid.

In the System Settings, under Background Workers section, ensure Enable Scheduled Jobs is checked.

1 Like

The three email accounts normally receive email and send mail fine so there is no issue there. After a reboot things are fine. But obviously if something causes all email to stop being received or transmitted then I need to find out what it is. Please note the mail server itself is one under my control and did not have any other issues with any of the other mail accounts that we normall use at the time

Enabled Scheduled Jobs is checked in the Background Workers section.

The other thing is that using only the Error log in ERPNext it does not actually show when the error in the log happened. All it now says is 2 days ago. This is also why I also need to check the underlying log on the os.