send_notifications does not work
michidk opened this issue · 4 comments
send_notifications does not work
The python manage.py send_notifications
command fails.
In general sending emails works in django:
/usr/src/taiga-back # python manage.py sendtestemail test@example.de
Trying import local.py settings...
Enabling Taiga emails...
Enabling Taiga SSL...
Taiga events enabled
/usr/src/taiga-back # echo $?
0
But in order to send the taiga emails, python manage.py send_notifications
has to be called. But it always fails:
/usr/src/taiga-back # python manage.py send_notifications
Trying import local.py settings...
Enabling Taiga emails...
Enabling Taiga SSL...
Taiga events enabled
/usr/src/taiga-back/taiga/base/utils/iterators.py:56: UnorderedObjectListWarning: Pagination may yield inconsistent results with an unordered object_list: <class 'taiga.projects.notifica
tions.models.HistoryChangeNotification'> QuerySet.
paginator = Paginator(queryset, itersize)
/usr/src/taiga-back # echo $?
0
To Reproduce
Steps to reproduce the behavior:
- Setup docker-taiga using 5.0-alpine
- Setup SMTP env variables (in my case I use a TLS connection)
- Log into the container
- Run
python manage.py send_notifications
Expected behavior
Notifications are sent out and a success message will be printed to the console.
Docker:
- docker-taiga-back:5.0-alpine
Or does the error mean, that there are just no notifications scheduled? But I think it would not return such an error if it has no emails queued. Also, I don't think that the queue is completely empty, since our taiga instance did not send a single emails yet.
Hi @michidk ,
It seems like the issue your reported is the same as taigaio/taiga-back#1251.
/usr/src/taiga-back/taiga/base/utils/iterators.py:56: UnorderedObjectListWarning: Pagination may yield inconsistent results with an unordered object_list: <class 'taiga.projects.notifica tions.models.HistoryChangeNotification'> QuerySet.
This error is actually just a warning, so it's likely that there is no notifications to send.
Also, I don't think that the queue is completely empty, since our taiga instance did not send a single emails yet.
The current configuration has CHANGE_NOTIFICATIONS_MIN_INTERVAL
set to 300, but this requires to provide a Celery worker to send emails in async mode, or to setup a a cron job in a side container to send the emails.
We're going to add env var to easily change this value and also set it to 0, ie. emails will be sent directly, thus not relying on any async mode to send emails.
Awesome!