Uploaded image for project: 'Project Quay'
  1. Project Quay
  2. PROJQUAY-1816

Quay export logs API return 200 when export logs mail not delivered to target address

XMLWordPrintable

    • False
    • False
    • Undefined

      Description:

      This is an issue found when export logs to target mail address, the results is the mail of export logs was not delivered successfully, but the API "
      https://quayregistry-quay-quay-enterprise.apps.quay-fips-618.qe.devcluster.openshift.com/api/v1/repository/qateam/demo/exportlogs?starttime=3/24/2021&endtime=3/31/2021", return 200 response, checked Quay APP POD logs, get ERROR "util.useremails.CannotSendEmailException: unknown reasons", in this API call, if the mail was NOT  sent successfully, it should return 500 response code.
       
      Note: the quay was deployed on OCP with FIPS enabled.

      Quay UI export logs successfully

      exportactionlogsworker stdout | 2021-03-31 09:12:23,052 [77] [ERROR] [util.useremails] Error while trying to send email to quayteam@redhat.com
      exportactionlogsworker stdout | Traceback (most recent call last):
      exportactionlogsworker stdout |   File "/quay-registry/util/useremails.py", line 70, in send_email
      exportactionlogsworker stdout |     mail.send(msg)
      exportactionlogsworker stdout |   File "/usr/local/lib/python3.8/site-packages/flask_mail.py", line 491, in send
      exportactionlogsworker stdout |     with self.connect() as connection:
      exportactionlogsworker stdout |   File "/usr/local/lib/python3.8/site-packages/flask_mail.py", line 144, in __enter__
      exportactionlogsworker stdout |     self.host = self.configure_host()
      exportactionlogsworker stdout |   File "/usr/local/lib/python3.8/site-packages/flask_mail.py", line 165, in configure_host
      exportactionlogsworker stdout |     host.login(self.mail.username, self.mail.password)
      exportactionlogsworker stdout |   File "/usr/lib64/python3.8/smtplib.py", line 723, in login
      exportactionlogsworker stdout |     (code, resp) = self.auth(
      exportactionlogsworker stdout |   File "/usr/lib64/python3.8/smtplib.py", line 642, in auth
      exportactionlogsworker stdout |     authobject(challenge).encode('ascii'), eol='')
      exportactionlogsworker stdout |   File "/usr/lib64/python3.8/smtplib.py", line 654, in auth_cram_md5
      exportactionlogsworker stdout |     return self.user + " " + hmac.HMAC(
      exportactionlogsworker stdout |   File "/usr/lib64/python3.8/hmac.py", line 163, in __new__
      exportactionlogsworker stdout |     result = _hmacopenssl.HMAC.__new__(cls, key, digestmod=name)
      exportactionlogsworker stdout | ValueError: unknown reasons
      exportactionlogsworker stdout | 2021-03-31 09:12:23,053 [77] [ERROR] [workers.worker] Operation raised exception
      exportactionlogsworker stdout | Traceback (most recent call last):
      exportactionlogsworker stdout |   File "/quay-registry/util/useremails.py", line 70, in send_email
      exportactionlogsworker stdout |     mail.send(msg)
      exportactionlogsworker stdout |   File "/usr/local/lib/python3.8/site-packages/flask_mail.py", line 491, in send
      exportactionlogsworker stdout |     with self.connect() as connection:
      exportactionlogsworker stdout |   File "/usr/local/lib/python3.8/site-packages/flask_mail.py", line 144, in __enter__
      exportactionlogsworker stdout |     self.host = self.configure_host()
      exportactionlogsworker stdout |   File "/usr/local/lib/python3.8/site-packages/flask_mail.py", line 165, in configure_host
      exportactionlogsworker stdout |     host.login(self.mail.username, self.mail.password)
      exportactionlogsworker stdout |   File "/usr/lib64/python3.8/smtplib.py", line 723, in login
      exportactionlogsworker stdout |     (code, resp) = self.auth(
      exportactionlogsworker stdout |   File "/usr/lib64/python3.8/smtplib.py", line 642, in auth
      exportactionlogsworker stdout |     authobject(challenge).encode('ascii'), eol='')
      exportactionlogsworker stdout |   File "/usr/lib64/python3.8/smtplib.py", line 654, in auth_cram_md5
      exportactionlogsworker stdout |     return self.user + " " + hmac.HMAC(
      exportactionlogsworker stdout |   File "/usr/lib64/python3.8/hmac.py", line 163, in __new__
      exportactionlogsworker stdout |     result = _hmacopenssl.HMAC.__new__(cls, key, digestmod=name)
      exportactionlogsworker stdout | ValueError: unknown reasons
      exportactionlogsworker stdout | During handling of the above exception, another exception occurred:
      exportactionlogsworker stdout | Traceback (most recent call last):
      exportactionlogsworker stdout |   File "/quay-registry/util/useremails.py", line 70, in send_email
      exportactionlogsworker stdout |     mail.send(msg)
      exportactionlogsworker stdout |   File "/usr/local/lib/python3.8/site-packages/flask_mail.py", line 491, in send
      exportactionlogsworker stdout |     with self.connect() as connection:
      exportactionlogsworker stdout |   File "/usr/local/lib/python3.8/site-packages/flask_mail.py", line 144, in __enter__
      exportactionlogsworker stdout |     self.host = self.configure_host()
      exportactionlogsworker stdout |   File "/usr/local/lib/python3.8/site-packages/flask_mail.py", line 165, in configure_host
      exportactionlogsworker stdout |     host.login(self.mail.username, self.mail.password)
      exportactionlogsworker stdout |   File "/usr/lib64/python3.8/smtplib.py", line 723, in login
      exportactionlogsworker stdout |     (code, resp) = self.auth(
      exportactionlogsworker stdout |   File "/usr/lib64/python3.8/smtplib.py", line 642, in auth
      exportactionlogsworker stdout |     authobject(challenge).encode('ascii'), eol='')
      exportactionlogsworker stdout |   File "/usr/lib64/python3.8/smtplib.py", line 654, in auth_cram_md5
      exportactionlogsworker stdout |     return self.user + " " + hmac.HMAC(
      exportactionlogsworker stdout |   File "/usr/lib64/python3.8/hmac.py", line 163, in __new__
      exportactionlogsworker stdout |     result = _hmacopenssl.HMAC.__new__(cls, key, digestmod=name)
      exportactionlogsworker stdout | ValueError: unknown reasons
      exportactionlogsworker stdout | During handling of the above exception, another exception occurred:
      exportactionlogsworker stdout | Traceback (most recent call last):
      exportactionlogsworker stdout |   File "/quay-registry/workers/worker.py", line 87, in _operation_func
      exportactionlogsworker stdout |     return operation_func()
      exportactionlogsworker stdout |   File "/quay-registry/workers/queueworker.py", line 133, in poll_queue
      exportactionlogsworker stdout |     self.process_queue_item(job_details)
      exportactionlogsworker stdout |   File "/quay-registry/workers/exportactionlogsworker.py", line 53, in process_queue_item
      exportactionlogsworker stdout |     return self._process_queue_item(job_details, app_storage)
      exportactionlogsworker stdout |   File "/quay-registry/workers/exportactionlogsworker.py", line 194, in _process_queue_item
      exportactionlogsworker stdout |     self._report_results(job_details, ExportResult.SUCCESSFUL_EXPORT, export_url)
      exportactionlogsworker stdout |   File "/quay-registry/workers/exportactionlogsworker.py", line 277, in _report_results
      exportactionlogsworker stdout |     send_logs_exported_email(
      exportactionlogsworker stdout |   File "/quay-registry/util/useremails.py", line 211, in send_logs_exported_email
      exportactionlogsworker stdout |     send_email(
      exportactionlogsworker stdout |   File "/quay-registry/util/useremails.py", line 77, in send_email
      exportactionlogsworker stdout |     raise CannotSendEmailException(str(ex))
      exportactionlogsworker stdout | util.useremails.CannotSendEmailException: unknown reasons
      exportactionlogsworker stdout | 2021-03-31 09:12:23,053 [77] [INFO] [apscheduler.executors.default] Job "QueueWorker.poll_queue (trigger: interval[0:01:00], next run at: 2021-03-31 09:13:22 UTC)" executed successfully
      

      Quay Version:

      oc get pod
      NAME                                              READY   STATUS      RESTARTS   AGE
      quayregistry-clair-app-684b4dd5dc-tm75j           1/1     Running     0          62m
      quayregistry-clair-postgres-55d459bc7b-bbfrp      1/1     Running     0          61m
      quayregistry-quay-app-8668f6d6b8-dxntk            1/1     Running     0          63m
      quayregistry-quay-config-editor-b77dd788d-rkkp6   1/1     Running     0          63m
      quayregistry-quay-database-79c87dc79b-gdslh       1/1     Running     0          62m
      quayregistry-quay-mirror-84479758dd-wcnmv         1/1     Running     0          61m
      quayregistry-quay-postgres-init-2vnb8             0/1     Completed   0          62m
      quayregistry-quay-redis-6bf785cf8f-pmm7f          1/1     Running     0          62m
      
      oc get pod quayregistry-quay-app-8668f6d6b8-dxntk -o json | jq '.spec.containers[0].image'
      "registry.redhat.io/quay/quay-rhel8@sha256:559a247a810d290911ec09062ff2ae583d73d50625b6bb12d59e5e60a442ac6d"

      Steps:

      1. Deploy Quay 3.5.0 Operator to all OCP namespace
      2. Deploy quay with quay 3.5 Operator with using AWS S3 as backend registry storage
      3. Create new image repo and push new images to this repo
      4. Click Export logs and provide valid mail address

      Expected Results:

      Export logs completes successfully and checked mailbox can see the new mail of the export logs from quay.

      Actual Results:

      Export logs completes successfully , but checked mailbox can't see the new mail of the export logs from quay, in quay app POD logs, get error "util.useremails.CannotSendEmailException: unknown reasons"

            jonathankingfc Jonathan King
            lzha1981 luffy zhang
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated:
              Resolved: