jjethwa / rundeck

GNU General Public License v3.0
123 stars 136 forks source link

Starting MariaDB database server: mysqld failed #168

Open aristosv opened 4 years ago

aristosv commented 4 years ago

Hello,

I am using this command to set up rundeck in a container.

docker run -d \
 --restart=always \
 --name rundeck \
 -h rundeck \
 -e PUID=1001 \
 -e PGID=1001 \
 -e TZ=Europe/Nicosia \
 --net=network \
 -p 4440:4440 \
 -v rundeck:/var/rundeck \
 -v rundeck:/etc/rundeck \
 -v rundeck:/var/lib/mysql \
 -v rundeck:/var/log/rundeck \
 -v rundeck:/opt/rundeck-plugins \
 -v rundeck:/var/lib/rundeck/logs \
 -v rundeck:/var/lib/rundeck/var/storage \
 -e EXTERNAL_SERVER_URL=http://192.168.1.23:4440 \
 jordan/rundeck:latest

This is what I get in the log files

Entry for alias debian:verisign_class_3_public_primary_certification_authority_-_g5.pem successfully imported.,
Import command completed:  152 entries successfully imported, 0 entries failed or cancelled,
Warning:,
The JKS keystore uses a proprietary format. It is recommended to migrate to PKCS12 which is an industry standard format using "keytool -importkeystore -srckeystore /etc/rundeck/ssl/keystore -destkeystore /etc/rundeck/ssl/keystore -deststoretype pkcs12".,
=>Initializing local MySQL...,
Starting MariaDB database server: mysqld . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . failed!,
=>Installing plugins from /opt/rundeck-plugins,
=>Initializing rundeck - This may take a few minutes

And it keeps looping like this. I'm I doing something wrong? Thanks

jjethwa commented 4 years ago

Hi @aristosv

Can you add a new volume for /var/log/mysql and see what the error is?

aristosv commented 4 years ago

So I followed your suggestion and added the volume, like this

docker run -d \
 --restart=always \
 --name rundeck \
 -h rundeck \
 -e PUID=1001 \
 -e PGID=1001 \
 -e TZ=Europe/Nicosia \
 --net=network \
 -p 4440:4440 \
 -v rundeck:/var/rundeck \
 -v rundeck:/etc/rundeck \
 -v rundeck:/var/lib/mysql \
 -v rundeck:/var/log/mysql \
 -v rundeck:/var/log/rundeck \
 -v rundeck:/opt/rundeck-plugins \
 -v rundeck:/var/lib/rundeck/logs \
 -v rundeck:/var/lib/rundeck/var/storage \
 -e EXTERNAL_SERVER_URL=http://192.168.1.23:4440 \
 jordan/rundeck:latest

and under /var/log/mysql I found these files

2020-04-10 07_33_12-Portainer

But these files also exist in the root configuration folder of the container

3

That's not right, is it?

In fact, any volume I browse within the container, I get the same files

4

5

6

So it would make sense for mariadb not to be able to start, if it's path is the same as every other path in the container.

My guess it's something wrong with the way the container is build, it doesn't really allow persistent storage?

I checked my other containers volumes and each volume has it's own directory within the container.

I hope this helps.

jjethwa commented 4 years ago

Hi @aristosv

Thanks for trying it. I had missed one small detail in your docker run command earlier. You need to give separate directories for each of the volumes. So something like:

docker run -d \
 --restart=always \
 --name rundeck \
 -h rundeck \
 -e PUID=1001 \
 -e PGID=1001 \
 -e TZ=Europe/Nicosia \
 --net=network \
 -p 4440:4440 \
 -v rundeck/var/rundeck:/var/rundeck \
 -v rundeck/etc/rundeck:/etc/rundeck \
 -v rundeck/var/lib/mysql:/var/lib/mysql \
 -v rundeck/var/log/mysql:/var/log/mysql \
 -v rundeck/var/log/rundeck:/var/log/rundeck \
 -v rundeck/opt/rundeck-plugins:/opt/rundeck-plugins \
 -v rundeck/var/lib/rundeck/logs:/var/lib/rundeck/logs \
 -v rundeck/var/lib/rundeck/var/storage:/var/lib/rundeck/var/storage \
 -e EXTERNAL_SERVER_URL=http://192.168.1.23:4440 \
 jordan/rundeck:latest
aristosv commented 4 years ago

Thanks for you reply.

I'm no docker expert, but this is what I have so far with all my other containers

On the left side of the : I always use the name of the container, which points to /var/lib/docker/volumes/$containername/_data.

And on the right side of the : I always put the paths of the volumes created by the container.

This way the container can use /var/lib/docker/volumes/$containername/_data to create it's directory structure, as it sees fit.

This is what I do with all my containers, and they all use that path.

1

So far I never had to manually create directory paths on the left side of the :

But I did try the command you recommended, and this is the error I got.

docker: Error response from daemon: create rundeck/var/rundeck: "rundeck/var/rundeck" includes invalid characters for a local volume name, only "[a-zA-Z0-9][a-zA-Z0-9_.-]" are allowed. If you intended to pass a host directory, use absolute path.

jjethwa commented 4 years ago

Hi @aristosv

I think the problem is that when you start it the original way, docker is not creating the subdirectories and dumping everything under the rundeck directory. I haven't seen this happen before. I usually specify my volume directories so I can point it to an exact location. Can you try testing with an exact path on the left side?

aristosv commented 4 years ago

When I specify an exact path on the left side (including separate directories) it works. It's the first time I had to do something like this though.

This is how I usually install my containers. I just specify the container name on the left, and everything is installed in /var/lib/docker/volumes/$containername/_data including any required sub-directories.

I'm assuming it's something that's defined in the Dockerfile?

docker run -d \
 --restart=always \
 --name mosquitto \
 -h mosquitto \
 -e PUID=1001 \
 -e PGID=1001 \
 -e TZ=Europe/Nicosia \
 --net=network \
 -p 1883:1883 \
 -p 9001:9001 \
 -v mosquitto:/mosquitto/config \
 -v mosquitto:/mosquitto/data \
 -v mosquitto:/mosquitto/log \
 eclipse-mosquitto

docker run -d \
 --restart=always \
 --name jellyfin \
 -h jellyfin \
 -e PUID=1001 \
 -e PGID=1001 \
 -e TZ=Europe/Nicosia \
 --net=network \
 -p 8096:8096 \
 -v jellyfin:/config \
 -v jellyfin:/transcode \
 linuxserver/jellyfin
jjethwa commented 4 years ago

I'll have to take a look. I started the container when docker was still in beta and haven't had anyone mention the issue before. Maybe there's something new that needs to be added as you mentioned :disappointed: