I’m trying to update Ghost 2.2.3 to Ghost 3.12.1 using ghost-cli 1.13.1.
Install Log:
ghost-mgr@lamarche:/var/www/ghost$ ghost update
+ sudo systemctl is-active ghost_lamarche-photography
✔ 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 to v3.12.1
Checking theme compatibility for Ghost 3.12.1
✔ Your theme is compatible.
You can also check theme compatibility at https://gscan.ghost.org
? Are you sure you want to proceed with migrating to Ghost 3.12.1? Yes
✔ Updating to a major version
+ sudo systemctl stop ghost_lamarche-photography
✔ Stopping Ghost
✔ Linking latest Ghost and recording versions
+ sudo systemctl start ghost_lamarche-photography
+ sudo systemctl stop ghost_lamarche-photography
✖ Restarting Ghost
A GhostError occurred.
Message: Could not communicate with Ghost
Suggestion: journalctl -u ghost_lamarche-photography -n 50
Debug Information:
OS: Ubuntu, v18.04.4 LTS
Node Version: v12.16.1
Ghost Version: 3.12.1
Ghost-CLI Version: 1.13.1
Environment: production
Command: 'ghost update'
Additional log info available in: /home/ghost-mgr/.ghost/logs/ghost-cli-debug-2020-04-01T16_15_42_854Z.log
Try running ghost doctor to check your system for known issues.
You can always refer to https://ghost.org/docs/api/ghost-cli/ for troubleshooting.
? Unable to upgrade Ghost from v2.22.3 to v3.12.1. Would you like to revert back to v2.22.3? Yes
+ sudo systemctl is-active ghost_lamarche-photography
+ sudo systemctl reset-failed ghost_lamarche-photography
✔ 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 /var/www/ghost/current/node_modules/.bin/knex-migrator-rollback --force --v 2.22.3 --mgpath /var/www/ghost/current
✔ Rolling back database migrations
✔ Linking latest Ghost and recording versions
+ sudo systemctl start ghost_lamarche-photography
✔ Restarting Ghost
ℹ Removing old Ghost versions [skipped]
ghost-mgr@lamarche:/var/www/ghost$ cat /home/ghost-mgr/.ghost/logs/ghost-cli-debug-2020-04-01T16_15_42_854Z.log
Debug Information:
OS: Ubuntu, v18.04.4 LTS
Node Version: v12.16.1
Ghost Version: 3.12.1
Ghost-CLI Version: 1.13.1
Environment: production
Command: 'ghost update'
Message: Could not communicate with Ghost
Suggestion: journalctl -u ghost_lamarche-photography -n 50
Stack: Error: Could not communicate with Ghost
at Server.<anonymous> (/usr/local/lib/node_modules/ghost-cli/lib/utils/port-polling.js:56:20)
at Object.onceWrapper (events.js:417:28)
at Server.emit (events.js:311:20)
at emitCloseNT (net.js:1653:8)
at processTicksAndRejections (internal/process/task_queues.js:83:21)
Contents of /home/ghost-mgr/.ghost/logs/ghost-cli-debug-2020-04-01T16_15_42_854Z.log
Debug Information:
OS: Ubuntu, v18.04.4 LTS
Node Version: v12.16.1
Ghost Version: 3.12.1
Ghost-CLI Version: 1.13.1
Environment: production
Command: 'ghost update'
Message: Could not communicate with Ghost
Suggestion: journalctl -u ghost_lamarche-photography -n 50
Stack: Error: Could not communicate with Ghost
at Server.<anonymous> (/usr/local/lib/node_modules/ghost-cli/lib/utils/port-polling.js:56:20)
at Object.onceWrapper (events.js:417:28)
at Server.emit (events.js:311:20)
at emitCloseNT (net.js:1653:8)
at processTicksAndRejections (internal/process/task_queues.js:83:21)
ghost doctor is all green checkmarks.
I’ve attempted it multiple times, always the same result. It does revert fine, which is a relief, but I really have no idea where to even look on this.
I tried the update again, and then ran that command right after it failed. Results were a little more interesting. I still don’t know how to fix, though.
root@lamarche:~# journalctl -u ghost_lamarche-photography -n 50
-- Logs begin at Mon 2019-07-01 23:52:52 UTC, end at Wed 2020-04-01 19:56:56 UTC. --
Apr 01 19:51:48 lamarche systemd[1]: ghost_lamarche-photography.service: Scheduled restart job, restart counter is at 3.
Apr 01 19:51:48 lamarche systemd[1]: Stopped Ghost systemd service for blog: lamarche-photography.
Apr 01 19:51:48 lamarche systemd[1]: Started Ghost systemd service for blog: lamarche-photography.
Apr 01 19:51:49 lamarche node[16683]: - Inspecting operating system
Apr 01 19:51:50 lamarche node[16683]: /var/www/ghost/versions/3.12.1/node_modules/fs-extra/lib/mkdirs/make-dir.js:86
Apr 01 19:51:50 lamarche node[16683]: } catch {
Apr 01 19:51:50 lamarche node[16683]: ^
Apr 01 19:51:50 lamarche node[16683]: SyntaxError: Unexpected token {
Apr 01 19:51:50 lamarche node[16683]: at createScript (vm.js:80:10)
Apr 01 19:51:50 lamarche node[16683]: at Object.runInThisContext (vm.js:139:10)
Apr 01 19:51:50 lamarche node[16683]: at Module._compile (module.js:616:28)
Apr 01 19:51:50 lamarche node[16683]: at Object.Module._extensions..js (module.js:663:10)
Apr 01 19:51:50 lamarche node[16683]: at Module.load (module.js:565:32)
Apr 01 19:51:50 lamarche node[16683]: at tryModuleLoad (module.js:505:12)
Apr 01 19:51:50 lamarche node[16683]: at Function.Module._load (module.js:497:3)
Apr 01 19:51:50 lamarche node[16683]: at Module.require (module.js:596:17)
Apr 01 19:51:50 lamarche node[16683]: at require (internal/module.js:11:18)
Apr 01 19:51:50 lamarche node[16683]: at Object.<anonymous> (/var/www/ghost/versions/3.12.1/node_modules/fs-extra/lib/mkdirs/index.js:3:44)
Apr 01 19:51:50 lamarche systemd[1]: ghost_lamarche-photography.service: Service hold-off time over, scheduling restart.
Apr 01 19:51:50 lamarche systemd[1]: ghost_lamarche-photography.service: Scheduled restart job, restart counter is at 4.
Apr 01 19:51:50 lamarche systemd[1]: Stopped Ghost systemd service for blog: lamarche-photography.
Apr 01 19:51:50 lamarche systemd[1]: Started Ghost systemd service for blog: lamarche-photography.
Apr 01 19:51:51 lamarche node[16737]: - Inspecting operating system
Apr 01 19:51:52 lamarche node[16737]: /var/www/ghost/versions/3.12.1/node_modules/fs-extra/lib/mkdirs/make-dir.js:86
Apr 01 19:51:52 lamarche node[16737]: } catch {
Apr 01 19:51:52 lamarche node[16737]: ^
Apr 01 19:51:52 lamarche node[16737]: SyntaxError: Unexpected token {
Apr 01 19:51:52 lamarche node[16737]: at createScript (vm.js:80:10)
Apr 01 19:51:52 lamarche node[16737]: at Object.runInThisContext (vm.js:139:10)
Apr 01 19:51:52 lamarche node[16737]: at Module._compile (module.js:616:28)
Apr 01 19:51:52 lamarche node[16737]: at Object.Module._extensions..js (module.js:663:10)
Apr 01 19:51:52 lamarche node[16737]: at Module.load (module.js:565:32)
Apr 01 19:51:52 lamarche node[16737]: at tryModuleLoad (module.js:505:12)
Apr 01 19:51:52 lamarche node[16737]: at Function.Module._load (module.js:497:3)
Apr 01 19:51:52 lamarche node[16737]: at Module.require (module.js:596:17)
Apr 01 19:51:52 lamarche node[16737]: at require (internal/module.js:11:18)
Apr 01 19:51:52 lamarche node[16737]: at Object.<anonymous> (/var/www/ghost/versions/3.12.1/node_modules/fs-extra/lib/mkdirs/index.js:3:44)
Apr 01 19:51:52 lamarche systemd[1]: ghost_lamarche-photography.service: Service hold-off time over, scheduling restart.
Apr 01 19:51:52 lamarche systemd[1]: ghost_lamarche-photography.service: Scheduled restart job, restart counter is at 5.
Apr 01 19:51:52 lamarche systemd[1]: Stopped Ghost systemd service for blog: lamarche-photography.
Apr 01 19:51:52 lamarche systemd[1]: ghost_lamarche-photography.service: Start request repeated too quickly.
Apr 01 19:51:52 lamarche systemd[1]: ghost_lamarche-photography.service: Failed with result 'start-limit-hit'.
Apr 01 19:51:52 lamarche systemd[1]: Failed to start Ghost systemd service for blog: lamarche-photography.
Apr 01 19:56:47 lamarche systemd[1]: Started Ghost systemd service for blog: lamarche-photography.
Apr 01 19:56:48 lamarche node[16871]: - Inspecting operating system
Apr 01 19:56:52 lamarche node[16871]: [2020-04-01 19:56:52] INFO Ghost is running in production...
ghost-mgr@lamarche:~$ which node
/usr/local/bin/node
ghost-mgr@lamarche:~$ which nodejs
/usr/bin/nodejs
I’m guessing the fact that ones’s coming from /usr/bin and the other from /user/local/bin might be problematic?
I’m not entirely sure what package managers other than apt-get are installed, as the server came pre-configured with a bunch of stuff. The best I can tell, npm was pre-installed, but hadn’t been used to install anything until I used it to install make-dir after this problem happened. npm list shows only make-dir and its dependencies.
@jlamarche The command I posted was nVm version, not nPm. nvm is a tool that installs multiple node versions on your system - this is the most likely culprit.
From npm list -g it was a punt, I was wondering whether you had other similar tools like nave or n installed globally.
It’s likely you have a problem similar to what’s described on these 2 pages, am trying to confirm and exactly what and figure out which one you should get rid of
So, I think I see (sort of) what’s going on. Ghost doesn’t support node v13, but there’s another app running under the same nginx instance that requires v13 and apparently installed node v13 in /usr/bin as a dependency. As of right now, everything is working - my Ghost 2.0 install uses /usr/local/bin/node and the other app uses node in /usr/bin/nodejs, so everything runs fine. However, ghost update, which validates against /usr/local/bin/nodejs and finds a supported version (v12) but then has an issue during restart after the upgrade because of the mismatch.
I honestly don’t know if there’s a way to fix this to allow the update without breaking one of the two apps.
I tried temporarily removing nodejs v13 from /usr/bin/ (using apt-get remove nodejs) It did not change the update process - it still hangs on restart, exactly the same as when there were mis-matched version of node and nodejs