Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot run mariadb:connect and mariadb:export commands #129

Closed
turicas opened this issue Aug 10, 2023 · 1 comment · Fixed by #130
Closed

Cannot run mariadb:connect and mariadb:export commands #129

turicas opened this issue Aug 10, 2023 · 1 comment · Fixed by #130

Comments

@turicas
Copy link
Contributor

turicas commented Aug 10, 2023

Description of problem

Cannot run mariadb:connect and mariadb:export commands, it says command not found for mysql and mysqldump, respectively.
I checked and both mysql and mysqldump commands are available in the host machine but not in the container - in the service container the names are mariadb and mariadb-dump.

How reproducible

The problem occurs when I execute the following commands:

# dokku mariadb:export myservice
OCI runtime exec failed: exec failed: unable to start container process: exec: "mysqldump": executable file not found in $PATH: unknown

# dokku mariadb:connect myservice
env: ‘mysql’: No such file or directory

Environment Information

         00_dokku-standard    0.30.9 enabled    dokku core standard plugin                                                    
         mariadb              1.34.0 enabled    dokku mariadb service plugin                                                  

How (deb/make) and where (AWS, VirtualBox, physical, etc.) was Dokku installed?:

Using Debian repository.

Temporary fix

I've symlinked the executables and it worked:

container_id=$(dokku mariadb:info myservice | grep 'Id:' | awk '{print $2}')
docker exec -it $container_id ln -s /usr/bin/mariadb-dump /usr/bin/mysqldump
docker exec -it $container_id ln -s /usr/bin/mariadb /usr/bin/mysql

After this, running dokku mariadb:export works but warns:

mysqldump: Deprecated program name. It will be removed in a future release, use '/usr/bin/mariadb-dump' instead
@josegonzalez
Copy link
Member

I wonder when this changed in the image....

crisward added a commit to crisward/dokku-mariadb that referenced this issue Oct 25, 2023
dokku#129 was resolved with a pull request which change mysql and mysqldump to the mariadb equivalents. However older versions of the mariadb containers don't have mariadb-dump.

This update addresses this by trying both. 

In my older containers `10.1`  mariadb-dump doesn't exist, by mariadb and mysqldump do. 

This is probably not a common problem as 10.1 is very old. However its probably better to have an non-breaking / backward compatable change.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants