antedebaas / Viesti-Reports

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

GetReportsFromMailbox command was already running #115

Closed KGBist2000 closed 3 months ago

KGBist2000 commented 4 months ago

Issue Template

Describe the bug Auto- and manuel check of mailbox is failed with following error-messagen "GetReportsFromMailbox command was already running."

Version 1.15.2. is used. It worked some days ago, an now its not working anymore. mailbox is via iphone and imap reachable.

Are you using the Docker image?

Database used

Error Messages GetReportsFromMailbox command was already running

Steps to Reproduce Please provide detailed steps to reproduce the problem:

  1. Go to '...'
  2. Click on '....'
  3. Scroll down to '....'
  4. See error

Expected behavior read the mailbox

Screenshots Bildschirmfoto 2024-06-28 um 15 24 02

Environment (please complete the following information):

antedebaas commented 4 months ago

Any errors in the system log around the time of the time the first one failed and last one that succeeded ? Any flagged messages?

KGBist2000 commented 4 months ago

how can i check this ?

antedebaas commented 4 months ago

By looking in the logs and mailbox

KGBist2000 commented 4 months ago

docker logs: [ERROR] GetReportsFromMailbox command is already running. mailbox are no logs availible.

antedebaas commented 4 months ago

I need more detail than this.

there should be an “exception” somewhere in the logs.

meanwhile. You can run the following command to remove the lock.

php /var/www/html/bin/console app:removemaillock

KGBist2000 commented 4 months ago

what i done before is to trigger manuelly check of the mailbox. after that the issue startet. container restart, etc. did not solved the issue.

thank you, i removed the lock as you explained, now its working again and it is repared.

Bildschirmfoto 2024-06-30 um 17 47 03


after repair now i reproduced it again at 17:40, by using the manuell button please find the docker-logs:

### Docker-Logs: `172.22.0.1 - - [30/Jun/2024:17:37:26 +0200] "GET / HTTP/1.1" 200 4498 "https://dmarc.domain.de/reports/dmarc/report/36" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:126.0) Gecko/20100101 Firefox/126.0" "192.168.76.78" 0.478 0.478 . -

172.22.0.1 - - [30/Jun/2024:17:37:26 +0200] "GET /style.css HTTP/1.1" 200 345 "https://dmarc.domain.de/" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:126.0) Gecko/20100101 Firefox/126.0" "192.168.76.78" 0.000 - . -

NOTICE: PHP message: [error] Warning: mkdir(): Permission denied

NOTICE: PHP message: [critical] Error thrown while running command "app:getreportsfrommailbox". Message: "Cannot create the attachments directory "/var/www/html/var/imap/attachments"."

2024/06/30 17:40:04 [error] 17#17: *12122 FastCGI sent in stderr: "PHP message: [error] Warning: mkdir(): Permission denied; PHP message: [critical] Error thrown while running command "app:getreportsfrommailbox". Message: "Cannot create the attachments directory "/var/www/html/var/imap/attachments"."" while reading response header from upstream, client: 172.22.0.1, server: _, request: "GET /reports/checkmailnow HTTP/1.1", upstream: "fastcgi://unix:/run/php-fpm.sock:", host: "dmarc.domain.de", referrer: "https://dmarc.domain.de/"

172.22.0.1 - - [30/Jun/2024:17:40:04 +0200] "GET /reports/checkmailnow HTTP/1.1" 302 261 "https://dmarc.domain.de/" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:126.0) Gecko/20100101 Firefox/126.0" "192.168.76.78" 0.231 0.231 . -

172.22.0.1 - - [30/Jun/2024:17:40:05 +0200] "GET / HTTP/1.1" 200 4498 "https://dmarc.domain.de/" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:126.0) Gecko/20100101 Firefox/126.0" "192.168.76.78" 0.215 0.214 . -

172.22.0.1 - - [30/Jun/2024:17:40:07 +0200] "GET /reports HTTP/1.1" 200 2608 "https://dmarc.domain.de/" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:126.0) Gecko/20100101 Firefox/126.0" "192.168.76.78" 0.188 0.188 . -

172.22.0.1 - - [30/Jun/2024:17:40:08 +0200] "GET / HTTP/1.1" 200 4498 "https://dmarc.domain.de/reports" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:126.0) Gecko/20100101 Firefox/126.0" "192.168.76.78" 0.216 0.215 . -

172.22.0.1 - - [30/Jun/2024:17:40:11 +0200] "GET / HTTP/1.1" 200 4498 "https://dmarc.domain.de/reports" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:126.0) Gecko/20100101 Firefox/126.0" "192.168.76.78" 0.216 0.215 . -

172.22.0.1 - - [30/Jun/2024:17:40:17 +0200] "GET / HTTP/1.1" 200 4498 "https://dmarc.domain.de/reports" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:126.0) Gecko/20100101 Firefox/126.0" "192.168.76.78" 0.215 0.215 . -`

hope it is helpfull for you.

antedebaas commented 4 months ago

Thank you. This is helpful indeed!

antedebaas commented 4 months ago

could you post your docker compose file as well? seems like its unable to create a directory, but when i try the docker container it does work

KGBist2000 commented 4 months ago

name: dmarc-smtptls-reports version: "2" services: db: image: mariadb:latest environment: MYSQL_DATABASE: dmarc-smtptls-reports MYSQL_USER: dmarc_report MYSQL_PASSWORD: dbpassword MYSQL_ROOT_PASSWORD: dbrootpassword ports:

WebCodePoet commented 4 months ago

Hey, I have the same issue, I am using a non docker installation. The PHP Error log is empty. Is there away to enable a debug inside the WebApp to submit you an error report?

WebCodePoet commented 4 months ago

After running bin/console app:removemaillock, I get an error 500, than it loads, but than it shows the error again.

After that the log says:

WARNING: [pool] child 113741 said into stderr: "PHP message: [critical] Uncaught Error: Call to undefined method App\Response\GetReportsResponse::getDetails()"

and

Got error 'PHP message: [critical] Error thrown while running command "app:getreportsfrommailbox". Message: "Call to undefined method App\\Response\\GetReportsResponse::getDetails()"; PHP message: [critical] Uncaught Error: Call to undefined method App\\Response\\GetReportsResponse::getDetails()',

kimdre commented 4 months ago

I also have this issue. The only error shown in the container logs is

[ERROR] GetReportsFromMailbox command is already running.    

After running the unlock command it works again for now.

php /var/www/html/bin/console app:removemaillock
antedebaas commented 4 months ago

@kimdre a stale lock should indicate an php error somewhere in the logs. can you double check for me?

kimdre commented 4 months ago

This is the entire log of the container since I last updated it. https://gist.github.com/kimdre/85288f1b7b170988658425b8b81d56c1

antedebaas commented 4 months ago

and no flagged emails in the mailbox?

antedebaas commented 4 months ago

After running bin/console app:removemaillock, I get an error 500, than it loads, but than it shows the error again.

After that the log says:

WARNING: [pool] child 113741 said into stderr: "PHP message: [critical] Uncaught Error: Call to undefined method App\Response\GetReportsResponse::getDetails()"

and

Got error 'PHP message: [critical] Error thrown while running command "app:getreportsfrommailbox". Message: "Call to undefined method App\\Response\\GetReportsResponse::getDetails()"; PHP message: [critical] Uncaught Error: Call to undefined method App\\Response\\GetReportsResponse::getDetails()',

then there probably was an issue with an email, could you check for flagged messages in the mailbox?

kimdre commented 4 months ago

They were only processed after I removed the lock.

image

antedebaas commented 4 months ago

i just pushed v1.15.3 with a few fixes. this should prevent issues hopefully

KGBist2000 commented 4 months ago

i just pushed v1.15.3 with a few fixes. this should prevent issues hopefully

Really? You removed the manual button? Why? This is for me an imported feature for test- and debug purposes! :-(

antedebaas commented 4 months ago

It was never a fully working button and I’ve had to help people multiple times with the problems it produced. It was introduced to have a more frequent check but the cron is changeable now. You can always run the command from the command prompt (which is not as error prone as the button)

WebCodePoet commented 4 months ago

Hello @antedebaas, now I get the error

"PHP message: [critical] Uncaught Exception: An exception occurred while executing a query: SQLSTATE[42S22]: Column not found: 1054 Unknown column 't0.details' in 'field list'"

I had to run the migration by hand, now it seems to work.

KGBist2000 commented 4 months ago

Hello @antedebaas, now I get the error

"PHP message: [critical] Uncaught Exception: An exception occurred while executing a query: SQLSTATE[42S22]: Column not found: 1054 Unknown column 't0.details' in 'field list'"

I had to run the migration by hand, now it seems to work.

Hi, what do you mean migration by hand, which steps instead of pull new image are needed to update vfrom 1.15.2 -> 1.15.3

antedebaas commented 3 months ago

Hello @antedebaas, now I get the error

"PHP message: [critical] Uncaught Exception: An exception occurred while executing a query: SQLSTATE[42S22]: Column not found: 1054 Unknown column 't0.details' in 'field list'"

I had to run the migration by hand, now it seems to work. do you have a .env.local file? because if thats missing that would be the reason they were not run

Hello @antedebaas, now I get the error "PHP message: [critical] Uncaught Exception: An exception occurred while executing a query: SQLSTATE[42S22]: Column not found: 1054 Unknown column 't0.details' in 'field list'" I had to run the migration by hand, now it seems to work.

Hi, what do you mean migration by hand, which steps instead of pull new image are needed to update vfrom 1.15.2 -> 1.15.3

in the project root folder run php bin/console doctrine:migrations:migrate but they should run automatically

antedebaas commented 3 months ago

this has become an everything issue and i'm closing this i think the original issue should be solved now if you have any issues please open a new issue