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
83 stars 16 forks source link

DB migration failed in 1.16.0 #125

Closed kimdre closed 4 months ago

kimdre commented 4 months ago

Issue Template

Describe the bug After upgrading to 1.16.0 the database migration failed and the frontend returns a 500 error.

Are you using the Docker image?

Database used

Error Messages

2024-07-11 19:30:05,361 INFO Set uid to user 0 succeeded
2024-07-11 19:30:05,365 INFO supervisord started with pid 1
2024-07-11 19:30:06,368 INFO spawned: 'containerstartup' with pid 7
2024-07-11 19:30:06,371 INFO spawned: 'cron' with pid 8
2024-07-11 19:30:06,382 INFO spawned: 'nginx' with pid 10
2024-07-11 19:30:06,385 INFO spawned: 'php-fpm' with pid 12
Generate .env.local file
Setting timezone to Europe/Berlin
2024-07-11 19:30:06,395 INFO success: containerstartup entered RUNNING state, process has stayed up for > than 0 seconds (startsecs)
Check if attachments directory exists
Attachments directory does not exist, creating it.
Set cron schedule
Cron schedule match found, following input schedule
Run migrations
 [WARNING] You have 12 previously executed migrations in the database that are  
           not registered migrations.                                           
 >> 2024-02-09 17:57:30 (DoctrineMigrations\Version20230809184012)
 >> 2024-02-09 17:57:30 (DoctrineMigrations\Version20230919194011)
 >> 2024-02-09 17:57:30 (DoctrineMigrations\Version20230928180433)
 >> 2024-02-09 17:57:30 (DoctrineMigrations\Version20230930193129)
 >> 2024-02-09 17:57:30 (DoctrineMigrations\Version20231014141450)
 >> 2024-02-09 17:57:30 (DoctrineMigrations\Version20240124150025)
 >> 2024-02-09 17:57:30 (DoctrineMigrations\Version20240124174018)
 >> 2024-02-15 04:21:17 (DoctrineMigrations\Version20240214121100)
 >> 2024-06-15 12:51:38 (DoctrineMigrations\Version20240302153203)
 >> 2024-06-15 12:51:38 (DoctrineMigrations\Version20240304200130)
 >> 2024-06-15 12:51:38 (DoctrineMigrations\Version20240317202800)
 >> 2024-06-17 22:32:37 (DoctrineMigrations\Version20240617165805)
[notice] Migrating up to DoctrineMigrations\Version20240619195153
[error] Migration DoctrineMigrations\Version20240214134308 failed during Execution. Error: "An exception occurred while executing a query: SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'NOT NULL, report_id INTEGER NOT NULL, source_ip VARCHAR(255) NOT NULL, count ...' at line 1"
[critical] Error thrown while running command "doctrine:migrations:migrate --no-interaction". Message: "An exception occurred while executing a query: SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'NOT NULL, report_id INTEGER NOT NULL, source_ip VARCHAR(255) NOT NULL, count ...' at line 1"
2024-07-11 19:30:06,960 WARN exited: containerstartup (exit status 255; not expected)

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

  1. Update to 1.16.0
  2. See logs

Screenshots image

antedebaas commented 4 months ago

i could replicate the problem. after a second restart of the container it resolved itself.

kimdre commented 4 months ago

Not for me. After login I still get the error and also another one:

NOTICE: PHP message: [critical] Uncaught Exception: An exception occurred while executing a query: SQLSTATE[42S22]: Column not found: 1054 Unknown column 't0.bimisvgfile' in 'field list'
antedebaas commented 4 months ago

Not for me. After login I still get the error and also another one:

guess i'll start digging :)

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

this is related as its the new fields that are supposed to be added by the migration

antedebaas commented 4 months ago

could you try and see if using antedebaas/dmarc-reports-testing:sha-c4c254b fixes it? there is no database/migrations in there just some code changes that i hope will work

kimdre commented 4 months ago

Yes this image works. :)

antedebaas commented 4 months ago

merged in 1.17.0