I’ve tried to update my ghost blog (v3.16.1 + Sqlite3) to the last release (3.18.0) but it failed.
Furthermore ghost-cli seems to be unable to rollback
Any idea of what’s happened ?
STEPS
sudo npm install -g ghost-cli@latest
ghost update
? Unable to upgrade Ghost from v3.16.1 to v3.18.0. Would you like to revert back to v3.16.1? Yes
+ sudo systemctl is-active ghost_mydomain-com
+ sudo systemctl reset-failed ghost_mydomain-com
✔ Checking system Node.js version
✔ Ensuring user is not logged in as ghost user
✔ Checking if logged in user is directory owner
✔ Checking current folder permissions
✔ Checking folder permissions
✔ Checking file permissions
✔ Checking content folder ownership
✔ Checking for available migrations
✔ Checking for latest Ghost version
ℹ Downloading and updating Ghost [skipped]
+ sudo /srv//mydomaincom/current/node_modules/.bin/knex-migrator-rollback --force --v 3.16.1 --mgpath /srv//mydomaincom/current
✖ Rolling back database migrations
A ProcessError occurred.
Message: The database migration in Ghost encountered an error.
Help: https://ghost.org/faq/upgrade-to-ghost-2-0/#what-to-do-when-an-upgrade-fails
Suggestion: ghost update --rollback
Debug Information:
OS: Ubuntu, v18.04.4 LTS
Node Version: v12.17.0
Ghost Version: 3.18.0
Ghost-CLI Version: 1.14.0
Environment: production
Command: 'ghost update'
Message: SQLITE_CANTOPEN: unable to open database file
Help: Unknown database error
Suggestion: journalctl -u ghost_mydomain-com -n 50
Stack: Error: SQLITE_CANTOPEN: unable to open database file
at Server.<anonymous> (/usr/lib/node_modules/ghost-cli/lib/utils/port-polling.js:38:28)
at Object.onceWrapper (events.js:421:28)
at Server.emit (events.js:315:20)
at emitCloseNT (net.js:1655:8)
at processTicksAndRejections (internal/process/task_queues.js:83:21)
Run “Ghost Start”
+ sudo systemctl is-active ghost_mydomaincom
✔ Ensuring user is not logged in as ghost user
✔ Checking if logged in user is directory owner
✔ Checking current folder permissions
+ sudo systemctl is-active ghost_mydomaincom
✔ Validating config
✔ Checking folder permissions
✔ Checking file permissions
✔ Checking content folder ownership
✔ Checking memory availability
✔ Checking binary dependencies
+ sudo systemctl start ghost_mydomaincom
+ sudo systemctl stop ghost_mydomaincom
✖ Starting Ghost: mydomaincom
A GhostError occurred.
Message: SQLITE_CANTOPEN: unable to open database file
Help: Unknown database error
Suggestion: journalctl -u ghost_mydomaincom -n 50
Debug Information:
OS: Ubuntu, v18.04.4 LTS
Node Version: v12.17.0
Ghost Version: 3.18.0
Ghost-CLI Version: 1.14.0
Environment: production
Command: 'ghost start'
Debug log
Debug Information:
OS: Ubuntu, v18.04.4 LTS
Node Version: v12.17.0
Ghost Version: 3.18.0
Ghost-CLI Version: 1.14.0
Environment: production
Command: 'ghost start'
Message: SQLITE_CANTOPEN: unable to open database file
Help: Unknown database error
Suggestion: journalctl -u ghost_mydomaincom -n 50
Stack: Error: SQLITE_CANTOPEN: unable to open database file
at Server.<anonymous> (/usr/lib/node_modules/ghost-cli/lib/utils/port-polling.js:38:28)
at Object.onceWrapper (events.js:421:28)
at Server.emit (events.js:315:20)
at emitCloseNT (net.js:1655:8)
at processTicksAndRejections (internal/process/task_queues.js:83:21)
Sorry I saw the 3.18 and the line saying “Message: The database migration in Ghost encountered an error.” and assumed it was the bug we just fixed.
Scrolling down further I see
SQLITE_CANTOPEN: unable to open database file
Which is pretty clear about what’s happening, just not giving a reason why.
Only thing I can see that might be a clue is the double slash in your path here - maybe that’s preventing the file from being readable/opened by sqlite?
Sorry he double slash in the path is a copy/past error !
Yes it’s weird, error is clear but not verbose and I can’t rollback to release 3.16.1
I’m cursed with updates
ghost update --rollback
+ sudo systemctl is-active ghost_mydomaincom
✔ Checking system Node.js version
✔ Ensuring user is not logged in as ghost user
✔ Checking if logged in user is directory owner
✔ Checking current folder permissions
✔ Checking folder permissions
✔ Checking file permissions
✔ Checking content folder ownership
✔ Checking memory availability
✔ Checking for available migrations
✔ Checking for latest Ghost version
ℹ Downloading and updating Ghost [skipped]
+ sudo /srv/mydomaincom/current/node_modules/.bin/knex-migrator-rollback --force --v 3.18.0 --mgpath /srv/mydomaincom/current
✖ Rolling back database migrations
A ProcessError occurred.
Message: The database migration in Ghost encountered an error.
Help: https://ghost.org/faq/upgrade-to-ghost-2-0/#what-to-do-when-an-upgrade-fails
Suggestion: ghost update --rollback
Debug
Debug Information:
OS: Ubuntu, v18.04.4 LTS
Node Version: v12.17.0
Ghost Version: 3.18.1
Ghost-CLI Version: 1.14.0
Environment: production
Command: 'ghost update --rollback'
Message: The database migration in Ghost encountered an error.
Help: https://ghost.org/faq/upgrade-to-ghost-2-0/#what-to-do-when-an-upgrade-fails
Suggestion: ghost update --rollback
--------------- stderr ---------------
[2020-06-02 19:07:32] ERROR SQLITE_CANTOPEN: unable to open database file
ghost doctor
✔ Checking system Node.js version
✔ Checking logged in user
✔ Ensuring user is not logged in as ghost user
✔ Checking if logged in user is directory owner
✔ Checking current folder permissions
✔ Checking operating system compatibility
+ sudo systemctl is-active ghost_mydomain-com
? Sudo Password [hidden]
✔ Validating config
✔ Checking folder permissions
✔ Checking file permissions
✔ Checking content folder ownership
✔ Checking memory availability
✔ Checking binary dependencies
I’ve updated another ghost blog instance and faced the same issue so I decided to do a fresh install to understand the problem.
It seems that there is a “bug/regression” when installing Ghost + Sqlite3, you need to specify the absolute “Database path” post install in the config.production.json.