reanahub / reana

REANA: Reusable research data analysis platform
https://docs.reana.io
MIT License
127 stars 54 forks source link

introduce safer defaults for user notifications #334

Closed tiborsimko closed 4 years ago

tiborsimko commented 4 years ago

If people install REANA and if they don't pay attention to setting up default user properly -- see also #333 -- they will get many failed pods like:

reana-system-status-1591623300-sk6s9         0/1     Error     0          9m22s
reana-system-status-1591623300-wlxwn         0/1     Error     0          6m42s
reana-system-status-1591623600-b89lq         0/1     Error     0          6m54s
reana-system-status-1591623600-bn9dk         0/1     Error     0          4m21s

because of:

  File "/code/modules/reana-commons/reana_commons/email.py", line 37, in send_email
    with smtplib.SMTP(REANA_EMAIL_SMTP_SERVER, REANA_EMAIL_SMTP_PORT) as server:
  File "/usr/local/lib/python3.6/smtplib.py", line 251, in __init__
    (code, msg) = self.connect(host, port)
  File "/usr/local/lib/python3.6/smtplib.py", line 336, in connect
...
  File "/usr/local/lib/python3.6/socket.py", line 704, in create_connection
    for res in getaddrinfo(host, port, 0, SOCK_STREAM):
  File "/usr/local/lib/python3.6/socket.py", line 745, in getaddrinfo
    for res in _socket.getaddrinfo(host, port, family, type, proto, flags):
socket.gaierror: [Errno -2] Name or service not known

It would be good to introduce safe defaults:

tiborsimko commented 4 years ago

Besides having user@my.org, I noticed that we also have admin@reana.org used in create-admin-user.sh. Note that this latter domain is not ours, it should be reana.io.

In any case, for any examples, the canonical domain to use is example.org, so john.doe@example.org, jane.doe@example.org, etc. And for user accounts, root@localhost or $(whoami)@localhost is safer.

tiborsimko commented 4 years ago

Note: happens only for PROD-like deployments, the DEV-like deployments are fine.

Here is one useful one-line workaround to kill those pods from time to time:

$ kubectl get jobs | grep reana-system-status | awk '{print $1}' | xargs -r kubectl delete job