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

ghost-cli

#1

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)

#2

This looks very similar to https://github.com/TryGhost/Ghost-CLI/issues/675, which was fixed and released in 1.8.0 (https://github.com/TryGhost/Ghost-CLI/pull/738).

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:


#3

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!


#4

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.


#5

Many thanks, Kate.

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


#6

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