[GH-ISSUE #62] sendalerts doesn't work with new failures #39

Closed
opened 2026-02-25 23:40:54 +03:00 by kerem · 1 comment
Owner

Originally created by @bobelev on GitHub (Jun 10, 2016).
Original GitHub issue: https://github.com/healthchecks/healthchecks/issues/62

Keep getting this stacktrace while testing notifications.

Sending alert, status=grace, code=11f7ef3e-bc25-4d85-8930-80090aab7418
Traceback (most recent call last):
  File "/app/manage.py", line 10, in <module>
    execute_from_command_line(sys.argv)
  File "/usr/lib/python3.5/site-packages/django/core/management/__init__.py", line 350, in execute_from_command_line
    utility.execute()
  File "/usr/lib/python3.5/site-packages/django/core/management/__init__.py", line 342, in execute
    self.fetch_command(subcommand).run_from_argv(self.argv)
  File "/usr/lib/python3.5/site-packages/django/core/management/base.py", line 348, in run_from_argv
    self.execute(*args, **cmd_options)
  File "/usr/lib/python3.5/site-packages/django/core/management/base.py", line 399, in execute
    output = self.handle(*args, **options)
  File "/app/hc/api/management/commands/sendalerts.py", line 62, in handle
    if self.handle_many():
  File "/app/hc/api/management/commands/sendalerts.py", line 31, in handle_many
    future.result()
  File "/usr/lib/python3.5/concurrent/futures/_base.py", line 405, in result
    return self.__get_result()
  File "/usr/lib/python3.5/concurrent/futures/_base.py", line 357, in __get_result
    raise self._exception
  File "/usr/lib/python3.5/concurrent/futures/thread.py", line 55, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/app/hc/api/management/commands/sendalerts.py", line 50, in handle_one
    errors = check.send_alert()
  File "/app/hc/api/models.py", line 72, in send_alert
    raise NotImplementedError("Unexpected status: %s" % self.status)

Notifications seem to work when ./manage.py sendalerts is invoked manually after 'check failure'. But when I start sendalerts in background I always get this stacktrace.

Originally created by @bobelev on GitHub (Jun 10, 2016). Original GitHub issue: https://github.com/healthchecks/healthchecks/issues/62 Keep getting this stacktrace while testing notifications. ``` Sending alert, status=grace, code=11f7ef3e-bc25-4d85-8930-80090aab7418 Traceback (most recent call last): File "/app/manage.py", line 10, in <module> execute_from_command_line(sys.argv) File "/usr/lib/python3.5/site-packages/django/core/management/__init__.py", line 350, in execute_from_command_line utility.execute() File "/usr/lib/python3.5/site-packages/django/core/management/__init__.py", line 342, in execute self.fetch_command(subcommand).run_from_argv(self.argv) File "/usr/lib/python3.5/site-packages/django/core/management/base.py", line 348, in run_from_argv self.execute(*args, **cmd_options) File "/usr/lib/python3.5/site-packages/django/core/management/base.py", line 399, in execute output = self.handle(*args, **options) File "/app/hc/api/management/commands/sendalerts.py", line 62, in handle if self.handle_many(): File "/app/hc/api/management/commands/sendalerts.py", line 31, in handle_many future.result() File "/usr/lib/python3.5/concurrent/futures/_base.py", line 405, in result return self.__get_result() File "/usr/lib/python3.5/concurrent/futures/_base.py", line 357, in __get_result raise self._exception File "/usr/lib/python3.5/concurrent/futures/thread.py", line 55, in run result = self.fn(*self.args, **self.kwargs) File "/app/hc/api/management/commands/sendalerts.py", line 50, in handle_one errors = check.send_alert() File "/app/hc/api/models.py", line 72, in send_alert raise NotImplementedError("Unexpected status: %s" % self.status) ``` Notifications seem to work when `./manage.py sendalerts` is invoked manually after 'check failure'. But when I start `sendalerts` in background I always get this stacktrace.
kerem closed this issue 2026-02-25 23:40:54 +03:00
Author
Owner

@cuu508 commented on GitHub (Jun 20, 2016):

@bobelev can you please give a little more detail on the steps to reproduce this? If you have a test database, can you make a SQL dump and send it to me?

There was a race condition in sendalerts command (between selecting check and sending a notification, the status can go from "up" to "grace"), and I just fixed that. But I'm not sure it's the same issue you are seeing.

<!-- gh-comment-id:227234450 --> @cuu508 commented on GitHub (Jun 20, 2016): @bobelev can you please give a little more detail on the steps to reproduce this? If you have a test database, can you make a SQL dump and send it to me? There was a race condition in sendalerts command (between selecting check and sending a notification, the status can go from "up" to "grace"), and I just fixed that. But I'm not sure it's the same issue you are seeing.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/healthchecks#39
No description provided.