Skip to content

[Bug]: Background job failure emails are failing to send #3044

@tw4l

Description

@tw4l

Browsertrix Version

v1.20.1 (and likely for the last few minor versions)

What did you expect to happen? What happened instead?

When a background job fails, the superadmin account should receive an email.

Instead, we're seeing the following error:

Succeeded: {status.get('succeeded')}, Num Pods: {spec.get('parallelism')}
Background job create-replica-05ebe9d4cc failed, sending email to superuser
Update Background Job Error
Traceback (most recent call last):
  File "/app/btrixcloud/operator/bgjobs.py", line 70, in finalize_background_job
    await self.background_job_ops.job_finished(
  File "/app/btrixcloud/background_jobs.py", line 525, in job_finished
    await self._send_bg_job_failure_email(job, finished)
  File "/app/btrixcloud/background_jobs.py", line 541, in _send_bg_job_failure_email
    await asyncio.get_event_loop().run_in_executor(
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "uvloop/loop.pyx", line 2735, in uvloop.loop.Loop.run_in_executor
TypeError: coroutines cannot be used with run_in_executor()

Reproduction instructions

  1. Set up local instance with a replica storage location that will fail
  2. Run a crawl
  3. Check logs to see error and verify email was not sent

Screenshots / Video

No response

Environment

No response

Additional details

No response

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

Projects

Status

Done!

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions