The dockered celery worker of konova fails on staging with the following error:
[2022-01-2715:24:53,038:ERROR/ForkPoolWorker-1]Taskkonova.tasks.celery_send_mail_shared_data_unrecorded[91f7ecab-dbe7-417e-aeb6-c915b0c8fb7f]raisedunexpected:TypeError('getaddrinfo() argument 1 must be string or None')Traceback(mostrecentcalllast):File"/usr/local/lib/python3.7/site-packages/celery/app/trace.py",line451,intrace_taskR=retval=fun(*args,**kwargs)File"/usr/local/lib/python3.7/site-packages/celery/app/trace.py",line734,in__protected_call__returnself.run(*args,**kwargs)File"/konova/konova/tasks.py",line46,incelery_send_mail_shared_data_unrecordeduser.send_mail_shared_data_unrecorded(obj_identifier)File"/konova/user/models/user.py",line78,insend_mail_shared_data_unrecordedmailer.send_mail_shared_data_unrecorded(obj_identifier,self)File"/konova/konova/utils/mailer.py",line137,insend_mail_shared_data_unrecordedmsgFile"/konova/konova/utils/mailer.py",line49,insendauth_password=self.auth_passwordFile"/usr/local/lib/python3.7/site-packages/django/core/mail/__init__.py",line61,insend_mailreturnmail.send()File"/usr/local/lib/python3.7/site-packages/django/core/mail/message.py",line284,insendreturnself.get_connection(fail_silently).send_messages([self])File"/usr/local/lib/python3.7/site-packages/django/core/mail/backends/smtp.py",line102,insend_messagesnew_conn_created=self.open()File"/usr/local/lib/python3.7/site-packages/django/core/mail/backends/smtp.py",line62,inopenself.connection=self.connection_class(self.host,self.port,**connection_params)File"/usr/local/lib/python3.7/smtplib.py",line251,in__init__(code,msg)=self.connect(host,port)File"/usr/local/lib/python3.7/smtplib.py",line336,inconnectself.sock=self._get_socket(host,port,self.timeout)File"/usr/local/lib/python3.7/smtplib.py",line307,in_get_socketself.source_address)File"/usr/local/lib/python3.7/socket.py",line707,increate_connectionforresingetaddrinfo(host,port,0,SOCK_STREAM):File"/usr/local/lib/python3.7/socket.py",line752,ingetaddrinfoforresin_socket.getaddrinfo(host,port,family,type,proto,flags):TypeError:getaddrinfo()argument1mustbestringorNone
Fix
Since mails are send properly, having celery run on a non-dockered dev machine, we need to look for the reasons it fails in a dockered environment.
# Problem
The dockered celery worker of konova fails on staging with the following error:
```python
[2022-01-27 15:24:53,038: ERROR/ForkPoolWorker-1] Task konova.tasks.celery_send_mail_shared_data_unrecorded[91f7ecab-dbe7-417e-aeb6-c915b0c8fb7f] raised unexpected: TypeError('getaddrinfo() argument 1 must be string or None')
Traceback (most recent call last):
File "/usr/local/lib/python3.7/site-packages/celery/app/trace.py", line 451, in trace_task
R = retval = fun(*args, **kwargs)
File "/usr/local/lib/python3.7/site-packages/celery/app/trace.py", line 734, in __protected_call__
return self.run(*args, **kwargs)
File "/konova/konova/tasks.py", line 46, in celery_send_mail_shared_data_unrecorded
user.send_mail_shared_data_unrecorded(obj_identifier)
File "/konova/user/models/user.py", line 78, in send_mail_shared_data_unrecorded
mailer.send_mail_shared_data_unrecorded(obj_identifier, self)
File "/konova/konova/utils/mailer.py", line 137, in send_mail_shared_data_unrecorded
msg
File "/konova/konova/utils/mailer.py", line 49, in send
auth_password=self.auth_password
File "/usr/local/lib/python3.7/site-packages/django/core/mail/__init__.py", line 61, in send_mail
return mail.send()
File "/usr/local/lib/python3.7/site-packages/django/core/mail/message.py", line 284, in send
return self.get_connection(fail_silently).send_messages([self])
File "/usr/local/lib/python3.7/site-packages/django/core/mail/backends/smtp.py", line 102, in send_messages
new_conn_created = self.open()
File "/usr/local/lib/python3.7/site-packages/django/core/mail/backends/smtp.py", line 62, in open
self.connection = self.connection_class(self.host, self.port, **connection_params)
File "/usr/local/lib/python3.7/smtplib.py", line 251, in __init__
(code, msg) = self.connect(host, port)
File "/usr/local/lib/python3.7/smtplib.py", line 336, in connect
self.sock = self._get_socket(host, port, self.timeout)
File "/usr/local/lib/python3.7/smtplib.py", line 307, in _get_socket
self.source_address)
File "/usr/local/lib/python3.7/socket.py", line 707, in create_connection
for res in getaddrinfo(host, port, 0, SOCK_STREAM):
File "/usr/local/lib/python3.7/socket.py", line 752, in getaddrinfo
for res in _socket.getaddrinfo(host, port, family, type, proto, flags):
TypeError: getaddrinfo() argument 1 must be string or None
```
# Fix
Since mails are send properly, having celery run on a non-dockered dev machine, we need to look for the reasons it fails in a dockered environment.
mpeltriaux
added the bug label 2022-01-27 15:28:31 +01:00
mpeltriaux
self-assigned this 2022-01-27 15:28:31 +01:00
It does not seem to be a celery specific issue. The same happens if the foreground konova process shall sent an email. Something seems to be odd on the docker configuration for konova, since arnova is working fine and sending mails without problems.
It does not seem to be a celery specific issue. The same happens if the foreground konova process shall sent an email. Something seems to be odd on the docker configuration for konova, since arnova is working fine and sending mails without problems.
Inspired by this post I took a look on the django_settings.py file on the docker branch.
Indeed, somehow trailing comma got in there.
Fix has been merged and published on the staging in this commit
Inspired by [this post](https://stackoverflow.com/questions/42872923/flask-mail-typeerror-getaddrinfo-argument-1-must-be-string-or-none) I took a look on the `django_settings.py` file on the docker branch.
Indeed, somehow trailing comma got in there.
Fix has been merged and published on the staging in [this commit](https://git.naturschutz.rlp.de/SGD-Nord/konova/commit/9c9c9b7717932c336c56e3960de7910c1784c5c2)
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Problem
The dockered celery worker of konova fails on staging with the following error:
Fix
Since mails are send properly, having celery run on a non-dockered dev machine, we need to look for the reasons it fails in a dockered environment.
It does not seem to be a celery specific issue. The same happens if the foreground konova process shall sent an email. Something seems to be odd on the docker configuration for konova, since arnova is working fine and sending mails without problems.
Inspired by this post I took a look on the
django_settings.pyfile on the docker branch.Indeed, somehow trailing comma got in there.
Fix has been merged and published on the staging in this commit