Automatically send report PDFs via email

70 views
Skip to first unread message

Elia Lombardo

unread,
Apr 9, 2024, 7:11:07 AMApr 9
to QATrack+
Dears,

we would like to setup an automatic email  sending of test reports. 

Following this page (https://docs.qatrackplus.com/en/stable/install/config.html?highlight=email#configuring-email-for-qatrack), we have changed the email host settings to an unsecured connection using the hospital's SMTP.

Unfortunately, we are not getting any email and do not see where the error is. Is there a way to debug this ?

Best,
Elia

tbe...@gmail.com

unread,
Apr 10, 2024, 2:29:49 AMApr 10
to QATrack+
Hi Elia,

you should be able to find e-mail related error messages in /home/$USER/web/qatrackplus/logs/debug.log (when logged in as the QATrack installation user).
You should also Set DEBUG = True and EMAIL_FAIL_SILENTLY to False in your local_settings.py

I hope that helps


regards
Thomas

Elia Lombardo

unread,
Jun 5, 2024, 7:44:49 AMJun 5
to QATrack+
Dear Thomas,

thank you for your advice, we were able to solve the problem with getting an email notification upon test completion!

Now, we wanted to schedule receiving an email with a report PDF, however, we do not get any email and nothing gets written to the debug.log so we are not able to see where the issue might be. As mentioned above, we are able to get emails for notifications in general, just not for report PDFs...

Thank you very much in advance!
Elia

Randle Taylor

unread,
Jun 5, 2024, 9:11:58 AMJun 5
to Elia Lombardo, QATrack+
Hi Elia,

Can you confirm that generating PDF reports via the user interface works?  After you resolved the issue with email notifications, did you restart Django Q (see https://docs.qatrackplus.com/en/stable/install/config.html?highlight=email#restarting-qatrack-on-windows) Django Q is responsible for sending out reports in the background, so if it was not restarted with your fix applied it will still be using your old email settings.  You can also check the django-q.log to see if there's any errors logged there.

Randy

--
You received this message because you are subscribed to the Google Groups "QATrack+" group.
To unsubscribe from this group and stop receiving emails from it, send an email to qatrack+u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/qatrack/8b2d32a6-b483-4ab1-8bc0-934c05dfd1f9n%40googlegroups.com.

Elia Lombardo

unread,
Jun 5, 2024, 9:59:42 AMJun 5
to QATrack+
Hi Randy,

thank you for the quick feedback!

Yes, we can confirm that we can generate PDF reports from the interface and that we restarted Django Q from the Task Scheduler (taskschd.msc on Windows, should make no difference from restarting it via the powershell, no ?).

Also in the django-q.log we do not see any errors, we just scheduled a report for 15:45 and this is what we see in the file:

[05/Jun/2024 15:37:51] INFO [django-q:89] Running run_faults_review_notices task at 2024-06-05 15:37:51.902591 for notices between 2024-06-05 15:37:51.902591 and 2024-06-05 15:52:51.902591

[05/Jun/2024 15:37:51] INFO [django-q:387] Processed [bravo-five-mars-grey]

[05/Jun/2024 15:37:51] INFO [django-q:387] Processed [beer-summer-washington-california]

[05/Jun/2024 15:37:51] INFO [django-q:387] Processed [happy-skylark-three-missouri]

[05/Jun/2024 15:37:51] INFO [django-q:387] Processed [oscar-kansas-four-hotel]

[05/Jun/2024 15:53:00] INFO [django-q:74] Enqueued 96

[05/Jun/2024 15:53:00] INFO [django-q:648] Process-1 created a task from schedule [QATrack+ Scheduling Notices]

[05/Jun/2024 15:53:00] INFO [django-q:74] Enqueued 97

[05/Jun/2024 15:53:00] INFO [django-q:648] Process-1 created a task from schedule [QATrack+ Review Notices]

[05/Jun/2024 15:53:00] INFO [django-q:74] Enqueued 98

[05/Jun/2024 15:53:00] INFO [django-q:648] Process-1 created a task from schedule [QATrack+ Service Event Review Notices]

[05/Jun/2024 15:53:00] INFO [django-q:74] Enqueued 99

[05/Jun/2024 15:53:00] INFO [django-q:648] Process-1 created a task from schedule [QATrack+ Service Event Scheduling Notices]

[05/Jun/2024 15:53:00] INFO [django-q:74] Enqueued 100

[05/Jun/2024 15:53:00] INFO [django-q:648] Process-1 created a task from schedule [QATrack+ Fault Review Notices]

[05/Jun/2024 15:53:00] INFO [django-q:415] Process-1:6 processing [xray-west-fix-north]

[05/Jun/2024 15:53:00] INFO [django-q:89] Running run_scheduling_notices task at 2024-06-05 15:53:00.073226 for notices between 2024-06-05 15:53:00.073226 and 2024-06-05 16:08:00.073226

[05/Jun/2024 15:53:00] INFO [django-q:415] Process-1:5 processing [video-india-early-table]

[05/Jun/2024 15:53:00] INFO [django-q:89] Running run_review_notices task at 2024-06-05 15:53:00.082202 for notices between 2024-06-05 15:53:00.082202 and 2024-06-05 16:08:00.082202

[05/Jun/2024 15:53:00] INFO [django-q:415] Process-1:6 processing [island-virginia-failed-lion]

[05/Jun/2024 15:53:00] INFO [django-q:387] Processed [xray-west-fix-north]

[05/Jun/2024 15:53:00] INFO [django-q:89] Running run_service_event_review_notices task at 2024-06-05 15:53:00.089232 for notices between 2024-06-05 15:53:00.089232 and 2024-06-05 16:08:00.089232

[05/Jun/2024 15:53:00] INFO [django-q:415] Process-1:5 processing [fish-whiskey-leopard-network]

[05/Jun/2024 15:53:00] INFO [django-q:89] Running run_service_log_scheduling_notices task at 2024-06-05 15:53:00.098217 for notices between 2024-06-05 15:53:00.098217 and 2024-06-05 16:08:00.098217

[05/Jun/2024 15:53:00] INFO [django-q:415] Process-1:6 processing [six-item-salami-early]

[05/Jun/2024 15:53:00] INFO [django-q:387] Processed [video-india-early-table]

[05/Jun/2024 15:53:00] INFO [django-q:89] Running run_faults_review_notices task at 2024-06-05 15:53:00.106192 for notices between 2024-06-05 15:53:00.106192 and 2024-06-05 16:08:00.106192

[05/Jun/2024 15:53:00] INFO [django-q:387] Processed [island-virginia-failed-lion]

[05/Jun/2024 15:53:00] INFO [django-q:387] Processed [fish-whiskey-leopard-network]

[05/Jun/2024 15:53:00] INFO [django-q:387] Processed [six-item-salami-early]


Best,

Elia


Randle Taylor

unread,
Jun 5, 2024, 10:19:12 AMJun 5
to Elia Lombardo, QATrack+
In the Django Q Scheduled Task Admin how does the Report Sender task look?

image.png

are there any Successful tasks showing in the Successful tasks view?
image.png
Thanks,
Randy


Elia Lombardo

unread,
Jun 6, 2024, 2:54:03 AMJun 6
to QATrack+
Dear Randy,

It works now, thank you so much for the support!!

We apologize but we hadn't understood that additionally to setting up the report a Scheduled Task with FUNC=qatrack.reports.tasks.run_reports needs to be defined. Is that documented somewhere? we could not find it...

Best,
Elia

Randle Taylor

unread,
Jun 6, 2024, 12:49:18 PMJun 6
to Elia Lombardo, QATrack+
Actually those tasks should be automatically scheduled/updated when you run `python manage.py migrate`.  This is the first time I've seen where a task wasn't scheduled for some reason!

Randy

Elia Lombardo

unread,
Jun 7, 2024, 8:35:26 AMJun 7
to Randle Taylor, QATrack+
That's weird! We installed QAtrack separately on both a main server and a backup server and it was missing on both...
Elia
Reply all
Reply to author
Forward
0 new messages