TryGhost / Ghost

Independent technology for modern publishing, memberships, subscriptions and newsletters.
https://ghost.org
MIT License
47.51k stars 10.37k forks source link

Upgrading from 5.68.X throws an "Unknown database error" #21058

Closed 97WaterPolo closed 1 month ago

97WaterPolo commented 1 month ago

Issue Summary

I had an existing issue https://github.com/TryGhost/Ghost/issues/20995 that was closed due to it possibly being an environment issue.

After further digging into the setup of the container and configurations, it looks like something isn't being passed into that database.js file even though the ghost config command returns correctly.

Inside I did a console.log(options) so I would get whatever value is being passed in the knex() call for the database.js file. In v5.68.0 367999668-14f861c7-8c81-470d-a5c2-025a2cb97530

v5.98.0 367999714-7f9a0454-3868-44ee-871a-b28729f89dc6

The interesting thing is that if I run

ghost config database.client - I get `mysql`
ghost config database.connection.database - I get `ghost`
ghost config database.connection.host - I get `my_db_instance_ip`
ghost config database.connection.password - I get `my_db_instance_pw`

So it seems like the application acknowledges my config.production.json as is correctly loading it when running the ghost config via CLI, however when I upload past v5.68.0 it doesn't seem to pass it into the connection even though the command line config is indicating the right values.

I no longer feel this is an environment issue as the provided ghost CLI config command is returning the correct configuration values in both v5.68.0 AND 5.98.0 but in 5.98.0 it fails to pass the correct options to the database.js file.

Steps to Reproduce

1. Upgrade ghost to any tag version >= 5.69.0 (used 5.94.0 for testing purposes)
2. Ghost fails to start when using ghost run -D! with a database error
3. Run `ghost config` and verify all the configurations are correct and match config.production.json
4. Revert back to version 5.68.0 or below
5.  Run `ghost config` and verify all the configurations are correct and match config.production.json, same result as step 3
6. Ghost starts and runs normally without any issues

Ghost Version

5.98.0

Node.js Version

20.X

How did you install Ghost?

docker

Database type

Other

Browser & OS version

No response

Relevant log / error output

No response

Code of Conduct

markstos commented 1 month ago

Sorry, this still appears to be environment-specific.

You can ask on https://forum.ghost.org/ if you want troubeshooting help.

I believe you start a clean and working install of Ghost 5.68 and follow your steps to produce that it would not triggered.

There is not a enough detail here to be certain there's a bug in Ghost.