antedebaas / Viesti-Reports

DMARC & SMTP-TLS Reports processor and visualizer and BIMI file hoster
https://docs.viestireports.com/
GNU Affero General Public License v3.0
81 stars 16 forks source link

Automatic updating task fails (type incompatibility) and don't recover itself #162

Closed ceskyDJ closed 1 month ago

ceskyDJ commented 1 month ago

Issue Template

No relevant issue exists I looked up the issue list and found no similar issue.

Describe the bug For some reason, there was a type incompatibility, and the automatic task for reading reports from the email account failed. In the dashboard, I see information about already running command: image

When I went a few reports back in history, I found that some uncaught exception should cause it: image

I see a pretty big problem here. How could some uncaught exceptions in some running tasks break future runs? I think that running a task with an error like this should be adequately killed so that when the following cron job runs the task again, it has a chance to run properly.

Are you using the Docker image?

Database used

Database version used 11.5.2

Error Messages The unhandled exception I talked about is this (according to information obtained from error message detail in GUI): App\Repository\LogsRepository::try_unserialize(): Return value must be of type array, false returned

Steps to Reproduce I don't know. I changed nothing, do nothing. I just opened the dashboard and saw the error messages I presented above.

Expected behavior There are two things:

  1. The exception should be caught / the error should be fixed in case of a bug in the code.
  2. Running tasks should be killed in case of error so the following cron job can run a new task that tries the report synchronization again (and possibly succeeds).

Additional context If you need something more, just let me know and I will add it.

ceskyDJ commented 1 month ago

Oh, I forgot to mention that I tried to restart the Docker compose stack running Viesti reports, but the issue still exists. I tried the restart (docker compose restart) between 12:00 and 13:00. I expected the cron job at 13:00 would end up fine, but according to the error messages, it's still the same.

antedebaas commented 1 month ago

Yeah that implementation needs work. I’m already reworked it but it’s not ready for release yet. For now you can run the command php /var/www/html/bin/console app:removemaillock in the docker container to release the mail lock so processing continues again

ceskyDJ commented 1 month ago

For now you can run the command php /var/www/html/bin/console app:removemaillock in the docker container to release the mail lock so processing continues again

It helped, thanks! I have a few success messages in the log.

antedebaas commented 1 month ago

I released a new version today with quite a few improvements. one of them being better error handling when the command fails. You might want to update to the latest version.

ceskyDJ commented 1 month ago

Thanks a lot! As I have noticed in a notification, Watchtower has already done it. I'm looking forward to the changes in UI as you promised in the release log 😀!

antedebaas commented 1 month ago

When it’s updated you should immediately see the new webui

ceskyDJ commented 1 month ago

I took a look when I was on my way to the faculty. It looks pretty good but has its issues. I'll try to report at least some of them when I have a little free time for that.

antedebaas commented 1 month ago

Sure. Please do