linuxserver / docker-mariadb

GNU General Public License v3.0
212 stars 46 forks source link

[BUG] After container creation, error loop #136

Closed GregoryCARON closed 1 year ago

GregoryCARON commented 1 year ago

Is there an existing issue for this?

Current Behavior

In log :

Caught SIGTERM signal! 230902 15:49:41 mysqld_safe Logging to '/config/databases/unraid.err'. 230902 15:49:41 mysqld_safe Starting mariadbd daemon with databases from /config/databases Caught SIGTERM signal! 230902 15:49:42 mysqld_safe Logging to '/config/databases/unraid.err'. 230902 15:49:42 mysqld_safe Starting mariadbd daemon with databases from /config/databases Caught SIGTERM signal! 230902 15:49:43 mysqld_safe Logging to '/config/databases/unraid.err'. 230902 15:49:43 mysqld_safe Starting mariadbd daemon with databases from /config/databases Caught SIGTERM signal! 230902 15:49:44 mysqld_safe Logging to '/config/databases/unraid.err'. 230902 15:49:44 mysqld_safe Starting mariadbd daemon with databases from /config/databases Caught SIGTERM signal! 230902 15:49:45 mysqld_safe Logging to '/config/databases/unraid.err'. 230902 15:49:45 mysqld_safe Starting mariadbd daemon with databases from /config/databases Caught SIGTERM signal! 230902 15:49:58 mysqld_safe Logging to '/config/databases/unraid.err'. 230902 15:49:58 mysqld_safe Starting mariadbd daemon with databases from /config/databases Caught SIGTERM signal! cat: /var/run/mysqld/mysqld.pid: No such file or directory 230902 15:50:06 mysqld_safe Logging to '/config/databases/unraid.err'. 230902 15:50:06 mysqld_safe Starting mariadbd daemon with databases from /config/databases

in /config/databases/unraid.err :

230902 15:53:21 mysqld_safe mysqld from pid file /var/run/mysqld/mysqld.pid ended 230902 15:53:21 mysqld_safe Starting mariadbd daemon with databases from /config/databases 2023-09-02 15:53:21 0 [Note] Starting MariaDB 10.11.4-MariaDB-log source revision 4e2b93dffef2414a11ca5edc8d215f57ee5010e5 as process 2282 2023-09-02 15:53:21 0 [Note] Using unique option prefix 'myisam_recover' is error-prone and can break in the future. Please use the full name 'myisam-recover-options' instead. 2023-09-02 15:53:21 0 [Note] InnoDB: Compressed tables use zlib 1.2.13 2023-09-02 15:53:21 0 [Note] InnoDB: Number of transaction pools: 1 2023-09-02 15:53:21 0 [Note] InnoDB: Using crc32 + pclmulqdq instructions 2023-09-02 15:53:21 0 [Note] mariadbd: O_TMPFILE is not supported on /tmp (disabling future attempts) 2023-09-02 15:53:21 0 [Note] InnoDB: Using Linux native AIO 2023-09-02 15:53:21 0 [Note] InnoDB: Initializing buffer pool, total size = 256.000MiB, chunk size = 4.000MiB 2023-09-02 15:53:21 0 [Note] InnoDB: Completed initialization of buffer pool 2023-09-02 15:53:21 0 [Note] InnoDB: Buffered log writes (block size=512 bytes) 2023-09-02 15:53:21 0 [Note] InnoDB: 128 rollback segments are active. 2023-09-02 15:53:21 0 [Note] InnoDB: Setting file './ibtmp1' size to 12.000MiB. Physically writing the file full; Please wait ... 2023-09-02 15:53:21 0 [Note] InnoDB: File './ibtmp1' size is now 12.000MiB. 2023-09-02 15:53:21 0 [Note] InnoDB: log sequence number 46456; transaction id 14 2023-09-02 15:53:21 0 [Note] Plugin 'FEEDBACK' is disabled. 2023-09-02 15:53:21 0 [Note] InnoDB: Loading buffer pool(s) from /config/databases/ib_buffer_pool 2023-09-02 15:53:21 0 [Note] InnoDB: Buffer pool(s) load completed at 230902 15:53:21 2023-09-02 15:53:22 0 [Note] Server socket created on IP: '0.0.0.0'. 2023-09-02 15:53:22 0 [ERROR] Can't start server: Bind on TCP/IP port. Got error: 98: Address in use 2023-09-02 15:53:22 0 [ERROR] Do you already have another server running on port: 3306 ? 2023-09-02 15:53:22 0 [ERROR] Aborting

port 3306 is NOT used

Expected Behavior

No response

Steps To Reproduce

1 - Create container 2 - Run

Environment

- OS:unRAID

CPU architecture

x86-64

Docker creation

docker run
  -d
  --name='mariadb'
  --net='host'
  -e TZ="Europe/Paris"
  -e HOST_OS="Unraid"
  -e HOST_HOSTNAME="unraid"
  -e HOST_CONTAINERNAME="mariadb"
  -e 'TCP_PORT_3306'='3306'
  -e 'MYSQL_ROOT_PASSWORD'='pass'
  -e 'MYSQL_DATABASE'='USER_DB_NAME'
  -e 'MYSQL_USER'='toto'
  -e 'MYSQL_PASSWORD'='pass'
  -e 'PUID'='99'
  -e 'PGID'='100'
  -e 'UMASK'='0640'
  -l net.unraid.docker.managed=dockerman
  -l net.unraid.docker.icon='https://raw.githubusercontent.com/linuxserver/docker-templates/master/linuxserver.io/img/mariadb-logo.png'
  -v '/mnt/user/appdata/mariadb':'/config':'rw' 'lscr.io/linuxserver/mariadb'
3e5f6180cc0e6e71fa0a7613dd341cc7c3c8e23120ff890922ff58e10a9be650

Container logs

Error: No such container: linuxserver.io
github-actions[bot] commented 1 year ago

Thanks for opening your first issue here! Be sure to follow the relevant issue templates, or risk having this issue marked as invalid.

nemchik commented 1 year ago

Can you try with a fresh (empty) appdata folder? You could just edit the container and set your appdata folder to /mnt/user/appdata/mariadb.fresh

j0nnymoe commented 1 year ago

Host networking is causing that issue. you either have another mariadb container using that port or something else.

--net='host'

2023-09-02 15:53:22 0 [ERROR] Can't start server: Bind on TCP/IP port. Got error: 98: Address in use

GregoryCARON commented 1 year ago

Can you try with a fresh (empty) appdata folder? You could just edit the container and set your appdata folder to /mnt/user/appdata/mariadb.fresh

I also deleted the container AND the folder in order to start from scratch, same thing.

Host networking is causing that issue. you either have another mariadb container using that port or something else.

--net='host'

2023-09-02 15:53:22 0 [ERROR] Can't start server: Bind on TCP/IP port. Got error: 98: Address in use

Absolutely no services use the port. I even stopped all my other containers / VMs etc to make sure and the port is still faulty.

j0nnymoe commented 1 year ago

Stop using host networking for a container that doesn't need it.

Also, that error isn't going to show for no reason. There will be something running on that port if it can't bind to it.

GregoryCARON commented 1 year ago

When I use my Docker or Bridge network, I have this:

docker: Error response from daemon: driver failed programming external connectivity on endpoint mariadb (b05b61aa4efcf9c947aa5b0538dda7e3c4abeb85f29925f27c70cb50753da537): Error starting userland proxy: listen tcp4 0.0.0.0:3306: bind: address already in use.

aptalca commented 1 year ago

Clearly something is using that port on your host.

Absolutely no services use the port

Show us. Don't make us take your word for it.

Alternatively, you can map a different port for mariadb, or you can simply not even map a port and access the container port through the docker network.

In any case, this is a user issue and not a bug. Closing this.

If you need further help, you can use our other support channels such as discord or discourse.

GregoryCARON commented 1 year ago

Bug or not, stop the Docker service and re-start it to correct this ... bug?

Finally, it's resolved and it wasn't a user configuration problem!