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

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

Closed
1 task done
97WaterPolo opened this issue Sep 12, 2024 · 2 comments
Closed
1 task done

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

97WaterPolo opened this issue Sep 12, 2024 · 2 comments
Labels
self hosting [triage] This is an environment issue rather than a bug

Comments

@97WaterPolo
Copy link

97WaterPolo commented Sep 12, 2024

Issue Summary

Hi,

I am recently upgrading my ghost instance from 5.3X.X, I assumed that I would be able to jump to the absolute latest without any issues but when pulling 5.9X.X ghost failed to start. I ended up trying different versions where it would work and eventually found 5.68.0 as the last working version with my setup. Every time I upgrade past it to any version, from 5.68.X - 5.94.X it fails to start.

Since I am running this in docker it took some modifying with a sleep infinity entrypoint so I could console in and manually start it, I ended up starting it with debug using ghost run -D! which printed out some useful errors stating that SQLITE_CANTOPEN: Unable to open the database file, Unknown Database error which pointed to a node_modules/knex-migrator/lib/database.js file. I ended up modifying that file to console.log the connect client options, and it states that it is using sqlite3. After the command failed, I ran `` ghost config database.client` and got the message that it is using "mysql", so I have no clue why it is trying to initialize using sqlite3.

Looks like some config changed between v5.68.0 and v5.69.0 which is causing my instance to break. I've include a screenshot of it running the ghost run -D! command as well as my environment variables. Everything works fine under that version of 5.68.0 and below, it is just the upgrade here. The volumes and env vars are the same between the two versions.

image

image

P.S. I initially filed this issue at the wrong location, there is a little more background here if needed. bitnami/containers#72308

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. Revert back to version 5.68.0 or below
  4. Ghost starts and runs normally without any issues

Ghost Version

5.94.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

  • I agree to be friendly and polite to people in this repository
@github-actions github-actions bot added the needs:triage [triage] this needs to be triaged by the Ghost team label Sep 12, 2024
@kevinansfield kevinansfield added the self hosting [triage] This is an environment issue rather than a bug label Sep 12, 2024 — with Linear
@github-actions github-actions bot removed the needs:triage [triage] this needs to be triaged by the Ghost team label Sep 12, 2024
Copy link
Contributor

Hey @97WaterPolo 👋

We've reviewed your bug report and believe the issue is environment specific, rather than a bug. Many questions can be answered by reviewing our documentation. If you can't find an answer then our forum is a great place to get community support, plus it helps create a central location for searching problems/solutions.

@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale Sep 12, 2024
@97WaterPolo
Copy link
Author

Hi,

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
367990376-e8bb36c5-f592-4304-affe-83b9b10242b2

v5.98.0
367989815-d26134c4-29ee-477f-b8aa-808cbd9a903e

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, 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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
self hosting [triage] This is an environment issue rather than a bug
Projects
None yet
Development

No branches or pull requests

2 participants