Uploaded image for project: 'SimplyE 2.0'
  1. SimplyE 2.0
  2. SIMPLY-3821

Registry can raise uncaught exception if no mailer configured

XMLWordPrintable

    • SIMPLY S13 June 22 - July 6
    • 3

      When a registry server is not configured with an emailer, a call by a circ manager instance to /register will cause an uncaught exception like the following:

      [2021-06-30 14:22:41 +0000] [17] [ERROR] Error handling request /register
      Traceback (most recent call last):
        File "/simplye_venv/simplye_app-2zo-yRvq/lib/python3.9/site-packages/gunicorn/workers/gthread.py", line 271, in handle
          keepalive = self.handle_request(req, conn)
        File "/simplye_venv/simplye_app-2zo-yRvq/lib/python3.9/site-packages/gunicorn/workers/gthread.py", line 323, in handle_request
          respiter = self.wsgi(environ, resp.start_response)
        File "/simplye_venv/simplye_app-2zo-yRvq/lib/python3.9/site-packages/flask/app.py", line 2069, in __call__
          return self.wsgi_app(environ, start_response)
        File "/simplye_venv/simplye_app-2zo-yRvq/lib/python3.9/site-packages/flask/app.py", line 2054, in wsgi_app
          response = self.handle_exception(e)
        File "/simplye_venv/simplye_app-2zo-yRvq/lib/python3.9/site-packages/flask/app.py", line 2051, in wsgi_app
          response = self.full_dispatch_request()
        File "/simplye_venv/simplye_app-2zo-yRvq/lib/python3.9/site-packages/flask/app.py", line 1501, in full_dispatch_request
          rv = self.handle_user_exception(e)
        File "/simplye_venv/simplye_app-2zo-yRvq/lib/python3.9/site-packages/flask/app.py", line 1499, in full_dispatch_request
          rv = self.dispatch_request()
        File "/simplye_venv/simplye_app-2zo-yRvq/lib/python3.9/site-packages/flask/app.py", line 1485, in dispatch_request
          return self.ensure_sync(self.view_functions[rule.endpoint])(**req.view_args)
        File "/simplye_app/util/app_server.py", line 47, in decorated
          v = f(*args, **kwargs)
        File "/simplye_app/app.py", line 88, in register
          return app.library_registry.registry_controller.register()
        File "/simplye_app/controller.py", line 647, in register
          hyperlink.notify(self.emailer, self.app.url_for)
        File "/simplye_app/model.py", line 1822, in notify
          body = emailer.send(email_type, to_address, **template_args)
        File "/simplye_app/emailer.py", line 186, in send
          return self._send_email(to_address, body, smtp)
        File "/simplye_app/emailer.py", line 192, in _send_email
          smtp.starttls()
        File "/usr/local/lib/python3.9/smtplib.py", line 774, in starttls
          self.sock = context.wrap_socket(self.sock,
        File "/usr/local/lib/python3.9/ssl.py", line 500, in wrap_socket
          return self.sslsocket_class._create(
        File "/usr/local/lib/python3.9/ssl.py", line 1031, in _create
          self._sslobj = self._context._wrap_socket(
      ValueError: server_hostname cannot be an empty string or start with a leading dot.

      Rather than allow an ISE to propagate back to the client in some form, we should return an explanatory ProblemDetail.

            NickBallenger Nick Ballenger (Inactive)
            NickBallenger Nick Ballenger (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: