I am getting the below error. I am not sure how to run the command it is telling me to run because the container keeps restarting. Long story short, my storage filled up because for some reason my log files kept getting bigger till it filled the drive. I deleted the log files for Nginx and my global DB logs. After which I restarted the server. All containers have come back up beside the services_global-db_1 container. When checking the log for that container I get the below message.
2019-09-25T20:20:15.842133542Z 2019-09-25 20:20:15 140606507280320 [Note] Found 2 prepared transaction(s) in InnoDB 2019-09-25T20:20:15.842251547Z 2019-09-25 20:20:15 140606507280320 [ERROR] Found 2 prepared transactions! It means that mysqld was not shut down properly last time and critical recovery information (last binlog or tc.log file) was manually deleted after a crash. You have to start mysqld with --tc-heuristic-recover switch to commit or rollback pending transactions. 2019-09-25T20:20:15.842326927Z 2019-09-25 20:20:15 140606507280320 [ERROR] Aborting
I attempted to open a bash session (
docker exec -it services_global-db_1 bash) with the container so I could run the SQL command stated below (
mysqld_safe --tc-heuristic-recover=COMMIT) but each time I do I get the message that the
Container 64b72eb0898e7... is restarting, wait until the container is running.
How can I run the command in a container that I can’t keep running because of an error with SQL that I can’t fix without being able to run said command?
Update: I have attempted to manually run the MariaDB container with
docker run -it --rm --entrypoint /bin/bash easyengine/mariadb:v4.0.0 so that I could run the SQL command I need to run to fix the database error. I am able to startup the container and access it but when I try to start the MySQL service I get the below error.
[Warning] Could not open mysql.plugin table. Some options may be missing from the help text log-error
I assume I am missing some command or arg in my run statement which is creating the container the wrong way or something because it looks like MariaDB can’t find the correct files to open or something. Can someone explain to me how to run the MariaDB container manually so I am able to turn on the MySQL service and run the script I can resolve the commit errors and get the database back up and running?
Please and thank you for any help you can give!