GMail email issues in TrueNAS 12.0 (Connection reset by peer)

vpv

Dabbler
Joined
Jan 6, 2021
Messages
10
Hi!

I've been running TrueNAS 12 for a while at home and decided to set up email notifications. Using GMail does not seem to work. The test emails are sent, but the daily email, which might be about scrub tasks, always fails.

/var/log/maillog has these in it:

Code:
Jan  5 03:45:00 truenas 1 2021-01-05T03:45:00.599690+02:00 truenas.local /middlewared 188 - - Failed to send email to myemail+truenas@gmail.com: [Errno 54] Connection reset by peer


I'm using GMail OAuth. The first test email always succeeds, the later emails fail. Any ideas? Should I post a Jira ticket?
 

Chris Moore

Hall of Famer
Joined
May 2, 2015
Messages
10,080

vpv

Dabbler
Joined
Jan 6, 2021
Messages
10
did you edit this, or is that how it is in the log?

I edited it to hide my real address.

I found Python exceptions related to this from /var/log/middlewared.log.

Code:
[2021/01/06 21:37:39] (DEBUG) google_auth_httplib2.__call__():114 - Making request: POST https://oauth2.googleapis.com/token
[2021/01/06 21:37:39] (WARNING) MailService.send_raw():420 - Failed to send email: [Errno 32] Broken pipe
Traceback (most recent call last):
  File "/usr/local/lib/python3.8/site-packages/middlewared/plugins/mail.py", line 393, in send_raw
    self.middleware.call_sync('mail.gmail_send', msg, config)
  File "/usr/local/lib/python3.8/site-packages/middlewared/main.py", line 1265, in call_sync
    return methodobj(*prepared_call.args)
  File "/usr/local/lib/python3.8/site-packages/middlewared/plugins/mail_/gmail.py", line 63, in gmail_send
    gmail_service.service.users().messages().send(userId="me", body={
  File "/usr/local/lib/python3.8/site-packages/googleapiclient/_helpers.py", line 134, in positional_wrapper
    return wrapped(*args, **kwargs)
  File "/usr/local/lib/python3.8/site-packages/googleapiclient/http.py", line 900, in execute
    resp, content = _retry_request(
  File "/usr/local/lib/python3.8/site-packages/googleapiclient/http.py", line 204, in _retry_request
    raise exception
  File "/usr/local/lib/python3.8/site-packages/googleapiclient/http.py", line 177, in _retry_request
    resp, content = http.request(uri, method, *args, **kwargs)
  File "/usr/local/lib/python3.8/site-packages/google_auth_httplib2.py", line 197, in request
    response, content = self.http.request(
  File "/usr/local/lib/python3.8/site-packages/httplib2/__init__.py", line 1982, in request
    (response, content) = self._request(
  File "/usr/local/lib/python3.8/site-packages/httplib2/__init__.py", line 1650, in _request
    (response, content) = self._conn_request(
  File "/usr/local/lib/python3.8/site-packages/httplib2/__init__.py", line 1558, in _conn_request
    conn.request(method, request_uri, body, headers)
  File "/usr/local/lib/python3.8/http/client.py", line 1255, in request
    self._send_request(method, url, body, headers, encode_chunked)
  File "/usr/local/lib/python3.8/http/client.py", line 1301, in _send_request
    self.endheaders(body, encode_chunked=encode_chunked)
  File "/usr/local/lib/python3.8/http/client.py", line 1250, in endheaders
    self._send_output(message_body, encode_chunked=encode_chunked)
  File "/usr/local/lib/python3.8/http/client.py", line 1010, in _send_output
    self.send(msg)
  File "/usr/local/lib/python3.8/http/client.py", line 971, in send
    self.sock.sendall(data)
  File "/usr/local/lib/python3.8/ssl.py", line 1204, in sendall
    v = self.send(byte_view[count:])
  File "/usr/local/lib/python3.8/ssl.py", line 1173, in send
    return self._sslobj.write(data)
BrokenPipeError: [Errno 32] Broken pipe


There's more, but I think that's the most relevant part.
 

Chris Moore

Hall of Famer
Joined
May 2, 2015
Messages
10,080
  • Like
Reactions: vpv
Top