Ghost - app fails to start as it cannot login to into MySQL
-
I have a couple of Ghost instances running, one of them has stopped being able to log into its MySQL database, and so refuses to start.
In the Ghost log I see:
Jun 29 16:36:39 ==> Start ghost Jun 29 16:36:39 ==> Clear potential migration lock Jun 29 16:36:39 mysql: [Warning] Using a password on the command line interface can be insecure. Jun 29 16:36:39 ERROR 1045 (28000): Access denied for user '7a3734398b393a1d'@'37d74e68-8cfa-4dfe-88e9-faafd777950b.cloudron' (using password: YES) Jun 29 16:36:39 json: updated "/app/data/config.production.json" in-place Jun 29 16:36:39 json: updated "/app/data/config.production.json" in-place Jun 29 16:36:39 json: updated "/app/data/config.production.json" in-place Jun 29 16:36:39 ===> Copy frotend/public folder for asset generation Jun 29 16:36:39 ==> Loading /app/data/env for potential overrides Jun 29 16:36:39 ==> Ensure permissions Jun 29 16:36:39 ==> Migrating database Jun 29 16:36:39 [2025-06-29 20:36:39] ERROR Access denied for user '7a3734398b393a1d'@'37d74e68-8cfa-4dfe-88e9-faafd777950b.cloudron' (using password: YES) Jun 29 16:36:39 Jun 29 16:36:39 Access denied for user '7a3734398b393a1d'@'37d74e68-8cfa-4dfe-88e9-faafd777950b.cloudron' (using password: YES) Jun 29 16:36:39 2025-06-29T20:36:39Z Jun 29 16:36:39 "Unknown database error" Jun 29 16:36:39 2025-06-29T20:36:39Z Jun 29 16:36:39 Error ID: Jun 29 16:36:39 500 Jun 29 16:36:39 2025-06-29T20:36:39Z Jun 29 16:36:39 Error Code: Jun 29 16:36:39 DATABASE_CREATION_FAILED Jun 29 16:36:39 2025-06-29T20:36:39Z Jun 29 16:36:39 ---------------------------------------- Jun 29 16:36:39 2025-06-29T20:36:39Z Jun 29 16:36:39 Error: Access denied for user '7a3734398b393a1d'@'37d74e68-8cfa-4dfe-88e9-faafd777950b.cloudron' (using password: YES) Jun 29 16:36:39 at /home/cloudron/ghost/versions/5.126.1/node_modules/knex-migrator/lib/database.js:134:19 Jun 29 16:36:39 at /home/cloudron/ghost/versions/5.126.1/node_modules/knex-migrator/lib/database.js:57:19 Jun 29 16:36:39 at Packet.asError (/home/cloudron/ghost/versions/5.126.1/node_modules/mysql2/lib/packets/packet.js:740:17) Jun 29 16:36:39 at ClientHandshake.execute (/home/cloudron/ghost/versions/5.126.1/node_modules/mysql2/lib/commands/command.js:29:26) Jun 29 16:36:39 at Connection.handlePacket (/home/cloudron/ghost/versions/5.126.1/node_modules/mysql2/lib/base/connection.js:475:34) Jun 29 16:36:39 at PacketParser.onPacket (/home/cloudron/ghost/versions/5.126.1/node_modules/mysql2/lib/base/connection.js:93:12) Jun 29 16:36:39 at PacketParser.executeStart (/home/cloudron/ghost/versions/5.126.1/node_modules/mysql2/lib/packet_parser.js:75:16) Jun 29 16:36:39 at Socket.<anonymous> (/home/cloudron/ghost/versions/5.126.1/node_modules/mysql2/lib/base/connection.js:100:25) Jun 29 16:36:39 at Socket.emit (node:events:518:28) Jun 29 16:36:39 at addChunk (node:internal/streams/readable:561:12) Jun 29 16:36:39 at readableAddChunkPushByteMode (node:internal/streams/readable:512:3) Jun 29 16:36:39 at Readable.push (node:internal/streams/readable:392:5)
If I put the app into repair mode and try to log into the MySQL instance directly from the webterminal, same problem - login refused:
root@37d74e68-8cfa-4dfe-88e9-faafd777950b:/# mysql --user=${CLOUDRON_MYSQL_USERNAME} --password=${CLOUDRON_MYSQL_PASSWORD} --host=${CLOUDRON_MYSQL_HOST} ${CLOUDRON_MYSQL_DATABASE} mysql: [Warning] Using a password on the command line interface can be insecure. ERROR 1045 (28000): Access denied for user '7a3734398b393a1d'@'37d74e68-8cfa-4dfe-88e9-faafd777950b.cloudron' (using password: YES)
I've tried rolling back to a backup version from before the problems, but still having the same issue on startup now. I've tried rolling back to various points and versions, but this does not seem to change the behavior.
I've also tried restarting the MySQL service on the cloudron host, but that also made no difference.
Anyone have any clues on the best way to troubleshoot this?
Thanks.
-
Check the services status in the dashboard to make sure MySQL is running and healthy. Restart if necessary.
-
@jdeighton Have you tried cloning the app from the latest backup - https://docs.cloudron.io/backups/#clone-app ? This creates a new database and fresh credentials.
That said, this is the first time I have seen an error like this.... Let me know what happens with a clone and that will give an idea of something wrong with MySQL addon itself or whether it is just this one app.
-
@girish - Thanks, cloning the app backup to a new name, renaming the original to something else, the renaming the clone to the original name sorted everything out - appreciate the suggestion.
@james I'll try downloading the backup locally and examining the sql file to check what it was doing in there.
-
The sqldump file had the same database name listed in there:
-- MySQL dump 10.13 Distrib 8.0.41, for Linux (x86_64) -- -- Host: localhost Database: 7a3734398b393a1d -- ------------------------------------------------------ -- Server version 8.0.41-0ubuntu0.24.04.1 <snip>
Not sure if the mysqldump thinking it was localhost instead of the 37d74e68-8cfa-4dfe-88e9-faafd777950b.cloudron' name could be part of the issue?
-
The sqldump file had the same database name listed in there:
-- MySQL dump 10.13 Distrib 8.0.41, for Linux (x86_64) -- -- Host: localhost Database: 7a3734398b393a1d -- ------------------------------------------------------ -- Server version 8.0.41-0ubuntu0.24.04.1 <snip>
Not sure if the mysqldump thinking it was localhost instead of the 37d74e68-8cfa-4dfe-88e9-faafd777950b.cloudron' name could be part of the issue?
-
@robi Tried that, shows as healthy, restarted anyway - no change. Other apps (including other Ghost instances) are all running OK on the same box.
Is there a way to log into MySQL as root to see if there is specific issue with that database?
@jdeighton said in Ghost - app fails to start as it cannot login to into MySQL:
Is there a way to log into MySQL as root to see if there is specific issue with that database?
Generally yes, open the app web terminal and click the paste DB credentials button in the top right.
-
@jdeighton said in Ghost - app fails to start as it cannot login to into MySQL:
Is there a way to log into MySQL as root to see if there is specific issue with that database?
Generally yes, open the app web terminal and click the paste DB credentials button in the top right.
-
@robi That gets me into the DB for the individual app on that particular database - was wondering if it's possible to log into the MySQL service directly - that would let me list what databases exist, what users exist, and what permissions each user has.
Hello @jdeighton
Yes, that is possible. Here is also part of this in the documentation: https://docs.cloudron.io/guides/connect-mysql/
But! Not documented is the part how to access the main DB, since this is risky and most users should not do that.
It is present in multiple forum posts so here.While connect to the root user on the server, run:
docker exec -ti mysql /bin/bash
and inside the container you can simply run:
mysql -uroot -p$CLOUDRON_MYSQL_ROOT_PASSWORD