riparias/gbif-alert

Admins receive emails for "service unavailable" errors that happen during data import

Closed this issue · 6 comments

For example, if a bot try to access the website when the maintenance mode is on. This is to be expected, so it would be cleaner to silently ignore the error.

Good thing is that apparently, django-maintenance-mode provides such a feature (see "Logging" section).

Config updated, deployed on the dev server. To check in context:

  • that no more mails are sent when in maintenance mode
  • that the rest of the logging still behaves normally

Doesn't work, mails are still being sent from the dev environment while in maintenance mode

Next step: check in a few days if such emails still happen.

Update: I now fixed the logging configuration, so the settings is not ignored anymore.

However, it also revealed a bug in django-maintenance-mode, so enabling it will create error 500s. So it is disabled for now. Problem description at fabiocaccamo/django-maintenance-mode#59 (a fix exists, but has not been merged/accepted by the maintainer).

Possible workaround if the issue is not solved at the source and we really want this feature: explicitly sets django-maintenance-mode default configuration in our settings (if possible by importing it to keep thigs dynamic).

Update: I just implemented the workaround listed above, we'll have to see in the next few days if all seems better in terms of maintenance mode in the dev and prod environments.

I think that's finally solved!