Ghost Update CLI issue : "command failed : Yarn info"

Hello there, hope you can help.

I’m attempting to update Ghost using the CLI on a Digital Ocean install, and keep getting the below error.

I’ve checked all permissions, but can’t work out the resolution to this.

Any help would be hugely appreciated - console output below ::

    ✔ 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
A ProcessError occurred.

Message: Command failed: yarn info ghost versions --json
{"type":"error","data":"An unexpected error occurred: \"EACCES: permission denied, scandir '/root/.config/yarn/link'\"."}

{"type":"info","data":"If you think this is a bug, please open a bug report with the information provided in \"/var/www/ghost/yarn-error.log\"."}
{"type":"info","data":"Visit https://yarnpkg.com/en/docs/cli/info for documentation about this command."}

Exit code: 1


Debug Information:
    OS: Ubuntu, v16.04
    Node Version: v6.14.1
    Ghost-CLI Version: 1.8.1
    Environment: production
    Command: 'ghost update'
A promise was rejected but did not have a .catch() handler:
Error: EACCES: permission denied, mkdir '/root/.ghost/logs'
    at Error (native)
    at Object.fs.mkdirSync (fs.js:932:18)
    at Object.mkdirsSync (/usr/lib/node_modules/ghost-cli/node_modules/fs-extra/lib/mkdirs/mkdirs-sync.js:31:9)
    at System.writeErrorLog (/usr/lib/node_modules/ghost-cli/lib/system.js:351:12)
    at UI.error (/usr/lib/node_modules/ghost-cli/lib/ui/index.js:334:44)
    at precheck.then.catch (/usr/lib/node_modules/ghost-cli/lib/command.js:164:16)
/usr/lib/node_modules/ghost-cli/lib/bootstrap.js:28
    throw reason;
    ^

Error: EACCES: permission denied, mkdir '/root/.ghost/logs'
    at Error (native)
    at Object.fs.mkdirSync (fs.js:932:18)
    at Object.mkdirsSync (/usr/lib/node_modules/ghost-cli/node_modules/fs-extra/lib/mkdirs/mkdirs-sync.js:31:9)
    at System.writeErrorLog (/usr/lib/node_modules/ghost-cli/lib/system.js:351:12)
    at UI.error (/usr/lib/node_modules/ghost-cli/lib/ui/index.js:334:44)
    at precheck.then.catch (/usr/lib/node_modules/ghost-cli/lib/command.js:164:16)

This looks very similar to Ghost-CLI 1.5.2 fails in a loop · Issue #675 · TryGhost/Ghost-CLI · GitHub, which was fixed and released in 1.8.0 (fix(update-check): swap out update-notifier for simpler check by acburdine · Pull Request #738 · TryGhost/Ghost-CLI · GitHub).

Have you installed Ghost on your server with an older CLI version recently?
Are you logged in or were you logged in as root during the installation? :thinking:

When I installed it, it was using the Digital Ocean one-click install, so was installed under the ‘blog’ user set-up for the install. I’ve not installed it on any other droplets.

When I ran the update, it was as sudo -u blog (blog being the user created for the install).

All of the files are owned by ‘ghost’ - is that right?

Thanks so much for helping!

Only the content folder should be owned by the “ghost” user.

Something looks broken with your installation.

Error: EACCES: permission denied, mkdir ‘/root/.ghost/logs’

The .ghost folder should be located under your custom ubuntu user and not under /root/.

We know that Digital Ocean had installed Ghost in one of the previous image versions with root, but this was reported and is resolved as far as i am aware.

I would suggest to start with the installation from scratch with a fresh container.

Many thanks, Kate.

I’ll reinstall with the one-click process tonight and report back.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.