antedebaas / DMARC-SMTPTLS-Reports

DMARC & SMTP-TLS Reports processor and visualizer
https://hub.docker.com/repository/docker/antedebaas/dmarc-reports/general
GNU General Public License v2.0
68 stars 15 forks source link

Docker compose fails to start. #98

Closed deanfourie1 closed 3 weeks ago

deanfourie1 commented 1 month ago

The error.

db-1   | 2024-05-28 04:03:09+00:00 [Note] [Entrypoint]: Entrypoint script for MariaDB Server 1:11.3.2+maria~ubu2204 started.
db-1   | 2024-05-28 04:03:09+00:00 [Warn] [Entrypoint]: /sys/fs/cgroup///memory.pressure not writable, functionality unavailable to MariaDB
db-1   | 2024-05-28 04:03:09+00:00 [Note] [Entrypoint]: Switching to dedicated user 'mysql'
db-1   | 2024-05-28 04:03:09+00:00 [Note] [Entrypoint]: Entrypoint script for MariaDB Server 1:11.3.2+maria~ubu2204 started.
db-1   | 2024-05-28 04:03:09+00:00 [Note] [Entrypoint]: Initializing database files
db-1   | 2024-05-28  4:03:09 0 [Warning] mariadbd: io_uring_queue_init() failed with errno 1
db-1   | 2024-05-28  4:03:09 0 [Warning] InnoDB: liburing disabled: falling back to innodb_use_native_aio=OFF
db-1   | 2024-05-28  4:03:09 0 [ERROR] InnoDB: File ./ib_logfile0 was not found
db-1   | 2024-05-28  4:03:09 0 [ERROR] InnoDB: Plugin initialization aborted with error Generic error
db-1   | 2024-05-28  4:03:09 0 [ERROR] Plugin 'InnoDB' registration as a STORAGE ENGINE failed.
db-1   | 2024-05-28  4:03:09 0 [ERROR] Unknown/unsupported storage engine: InnoDB
db-1   | 2024-05-28  4:03:09 0 [ERROR] Aborting
db-1   | 
db-1   | Installation of system tables failed!  Examine the logs in
db-1   | /var/lib/mysql/ for more information.
db-1   | 
db-1   | The problem could be conflicting information in an external
db-1   | my.cnf files. You can ignore these by doing:
db-1   | 
db-1   |     shell> /usr/bin/mariadb-install-db --defaults-file=~/.my.cnf
db-1   | 
db-1   | You can also try to start the mariadbd daemon with:
db-1   | 
db-1   |     shell> /usr/sbin/mariadbd --skip-grant-tables --general-log &
db-1   | 
db-1   | and use the command line tool /usr/bin/mariadb
db-1   | to connect to the mysql database and look at the grant tables:
db-1   | 
db-1   |     shell> /usr/bin/mariadb -u root mysql
db-1   |     MariaDB> show tables;
db-1   | 
db-1   | Try '/usr/sbin/mariadbd --help' if you have problems with paths.  Using
db-1   | --general-log gives you a log in /var/lib/mysql/ that may be helpful.
db-1   | 
db-1   | The latest information about mariadb-install-db is available at
db-1   | https://mariadb.com/kb/en/installing-system-tables-mysql_install_db
db-1   | You can find the latest source at https://downloads.mariadb.org and
db-1   | the maria-discuss email list at https://launchpad.net/~maria-discuss
db-1   | 
db-1   | Please check all of the above before submitting a bug report
db-1   | at https://mariadb.org/jira
db-1   | 
db-1   | 2024-05-28 04:04:09+00:00 [Note] [Entrypoint]: Entrypoint script for MariaDB Server 1:11.3.2+maria~ubu2204 started.
db-1   | 2024-05-28 04:04:10+00:00 [Warn] [Entrypoint]: /sys/fs/cgroup///memory.pressure not writable, functionality unavailable to MariaDB
db-1   | 2024-05-28 04:04:10+00:00 [Note] [Entrypoint]: Switching to dedicated user 'mysql'
db-1   | 2024-05-28 04:04:10+00:00 [Note] [Entrypoint]: Entrypoint script for MariaDB Server 1:11.3.2+maria~ubu2204 started.
db-1   | 2024-05-28 04:04:10+00:00 [Note] [Entrypoint]: Initializing database files
db-1   | 2024-05-28  4:04:10 0 [Warning] mariadbd: io_uring_queue_init() failed with errno 1
db-1   | 2024-05-28  4:04:10 0 [Warning] InnoDB: liburing disabled: falling back to innodb_use_native_aio=OFF
db-1   | 2024-05-28  4:04:10 0 [ERROR] InnoDB: File ./ib_logfile0 was not found
db-1   | 2024-05-28  4:04:10 0 [ERROR] InnoDB: Plugin initialization aborted with error Generic error
db-1   | 2024-05-28  4:04:10 0 [ERROR] Plugin 'InnoDB' registration as a STORAGE ENGINE failed.
db-1   | 2024-05-28  4:04:10 0 [ERROR] Unknown/unsupported storage engine: InnoDB
db-1   | 2024-05-28  4:04:10 0 [ERROR] Aborting
db-1   | 
db-1   | Installation of system tables failed!  Examine the logs in
db-1   | /var/lib/mysql/ for more information.
db-1   | 
db-1   | The problem could be conflicting information in an external
db-1   | my.cnf files. You can ignore these by doing:
db-1   | 
db-1   |     shell> /usr/bin/mariadb-install-db --defaults-file=~/.my.cnf
db-1   | 
db-1   | You can also try to start the mariadbd daemon with:
db-1   | 
db-1   |     shell> /usr/sbin/mariadbd --skip-grant-tables --general-log &
db-1   | 
db-1   | and use the command line tool /usr/bin/mariadb
db-1   | to connect to the mysql database and look at the grant tables:
db-1   | 
db-1   |     shell> /usr/bin/mariadb -u root mysql
db-1   |     MariaDB> show tables;
db-1   | 
db-1   | Try '/usr/sbin/mariadbd --help' if you have problems with paths.  Using
db-1   | --general-log gives you a log in /var/lib/mysql/ that may be helpful.
db-1   | 
db-1   | The latest information about mariadb-install-db is available at
db-1   | https://mariadb.com/kb/en/installing-system-tables-mysql_install_db
db-1   | You can find the latest source at https://downloads.mariadb.org and
db-1   | the maria-discuss email list at https://launchpad.net/~maria-discuss
db-1   | 
db-1   | Please check all of the above before submitting a bug report
db-1   | at https://mariadb.org/jira
db-1   | 
db-1   | 2024-05-28 04:05:10+00:00 [Note] [Entrypoint]: Entrypoint script for MariaDB Server 1:11.3.2+maria~ubu2204 started.
db-1   | 2024-05-28 04:05:10+00:00 [Warn] [Entrypoint]: /sys/fs/cgroup///memory.pressure not writable, functionality unavailable to MariaDB
db-1   | 2024-05-28 04:05:10+00:00 [Note] [Entrypoint]: Switching to dedicated user 'mysql'
db-1   | 2024-05-28 04:05:10+00:00 [Note] [Entrypoint]: Entrypoint script for MariaDB Server 1:11.3.2+maria~ubu2204 started.
db-1   | 2024-05-28 04:05:10+00:00 [Note] [Entrypoint]: Initializing database files
db-1   | 2024-05-28  4:05:11 0 [Warning] mariadbd: io_uring_queue_init() failed with errno 1
db-1   | 2024-05-28  4:05:11 0 [Warning] InnoDB: liburing disabled: falling back to innodb_use_native_aio=OFF
db-1   | 2024-05-28  4:05:11 0 [ERROR] InnoDB: File ./ib_logfile0 was not found
db-1   | 2024-05-28  4:05:11 0 [ERROR] InnoDB: Plugin initialization aborted with error Generic error
db-1   | 2024-05-28  4:05:11 0 [ERROR] Plugin 'InnoDB' registration as a STORAGE ENGINE failed.
db-1   | 2024-05-28  4:05:11 0 [ERROR] Unknown/unsupported storage engine: InnoDB
db-1   | 2024-05-28  4:05:11 0 [ERROR] Aborting
db-1   | 
db-1   | Installation of system tables failed!  Examine the logs in
db-1   | /var/lib/mysql/ for more information.
db-1   | 
db-1   | The problem could be conflicting information in an external
db-1   | my.cnf files. You can ignore these by doing:
db-1   | 
db-1   |     shell> /usr/bin/mariadb-install-db --defaults-file=~/.my.cnf
db-1   | 
db-1   | You can also try to start the mariadbd daemon with:
db-1   | 
db-1   |     shell> /usr/sbin/mariadbd --skip-grant-tables --general-log &
db-1   | 
db-1   | and use the command line tool /usr/bin/mariadb
db-1   | to connect to the mysql database and look at the grant tables:
db-1   | 
db-1   |     shell> /usr/bin/mariadb -u root mysql
db-1   |     MariaDB> show tables;
db-1   | 
db-1   | Try '/usr/sbin/mariadbd --help' if you have problems with paths.  Using
db-1   | --general-log gives you a log in /var/lib/mysql/ that may be helpful.
db-1   | 
db-1   | The latest information about mariadb-install-db is available at
db-1   | https://mariadb.com/kb/en/installing-system-tables-mysql_install_db
db-1   | You can find the latest source at https://downloads.mariadb.org and
db-1   | the maria-discuss email list at https://launchpad.net/~maria-discuss
db-1   | 
db-1   | Please check all of the above before submitting a bug report
db-1   | at https://mariadb.org/jira
db-1   | 
db-1   | 2024-05-28 04:06:11+00:00 [Note] [Entrypoint]: Entrypoint script for MariaDB Server 1:11.3.2+maria~ubu2204 started.
db-1   | 2024-05-28 04:06:11+00:00 [Warn] [Entrypoint]: /sys/fs/cgroup///memory.pressure not writable, functionality unavailable to MariaDB
db-1   | 2024-05-28 04:06:11+00:00 [Note] [Entrypoint]: Switching to dedicated user 'mysql'
db-1   | 2024-05-28 04:06:11+00:00 [Note] [Entrypoint]: Entrypoint script for MariaDB Server 1:11.3.2+maria~ubu2204 started.
db-1   | 2024-05-28 04:06:11+00:00 [Note] [Entrypoint]: Initializing database files
db-1   | 2024-05-28  4:06:11 0 [Warning] mariadbd: io_uring_queue_init() failed with errno 1
db-1   | 2024-05-28  4:06:11 0 [Warning] InnoDB: liburing disabled: falling back to innodb_use_native_aio=OFF
db-1   | 2024-05-28  4:06:11 0 [ERROR] InnoDB: File ./ib_logfile0 was not found
db-1   | 2024-05-28  4:06:11 0 [ERROR] InnoDB: Plugin initialization aborted with error Generic error
db-1   | 2024-05-28  4:06:11 0 [ERROR] Plugin 'InnoDB' registration as a STORAGE ENGINE failed.
db-1   | 2024-05-28  4:06:11 0 [ERROR] Unknown/unsupported storage engine: InnoDB
db-1   | 2024-05-28  4:06:11 0 [ERROR] Aborting
db-1   | 
db-1   | Installation of system tables failed!  Examine the logs in
db-1   | /var/lib/mysql/ for more information.
db-1   | 
db-1   | The problem could be conflicting information in an external
db-1   | my.cnf files. You can ignore these by doing:
db-1   | 
db-1   |     shell> /usr/bin/mariadb-install-db --defaults-file=~/.my.cnf
db-1   | 
db-1   | You can also try to start the mariadbd daemon with:
db-1   | 
db-1   |     shell> /usr/sbin/mariadbd --skip-grant-tables --general-log &
db-1   | 
db-1   | and use the command line tool /usr/bin/mariadb
db-1   | to connect to the mysql database and look at the grant tables:
db-1   | 
db-1   |     shell> /usr/bin/mariadb -u root mysql
db-1   |     MariaDB> show tables;
db-1   | 
db-1   | Try '/usr/sbin/mariadbd --help' if you have problems with paths.  Using
db-1   | --general-log gives you a log in /var/lib/mysql/ that may be helpful.
db-1   | 
db-1   | The latest information about mariadb-install-db is available at
db-1   | https://mariadb.com/kb/en/installing-system-tables-mysql_install_db
db-1   | You can find the latest source at https://downloads.mariadb.org and
db-1   | the maria-discuss email list at https://launchpad.net/~maria-discuss
db-1   | 
db-1   | Please check all of the above before submitting a bug report
db-1   | at https://mariadb.org/jira
db-1   | 
db-1   | 2024-05-28 04:07:12+00:00 [Note] [Entrypoint]: Entrypoint script for MariaDB Server 1:11.3.2+maria~ubu2204 started.
db-1   | 2024-05-28 04:07:12+00:00 [Warn] [Entrypoint]: /sys/fs/cgroup///memory.pressure not writable, functionality unavailable to MariaDB
db-1   | 2024-05-28 04:07:12+00:00 [Note] [Entrypoint]: Switching to dedicated user 'mysql'
db-1   | 2024-05-28 04:07:12+00:00 [Note] [Entrypoint]: Entrypoint script for MariaDB Server 1:11.3.2+maria~ubu2204 started.
db-1   | 2024-05-28 04:07:12+00:00 [Note] [Entrypoint]: Initializing database files
db-1   | 2024-05-28  4:07:12 0 [Warning] mariadbd: io_uring_queue_init() failed with errno 1
db-1   | 2024-05-28  4:07:12 0 [Warning] InnoDB: liburing disabled: falling back to innodb_use_native_aio=OFF
db-1   | 2024-05-28  4:07:12 0 [ERROR] InnoDB: File ./ib_logfile0 was not found
db-1   | 2024-05-28  4:07:12 0 [ERROR] InnoDB: Plugin initialization aborted with error Generic error
db-1   | 2024-05-28  4:07:12 0 [ERROR] Plugin 'InnoDB' registration as a STORAGE ENGINE failed.
db-1   | 2024-05-28  4:07:12 0 [ERROR] Unknown/unsupported storage engine: InnoDB
db-1   | 2024-05-28  4:07:12 0 [ERROR] Aborting
db-1   | 
db-1   | Installation of system tables failed!  Examine the logs in
db-1   | /var/lib/mysql/ for more information.
db-1   | 
db-1   | The problem could be conflicting information in an external
db-1   | my.cnf files. You can ignore these by doing:
db-1   | 
db-1   |     shell> /usr/bin/mariadb-install-db --defaults-file=~/.my.cnf
db-1   | 
db-1   | You can also try to start the mariadbd daemon with:
db-1   | 
db-1   |     shell> /usr/sbin/mariadbd --skip-grant-tables --general-log &
db-1   | 
db-1   | and use the command line tool /usr/bin/mariadb
db-1   | to connect to the mysql database and look at the grant tables:
db-1   | 
db-1   |     shell> /usr/bin/mariadb -u root mysql
db-1   |     MariaDB> show tables;
db-1   | 
db-1   | Try '/usr/sbin/mariadbd --help' if you have problems with paths.  Using
db-1   | --general-log gives you a log in /var/lib/mysql/ that may be helpful.
db-1   | 
db-1   | The latest information about mariadb-install-db is available at
db-1   | https://mariadb.com/kb/en/installing-system-tables-mysql_install_db
db-1   | You can find the latest source at https://downloads.mariadb.org and
db-1   | the maria-discuss email list at https://launchpad.net/~maria-discuss
db-1   | 
db-1   | Please check all of the above before submitting a bug report
db-1   | at https://mariadb.org/jira
db-1   | 
db-1   | 2024-05-28 04:08:12+00:00 [Note] [Entrypoint]: Entrypoint script for MariaDB Server 1:11.3.2+maria~ubu2204 started.
db-1   | 2024-05-28 04:08:13+00:00 [Warn] [Entrypoint]: /sys/fs/cgroup///memory.pressure not writable, functionality unavailable to MariaDB
db-1   | 2024-05-28 04:08:13+00:00 [Note] [Entrypoint]: Switching to dedicated user 'mysql'
db-1   | 2024-05-28 04:08:13+00:00 [Note] [Entrypoint]: Entrypoint script for MariaDB Server 1:11.3.2+maria~ubu2204 started.
db-1   | 2024-05-28 04:08:13+00:00 [Note] [Entrypoint]: Initializing database files
db-1   | 2024-05-28  4:08:13 0 [Warning] mariadbd: io_uring_queue_init() failed with errno 1
db-1   | 2024-05-28  4:08:13 0 [Warning] InnoDB: liburing disabled: falling back to innodb_use_native_aio=OFF
db-1   | 2024-05-28  4:08:13 0 [ERROR] InnoDB: File ./ib_logfile0 was not found
db-1   | 2024-05-28  4:08:13 0 [ERROR] InnoDB: Plugin initialization aborted with error Generic error
db-1   | 2024-05-28  4:08:13 0 [ERROR] Plugin 'InnoDB' registration as a STORAGE ENGINE failed.
db-1   | 2024-05-28  4:08:13 0 [ERROR] Unknown/unsupported storage engine: InnoDB
db-1   | 2024-05-28  4:08:13 0 [ERROR] Aborting
db-1   | 
db-1   | Installation of system tables failed!  Examine the logs in
db-1   | /var/lib/mysql/ for more information.
db-1   | 
db-1   | The problem could be conflicting information in an external
db-1   | my.cnf files. You can ignore these by doing:
db-1   | 
db-1   |     shell> /usr/bin/mariadb-install-db --defaults-file=~/.my.cnf
db-1   | 
db-1   | You can also try to start the mariadbd daemon with:
db-1   | 
db-1   |     shell> /usr/sbin/mariadbd --skip-grant-tables --general-log &
db-1   | 
db-1   | and use the command line tool /usr/bin/mariadb
db-1   | to connect to the mysql database and look at the grant tables:
db-1   | 
db-1   |     shell> /usr/bin/mariadb -u root mysql
db-1   |     MariaDB> show tables;
db-1   | 
db-1   | Try '/usr/sbin/mariadbd --help' if you have problems with paths.  Using
db-1   | --general-log gives you a log in /var/lib/mysql/ that may be helpful.
db-1   | 
db-1   | The latest information about mariadb-install-db is available at
db-1   | https://mariadb.com/kb/en/installing-system-tables-mysql_install_db
db-1   | You can find the latest source at https://downloads.mariadb.org and
db-1   | the maria-discuss email list at https://launchpad.net/~maria-discuss
db-1   | 
db-1   | Please check all of the above before submitting a bug report
db-1   | at https://mariadb.org/jira
db-1   | 
dependency failed to start: container dmarc-smtptls-reports-db-1 is unhealthy

My compose,

version: "2"
services:
  db:
    image: mariadb:latest
    environment:
      MYSQL_DATABASE: dmarc
      MYSQL_USER: user
      MYSQL_PASSWORD: pa$$word
      MYSQL_ROOT_PASSWORD: pa$$word1
    ports:
      - 3306
    restart: unless-stopped
    healthcheck:
      test: [ "CMD", "healthcheck.sh", "--su-mysql", "--connect", "--innodb_initialized" ]
      interval: 10s
      timeout: 5s
      retries: 6
  web:
    image: antedebaas/dmarc-reports:latest
    ports:
        - 0.0.0.0:8000:8080
    environment:
      TZ: Europe/Amsterdam
      DATABASE_TYPE: mysql
      DATABASE_HOST: db
      DATABASE_PORT: 3306
      DATABASE_NAME: dmarc
      DATABASE_USER: user
      DATABASE_PASSWORD: pa$$word
      MAILER_HOST: 
      MAILER_SMTPPORT: 587
      MAILER_IMAPPORT: 993
      MAILER_USER: 
      MAILER_PASSWORD: 
      DELETE_PROCESSED_MAILS: false
      ENABLE_REGISTRATION: false
      MAILCHECK_SCHEDULE: "0 * * * *"
    restart: unless-stopped
    depends_on:
      db:
        condition: service_healthy
antedebaas commented 1 month ago

I can’t really help you with this one. The database image fails to start. But don’t develop that one. It should work however. Try checking for special characters in the username/password etc. the image itself should work so it must be something with the input

deanfourie1 commented 1 month ago

Thanks, I sorted this by removing all previously created containers and starting again, not sure why it would not overwrite.

However, now it cannot login to my mail server.

I have a slightly complex password containing characters such as !@#$%^&*().

I have tried wrapping the password like

'password' and "password"

however, still it cannot login, just fails authentication.

web-1 | 2024/05/29 14:42:31 [error] 18#18: *1 FastCGI sent in stderr: "PHP message: [critical] Error thrown while running command "app:getreportsfrommailbox". Message: "["Retrying PLAIN authentication after [AUTHENTICATIONFAILED] Authentication failed.","Retrying PLAIN authentication after [AUTHENTICATIONFAILED] Authentication failed.","Can not authenticate to IMAP server: [AUTHENTICATIONFAILED] Authentication failed."]"" while reading response header from upstream, client: xxx server: _, request: "GET /reports/checkmailnow HTTP/1.1", upstream: "fastcgi://unix:/run/php-fpm.sock:",

deanfourie1 commented 1 month ago

Im sorry, but this tool simply does not work.

antedebaas commented 4 weeks ago

@tobsowo is this similar to the problem you were having?

tobsowo commented 4 weeks ago

No, it's not. I'm unable to retrieve emails so that it can be processed and see the results.

antedebaas commented 4 weeks ago

No, it's not. I'm unable to retrieve emails so that it can be processed and see the results.

could you post the error messages again for me? preferably from the docker output when running the app:getreportsfrommailbox command

just to make sure

tobsowo commented 4 weeks ago

@antedebaas see here https://github.com/antedebaas/DMARC-SMTPTLS-Reports/issues/51#issuecomment-1986469308

deanfourie1 commented 4 weeks ago

Just pulled the latest version, got slapped with a database updates setup screen,

But when I click update database schema, nothing happens? Is this a bug?

Also, is there a way to run the migrations manually?

Thanks

antedebaas commented 3 weeks ago

Just pulled the latest version, got slapped with a database updates setup screen,

But when I click update database schema, nothing happens? Is this a bug?

Also, is there a way to run the migrations manually?

Thanks

The docker version should auto run the migrations on startup. Could you check if you have set the DATABASE_TYPE variable to your database type?

deanfourie1 commented 3 weeks ago

The docker version should auto run the migrations on startup. Could you check if you have set the DATABASE_TYPE variable to your database type?

Yes the type is set to mysql.

I've restarted the container several time, I cannot get past this screen, this was after doing a docker pull for the latest tag.

deanfourie1 commented 3 weeks ago

I also completely deleted the folder, backed up my docker-compose.yml and re cloned the repo, copy docker-compose back and same result.

deanfourie1 commented 3 weeks ago

Ah, here we go

web-1  | [critical] Error thrown while running command "doctrine:migrations:migrate --no-interaction". Message: "An exception occurred in the driver: SQLSTATE[HY000] [1045] Access denied for user 'user'@'172.21.0.3' (using password: YES)"
web-1  | 
web-1  | In ExceptionConverter.php line 80:
web-1  |                                                                                
web-1  |   An exception occurred in the driver: SQLSTATE[HY000] [1045] Access denied f  
web-1  |   or user 'user'@'172.21.0.3' (using password: YES)                            
web-1  |                                                                                
web-1  | 
web-1  | In Exception.php line 28:
web-1  |                                                                                
web-1  |   SQLSTATE[HY000] [1045] Access denied for user 'user'@'172.21.0.3' (using pa  
web-1  |   ssword: YES)                                                                 
web-1  |                                                                                
web-1  | 
web-1  | In Driver.php line 33:
web-1  |                                                                                
web-1  |   SQLSTATE[HY000] [1045] Access denied for user 'user'@'172.21.0.3' (using pa  
web-1  |   ssword: YES) 
deanfourie1 commented 3 weeks ago

No matter what I do, i still get this error

db-1   | 2024-06-05 11:17:46 5 [Warning] Access denied for user 'databaseuser'@'172.21.0.3' (using password: YES)
web-1  | [critical] Error thrown while running command "doctrine:migrations:migrate --no-interaction". Message: "An exception occurred in the driver: SQLSTATE[HY000] [1045] Access denied for user 'databaseuser'@'172.21.0.3' (using password: YES)"
web-1  | 
web-1  | In ExceptionConverter.php line 80:
web-1  |                                                                                
web-1  |   An exception occurred in the driver: SQLSTATE[HY000] [1045] Access denied f  
web-1  |   or user 'databaseuser'@'172.21.0.3' (using password: YES)                    
web-1  |                                                                                
web-1  | 
web-1  | In Exception.php line 28:
web-1  |                                                                                
web-1  |   SQLSTATE[HY000] [1045] Access denied for user 'databaseuser'@'172.21.0.3' (  
web-1  |   using password: YES)                                                         
web-1  |                                                                                
web-1  | 
web-1  | In Driver.php line 33:
web-1  |                                                                                
web-1  |   SQLSTATE[HY000] [1045] Access denied for user 'databaseuser'@'172.21.0.3' (  
web-1  |   using password: YES) 

Docker compose as below

name: dmarc-smtptls-reports version: "2" services: db: image: mariadb:latest environment: MYSQL_DATABASE: dmarc MYSQL_USER: dbuser MYSQL_PASSWORD: password MYSQL_ROOT_PASSWORD: password1 ports:

antedebaas commented 3 weeks ago

ah, the connection details for the database are incorrect. The database returns an login failure

deanfourie1 commented 3 weeks ago

Which connection details?

antedebaas commented 3 weeks ago

Database connection details.

deanfourie1 commented 3 weeks ago

Hmm ok,

Changed DATABASE_HOST: localhost

web-1  | Generate .env.local file
web-1  | Set cron schedule
web-1  | 2024-06-05 13:41:23,525 INFO success: containerstartup entered RUNNING state, process has stayed up for > than 0 seconds (startsecs)
web-1  | Cron schedule match found, following input
web-1  | Setting timezone to Europe/Amsterdam
web-1  | Run migrations
web-1  | [critical] Error thrown while running command "doctrine:migrations:migrate --no-interaction". Message: "An exception occurred in the driver: SQLSTATE[HY000] [2002] No such file or directory"
web-1  | 
web-1  | In ExceptionConverter.php line 80:
web-1  |                                                                                
web-1  |   An exception occurred in the driver: SQLSTATE[HY000] [2002] No such file or  
web-1  |    directory                                                                   
web-1  |                                                                                
web-1  | 
web-1  | In Exception.php line 28:
web-1  |                                                     
web-1  |   SQLSTATE[HY000] [2002] No such file or directory  
web-1  |                                                     
web-1  | 
web-1  | In Driver.php line 33:
web-1  |                                                     
web-1  |   SQLSTATE[HY000] [2002] No such file or directory 
antedebaas commented 3 weeks ago

i dont think localhost will ever work as a database host, dont you think?

deanfourie1 commented 3 weeks ago

Sorry im not sure, Im just using your provided docker compose file.

In your stock docker compose file, it is listed at "db" which you stated in incorrect.

antedebaas commented 3 weeks ago

In your stock docker compose file, it is listed at "db" which you stated in incorrect.

hostname: db refers to the database container name in the stack

services: db:

this is a perfectly normal way of defining relations between containers in a docker-compose It tells docker where to point to as a host so it can do the proper mapping

deanfourie1 commented 3 weeks ago

haha, but the point is it is not working...

deanfourie1 commented 3 weeks ago

With your included standard docker compose file,

Attaching to db-1, web-1
web-1  | 2024-06-10 10:53:21,186 INFO Set uid to user 0 succeeded
web-1  | 2024-06-10 10:53:21,187 INFO supervisord started with pid 1
web-1  | 2024-06-10 10:53:22,189 INFO spawned: 'containerstartup' with pid 8
web-1  | 2024-06-10 10:53:22,191 INFO spawned: 'cron' with pid 9
web-1  | 2024-06-10 10:53:22,192 INFO spawned: 'nginx' with pid 10
web-1  | 2024-06-10 10:53:22,194 INFO spawned: 'php-fpm' with pid 15
web-1  | Generate .env.local file
web-1  | Set cron schedule
web-1  | 2024-06-10 10:53:22,195 INFO success: containerstartup entered RUNNING state, process has stayed up for > than 0 seconds (startsecs)
web-1  | Cron schedule match found, following input
web-1  | Setting timezone to Europe/Amsterdam
web-1  | Run migrations
db-1   | 2024-06-10  8:53:22 7 [Warning] Access denied for user 'dmarc'@'172.24.0.3' (using password: YES)
web-1  | [critical] Error thrown while running command "doctrine:migrations:migrate --no-interaction". Message: "An exception occurred in the driver: SQLSTATE[HY000] [1045] Access denied for user 'dmarc'@'172.24.0.3' (using password: YES)"
web-1  | 
web-1  | In ExceptionConverter.php line 80:
web-1  |                                                                                
web-1  |   An exception occurred in the driver: SQLSTATE[HY000] [1045] Access denied f  
web-1  |   or user 'dmarc'@'172.24.0.3' (using password: YES)                           
web-1  |                                                                                
web-1  | 
web-1  | In Exception.php line 28:
web-1  |                                                                                
web-1  |   SQLSTATE[HY000] [1045] Access denied for user 'dmarc'@'172.24.0.3' (using p  
web-1  |   assword: YES)                                                                
web-1  |                                                                                
web-1  | 
web-1  | In Driver.php line 33:
web-1  |                                                                                
web-1  |   SQLSTATE[HY000] [1045] Access denied for user 'dmarc'@'172.24.0.3' (using p  
web-1  |   assword: YES)                                                                
web-1  |                                                                                
web-1  | 
web-1  | doctrine:migrations:migrate [--write-sql [WRITE-SQL]] [--dry-run] [--query-time] [--allow-no-migration] [--all-or-nothing [ALL-OR-NOTHING]] [--configuration CONFIGURATION] [--em EM] [--conn CONN] [--] [<version>]
web-1  | 
web-1  | 2024-06-10 10:53:22,295 WARN exited: containerstartup (exit status 255; not expected)
web-1  | 2024-06-10 10:53:23,296 INFO success: cron entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
web-1  | 2024-06-10 10:53:23,296 INFO success: nginx entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
web-1  | 2024-06-10 10:53:23,296 INFO success: php-fpm entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
web-1  | [10-Jun-2024 10:53:25] NOTICE: fpm is running, pid 24
web-1  | [10-Jun-2024 10:53:25] NOTICE: ready to handle connections
^CGracefully stopping... (press Ctrl+C again to force)
deanfourie1 commented 3 weeks ago

My docker-compose.yml

name: dmarc-smtptls-reports
version: "2"
services:
  db:
    image: mariadb:latest
    environment:
      MYSQL_DATABASE: dmarc
      MYSQL_USER: dmarc
      MYSQL_PASSWORD: Password123
      MYSQL_ROOT_PASSWORD: Password1
    ports:
      - 3306
    restart: unless-stopped
    healthcheck:
      test: [ "CMD", "healthcheck.sh", "--su-mysql", "--connect", "--innodb_initialized" ]
      interval: 10s
      timeout: 5s
      retries: 6
  web:
    image: antedebaas/dmarc-reports:latest
    ports:
        - 0.0.0.0:8000:8080
    environment:
      TZ: Europe/Amsterdam
      DATABASE_TYPE: mysql
      DATABASE_HOST: db
      DATABASE_PORT: 3306
      DATABASE_NAME: dmarc
      DATABASE_USER: dmarc
      DATABASE_PASSWORD: Password123
      MAILER_HOST: 
      MAILER_SMTPPORT: 587
      MAILER_IMAPPORT: 993
      MAILER_USER: 
      MAILER_PASSWORD: 
      DELETE_PROCESSED_MAILS: false
      ENABLE_REGISTRATION: false
      MAILCHECK_SCHEDULE: "0 * * * *"
    restart: unless-stopped
    depends_on:
      db:
        condition: service_healthy
antedebaas commented 3 weeks ago

The problem is a database access problem. Not a docker compose problem. It’s connecting just fine. Your database just does not allow access

deanfourie1 commented 3 weeks ago

I must say, I have a reputation for not being able to get docker containers working

Ill do some more docker practice!

antedebaas commented 3 weeks ago

Closing this for now. Feel free to reopen or open a new issue when you need one.