I had my blog with an older version of Ghost (3.x.x) and I wanted to update, so I followed this guide step by step. First I updated to the latest minor version of the 3.x.x and everything worked fine there, I could see the version updated on my admin panel.
Now, when updating to the latest version (5.x.x) everything broke
There are no errors when running ghost doctor:
If I check the logs it doesnāt give me useful information (I think):
lobo@blog:/var/www/ghost$ cat /home/lobo/.ghost/logs/ghost-cli-debug-2024-05-14T17_35_03_935Z.log
Debug Information:
OS: Ubuntu, v18.04.4 LTS
Node Version: v20.13.1
Ghost Version: 5.82.9
Ghost-CLI Version: 1.26.0
Environment: production
Command: 'ghost start'
Message: Could not communicate with Ghost
Suggestion: journalctl -u ghost_jvlobo-com -n 50
Stack: Error: Could not communicate with Ghost
at Server.<anonymous> (/usr/local/lib/node_modules/ghost-cli/lib/utils/port-polling.js:91:20)
at Object.onceWrapper (node:events:633:28)
at Server.emit (node:events:519:28)
at emitCloseNT (node:net:2321:8)
at process.processTicksAndRejections (node:internal/process/task_queues:81:21)
I have the backup as the guide explains but if I tried ghost update --rollback it doesnāt work either:
Iām sorry to hear about your troubles. Did you upgrade to the terminal release of Ghost v3, and then move straight to v5? Or did you upgrade v3 to v4 first? This is a necessary step.
Likewise, it would seem that you are running MariaDB not MySQL.
I followed the documentation 100% step by step.
I checked the database as explained and I saw MySQL higher than version 8. Where do you see that I may be running MariaDB?
And for updating I did as the documentation also explains, and it went from v3 to v5
I was just re-reading in case I missed something but even in the example it says to go from v3 to v5:
Before updating to a new major version, you must update your site to the latest minor version, e.g if you are on 3.23.0 you need to be on 3.42.9 before updating to v5.
lobo@blog:/var/www/ghost$ ghost setup systemd
Love open source? Weāre hiring JavaScript Engineers to work on Ghost full-time.
https://careers.ghost.org
Systemd service has already been set up. Skipping Systemd setup
ā¹ Setting up Systemd [skipped]
Could also be a solution to do a fresh install? Would I be able to get everything as it was? (since I have the backup I did with ghost backup before trying to update to v5)
I have no idea, I installed Ghost a few years ago and I think everything was done with lobo, I donāt seem to have any credentials for a ghost user, so Iām not too sure
At this point everything seems to be getting messier and messier, I only wanted to upgrade my already working blog
What do you think is my best option at this point?
Ok okā¦ I see good stuff now.
It seems like there is a problem with my custom theme:
-- Logs begin at Wed 2024-03-27 23:55:05 UTC, end at Wed 2024-05-15 19:04:32 UTC. --
May 15 19:04:32 blog node[27531]: Details:
May 15 19:04:32 blog node[27531]: checkedVersion: 5.x
May 15 19:04:32 blog node[27531]: name: titan
May 15 19:04:32 blog node[27531]: path: /var/www/ghost/content/themes/titan
May 15 19:04:32 blog node[27531]: version: 0.0.2
May 15 19:04:32 blog node[27531]: errors:
May 15 19:04:32 blog node[27531]: -
May 15 19:04:32 blog node[27531]: fatal: false
May 15 19:04:32 blog node[27531]: level: error
May 15 19:04:32 blog node[27531]: rule: The <code>.kg-width-wide</code> CSS class is required to appear styled in your theme
May 15 19:04:32 blog node[27531]: details: The <code>.kg-width-wide</code> CSS class is required otherwise wide images will appear unstyled.Find out more about required theme changes for the Koenig editor <a href="https://ghost.org/docs/themes/content/" target=_blank>here</a>.
May 15 19:04:32 blog node[27531]: regex:
May 15 19:04:32 blog node[27531]: className: .kg-width-wide
May 15 19:04:32 blog node[27531]: css: true
May 15 19:04:32 blog node[27531]: failures:
May 15 19:04:32 blog node[27531]: -
May 15 19:04:32 blog node[27531]: ref: styles
May 15 19:04:32 blog node[27531]: code: GS050-CSS-KGWW
May 15 19:04:32 blog node[27531]: -
May 15 19:04:32 blog node[27531]: fatal: false
May 15 19:04:32 blog node[27531]: level: error
May 15 19:04:32 blog node[27531]: rule: The <code>.kg-width-full</code> CSS class is required to appear styled in your theme
May 15 19:04:32 blog node[27531]: details: The <code>.kg-width-full</code> CSS class is required otherwise wide images will appear unstyled.Find out more about required theme changes for the Koenig editor <a href="https://ghost.org/docs/themes/content/" target=_blank>here</a>.
May 15 19:04:32 blog node[27531]: regex:
May 15 19:04:32 blog node[27531]: className: .kg-width-full
May 15 19:04:32 blog node[27531]: css: true
May 15 19:04:32 blog node[27531]: failures:
May 15 19:04:32 blog node[27531]: -
May 15 19:04:32 blog node[27531]: ref: styles
May 15 19:04:32 blog node[27531]: code: GS050-CSS-KGWF
May 15 19:04:32 blog node[27531]: -
May 15 19:04:32 blog node[27531]: fatal: false
May 15 19:04:32 blog node[27531]: level: error
May 15 19:04:32 blog node[27531]: rule: Not all page features are being used
May 15 19:04:32 blog node[27531]: details: <b>This error only applies to pages created with the Beta editor.</b> Some page features used by Ghost via the <code>{{@page}}</code> global are not implemented in this theme. Find more information about the <code>{{@page}}</code> global <a href="https://ghost.org/docs/themes/helpers/page/" target=_blank>here</a>.
May 15 19:04:32 blog node[27531]: failures:
May 15 19:04:32 blog node[27531]: -
May 15 19:04:32 blog node[27531]: ref: page.hbs
May 15 19:04:32 blog node[27531]: message: @page.show_title_and_feature_image is not used
May 15 19:04:32 blog node[27531]: rule: GS110-NO-MISSING-PAGE-BUILDER-USAGE
May 15 19:04:32 blog node[27531]: code: GS110-NO-MISSING-PAGE-BUILDER-USAGE
May 15 19:04:32 blog node[27531]: warnings:
May 15 19:04:32 blog node[27531]: (empty array)
May 15 19:04:32 blog node[27531]: ----------------------------------------
May 15 19:04:32 blog node[27531]: ThemeValidationError: The currently active theme "titan" has errors, but will still work.
May 15 19:04:32 blog node[27531]: at Object.getThemeValidationError (/var/www/ghost/versions/5.82.9/core/server/services/themes/validate.js:142:12)
May 15 19:04:32 blog node[27531]: at module.exports.loadAndActivate (/var/www/ghost/versions/5.82.9/core/server/services/themes/activate.js:30:35)
May 15 19:04:32 blog node[27531]: at async initServicesForFrontend (/var/www/ghost/versions/5.82.9/core/boot.js:192:5)
May 15 19:04:32 blog node[27531]: at async bootGhost (/var/www/ghost/versions/5.82.9/core/boot.js:547:31)
May 15 19:04:32 blog node[27531]:
Iāll try to sort that out and update the theme, or can I somehow set the theme to the default one and try to start ghost?
Run the same command with -n 100 or -n 200 etc., to view more lines, or simply sudo journalctl -u ghost_jvlobo-com to scroll backward and forward. Look for fatal errors that stop Ghost starting.
Apart from the theme issue, this is what I can see:
May 15 19:35:11 blog node[38344]: [2024-05-15 19:35:11] INFO Running milestone emails job on Sat May 18 2024 19:35:11 GMT+0000 (Coordinated Unive>
May 15 19:35:12 blog node[38319]: /usr/lib/node_modules/ghost-cli/lib/process-manager.js:46
May 15 19:35:12 blog node[38319]: throw error;
May 15 19:35:12 blog node[38319]: ^
May 15 19:35:12 blog node[38344]: [2024-05-15 19:35:12] WARN Ghost is shutting down
May 15 19:35:12 blog node[38319]: { message: undefined }
May 15 19:35:12 blog node[38319]: Node.js v20.13.1
May 15 19:35:12 blog systemd[1]: ghost_jvlobo-com.service: Main process exited, code=exited, status=1/FAILURE
May 15 19:35:12 blog node[38344]: [2024-05-15 19:35:12] WARN Ghost has shut down
May 15 19:35:12 blog node[38344]: [2024-05-15 19:35:12] WARN Your site is now offline
May 15 19:35:12 blog node[38344]: [2024-05-15 19:35:12] WARN Ghost was running for a few seconds
May 15 19:35:12 blog node[38344]: node:internal/errors:541
May 15 19:35:12 blog node[38344]: throw error;
May 15 19:35:12 blog node[38344]: ^
May 15 19:35:12 blog node[38344]: TypeError [ERR_INVALID_ARG_TYPE]: The "code" argument must be of type number. Received type string ('SIGTERM')
May 15 19:35:12 blog node[38344]: at process.set [as exitCode] (node:internal/bootstrap/node:123:9)
May 15 19:35:12 blog node[38344]: at process.exit (node:internal/process/per_thread:180:24)
May 15 19:35:12 blog node[38344]: at Timeout._onTimeout (/var/www/ghost/versions/5.82.9/core/server/GhostServer.js:152:25)
May 15 19:35:12 blog node[38344]: at listOnTimeout (node:internal/timers:573:17)
May 15 19:35:12 blog node[38344]: at process.processTimers (node:internal/timers:514:7) {
May 15 19:35:12 blog node[38344]: code: 'ERR_INVALID_ARG_TYPE'
May 15 19:35:12 blog node[38344]: }
May 15 19:35:12 blog node[38344]: Node.js v20.13.1
May 15 19:35:12 blog systemd[1]: ghost_jvlobo-com.service: Failed with result 'exit-code'.
May 15 19:35:12 blog systemd[1]: ghost_jvlobo-com.service: Scheduled restart job, restart counter is at 538.
May 15 19:35:12 blog systemd[1]: Stopped Ghost systemd service for blog: jvlobo-com.
Youāre running Node 20 when Node 18 is recommended. I think Iād roll back to 18. How did you install Node, nvm? Or using https://deb.nodesource.com/setup_18.x?