danielbrendel / hortusfox-web

Self-hosted collaborative plant management and tracking system for plant enthusiasts
https://www.hortusfox.com
MIT License
674 stars 34 forks source link

`Access denied for user 'user'@'172.18.0.3'` Error #250

Closed qkevinto closed 4 months ago

qkevinto commented 4 months ago

Describe the bug Running into an issue that is seemingly identical to #193 except downgrading to mariadb 10 does not make any difference. Using default values in docker-compose.yml and trying to start up the server with docker compose up results in the application failing to start up due to authentication issues with the db:

db-1   | 2024-07-20 13:00:18 3 [Warning] Access denied for user 'user'@'172.18.0.3' (using password: YES)
app-1  | Waiting for database to be available... Attempt 2

To Reproduce Steps to reproduce the behavior:

  1. Pull latest from repository
  2. Run docker compose up in repository directory
  3. app fails to start due to authentication issue with db

Expected behavior app should be able to authenticate with db

Software:

Desktop (please complete the following information):

Additional context

[+] Running 3/3
 ✔ Network hortusfox-web_default  Creat...                                 0.1s 
 ✔ Container hortusfox-web-db-1   Create...                                0.1s 
 ✔ Container hortusfox-web-app-1  Creat...                                 0.1s 
Attaching to app-1, db-1
db-1   | 2024-07-20 13:09:19+00:00 [Note] [Entrypoint]: Entrypoint script for MariaDB Server 1:11.4.2+maria~ubu2404 started.
db-1   | 2024-07-20 13:09:20+00:00 [Warn] [Entrypoint]: /sys/fs/cgroup///memory.pressure not writable, functionality unavailable to MariaDB
db-1   | 2024-07-20 13:[  841.724395] IPv6: ADDRCONF(NETDEV_CHANGE): veth60df6ed: link becomes ready
09:20+00:00 [Note] [Entrypoint]: Switching to dedicated user 'mysql'
db-1   | 2024-07-20 13:09:20+00:00 [Note] [Entrypoint]: Entrypoint script for MariaDB Server 1:11.4.2+maria~ubu2404 started.
app-1  | Waiting for database to be available... Attempt 1
db-1   | 2024-07-20 13:09:20+00:00 [Note] [Entrypoint]: MariaDB upgrade not required
db-1   | 2024-07-20 13:09:20 0 [Note] Starting MariaDB 11.4.2-MariaDB-ubu2404 source revision 3fca5ed772fb75e3e57c507edef2985f8eba5b12 as process 1
db-1   | 2024-07-20 13:09:20 0 [Note] InnoDB: Compressed tables use zlib 1.3
db-1   | 2024-07-20 13:09:20 0 [Note] InnoDB: Number of transaction pools: 1
db-1   | 2024-07-20 13:09:20 0 [Note] InnoDB: Using generic crc32 instructions
db-1   | 2024-07-20 13:09:20 0 [Note] mariadbd: O_TMPFILE is not supported on /tmp (disabling future attempts)
db-1   | 2024-07-20 13:09:20 0 [Warning] mariadbd: io_uring_queue_init() failed with errno 95
db-1   | 2024-07-20 13:09:20 0 [Warning] InnoDB: liburing disabled: falling back to innodb_use_native_aio=OFF
db-1   | 2024-07-20 13:09:20 0 [Note] InnoDB: Initializing buffer pool, total size = 128.000MiB, chunk size = 2.000MiB
db-1   | 2024-07-20 13:09:20 0 [Note] InnoDB: Completed initialization of buffer pool
db-1   | 2024-07-20 13:09:20 0 [Note] InnoDB: File system buffers for log disabled (block size=512 bytes)
db-1   | 2024-07-20 13:09:20 0 [Note] InnoDB: End of log at LSN=258301
db-1   | 2024-07-20 13:09:20 0 [Note] InnoDB: Opened 3 undo tablespaces
db-1   | 2024-07-20 13:09:20 0 [Note] InnoDB: 128 rollback segments in 3 undo tablespaces are active.
db-1   | 2024-07-20 13:09:20 0 [Note] InnoDB: Setting file './ibtmp1' size to 12.000MiB. Physically writing the file full; Please wait ...
db-1   | 2024-07-20 13:09:20 0 [Note] InnoDB: File './ibtmp1' size is now 12.000MiB.
db-1   | 2024-07-20 13:09:20 0 [Note] InnoDB: log sequence number 258301; transaction id 14
db-1   | 2024-07-20 13:09:20 0 [Note] Plugin 'FEEDBACK' is disabled.
db-1   | 2024-07-20 13:09:20 0 [Note] Plugin 'wsrep-provider' is disabled.
db-1   | 2024-07-20 13:09:20 0 [Note] InnoDB: Loading buffer pool(s) from /var/lib/mysql/ib_buffer_pool
db-1   | 2024-07-20 13:09:20 0 [Note] InnoDB: Buffer pool(s) load completed at 240720 13:09:20
db-1   | 2024-07-20 13:09:23 0 [Note] Server socket created on IP: '0.0.0.0'.
db-1   | 2024-07-20 13:09:23 0 [Note] Server socket created on IP: '::'.
db-1   | 2024-07-20 13:09:23 0 [Note] mariadbd: Event Scheduler: Loaded 0 events
db-1   | 2024-07-20 13:09:23 0 [Note] mariadbd: ready for connections.
db-1   | Version: '11.4.2-MariaDB-ubu2404'  socket: '/run/mysqld/mysqld.sock'  port: 3306  mariadb.org binary distribution
db-1   | 2024-07-20 13:09:25 3 [Warning] Access denied for user 'user'@'172.18.0.3' (using password: YES)
app-1  | Waiting for database to be available... Attempt 2
db-1   | 2024-07-20 13:09:30 4 [Warning] Access denied for user 'user'@'172.18.0.3' (using password: YES)
app-1  | Waiting for database to be available... Attempt 3
…
danielbrendel commented 4 months ago

Did you change passwords in your docker-compose.yml while running docker-compose up again? For instance, if the db container was left unaltered, but the app container was updated (and also the passwords were changed) then it can't authenticate with the db again. In that case both would need to be recreated. Can you check this?

Otherwise: What is your exact server setup?

qkevinto commented 4 months ago

Ahh you're spot on. I recreated everything including the docker volumes and it's now working. I must've initially docker compose up to test and then changed the password. I tried recreating it many times but I didn't think to also clean up the docker volumes which contained the database and such. Thanks for that!