`Directory is not readable` error after update?

Hey all,

Just went to update my self-hosted Ghost blog. I was having some issues with both node (I somehow had installed multiple versions of node) and the ghost cli being out of date, but I think I fixed those. My site was running (and fully updated) while running ghost start, but that command would hang for a few minutes before returning an error and then kicking my site to a 502 error.

I thought I resolved the node errors, and my ghost install seemed up to date. However, now running ghost start I get this error:

Message: The directory /home/ian_battaglia/ is not readable by other users on the system.
This can cause issues with the CLI, you must either make this directory readable by others or install node and Ghost-CLI in another location.

My site is located in /var/www/{sitename} and this is a new error, so I can’t really understand what the issue is. I see this post from earlier this year, but I don’t think that’s my issue.

Here’s my debug info:

    OS: Ubuntu, v22.04.3 LTS
    Node Version: v18.12.1
    Ghost Version: 5.71.0
    Ghost-CLI Version: 1.25.3
    Environment: production
    Command: 'ghost start'

Any help?

1 Like

Maybe you can try below



# Set directory owner: Replace <user> with the name of **ian_battaglia** OR **ghost** OR **ghost-mgr**
sudo chown <user>:<user> /var/www/{sitename}

# Set the correct permissions
sudo chmod 775 /var/www/{sitename}

# Then navigate into it
cd /var/www/{sitename}

ghost start

Unfortunately this didn’t work. I ran:

sudo chown ian_battaglia:ian_battaglia /var/www/mnchrm/
sudo chmod 775 /var/www/mnchrm/
cd /var/www/mnchrm/
ghost start

and received the same error:


+ sudo systemctl is-active ghost_mnchrm-co
✖ Checking system Node.js version - found v18.18.2
✔ 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_mnchrm-co
✔ Validating config
✔ Checking folder permissions
✔ Checking file permissions
✔ Checking content folder ownership
✔ Checking memory availability
✖ Checking binary dependencies
✔ Checking systemd unit file
Warning: Ghost is running with node v18.12.1.
Your current node version is v18.18.2.
✔ Checking systemd node version - found v18.12.1
One or more errors occurred.

1) SystemError

Message: The directory /home/ian_battaglia/ is not readable by other users on the system.
This can cause issues with the CLI, you must either make this directory readable by others or install node and Ghost-CLI in another location.


2) Checking binary dependencies

Message: The installed node version has changed since Ghost was installed.
Help: Run ghost update 5.71.0 --force to re-install binary dependencies.

Debug Information:
    OS: Ubuntu, v22.04.3 LTS
    Node Version: v18.18.2
    Ghost Version: 5.71.0
    Ghost-CLI Version: 1.25.3
    Environment: production
    Command: 'ghost start'

Try running ghost doctor to check your system for known issues.

Somehow, I seemed to have installed different versions of node along the way, but I’m not sure how to resolve this. I’ve tried various methods to set the node version so they match. I followed this guide, and now I’m only getting the system error / directory not readable message.


I just tried ghost run, and received this message:

The `ghost run` command is used by the configured Ghost process manager and for debugging. If you're not running this to debug something, you should run `ghost start` instead.
+ sudo node current/index.js
Sorry, user ian_battaglia is not allowed to execute '/home/ian_battaglia/.nvm/versions/node/v18.18.2/bin/node current/index.js' as ghost on localhost.

Woof, I’m really in the weeds here. I tried to completely uninstall and reinstall node, I think I’ve caught myself in a symbolic link loop somehow.

I think in attempting to reinstall I tried to make a symlink, as noted here.

nvm ls shows I have v18.18.2 and v21.1.0 installed, but now all the commands I try (like nvm use 18.18.2) return /usr/bin/env: ‘node’: Too many levels of symbolic links.

Looking at this page, I ran find -L -xtype l, and it just returns a huge number of items from ./versions/5.71.0/node_modules/ (as well as ./current/node_modules/, and ./versions/5.61.2/node_modules/).

I made a backup of my Ghost instance as part of the upgrade, so I think I’d like to uninstall and reinstall, but I’m not able to do that with the symlink issue.

The last time I encountered node issue, I used the command below:

npm install -g n	 # Intall n globally
n 16.20.1 			# nIInstall and use v16.20.1

npm install -g ghost-cli@latest

Also, maybe you try to change your user to ghost or ghost-mgr for code

sudo chown ghost:ghost /var/www/mnchrm/
sudo chmod 775 /var/www/mnchrm/
cd /var/www/mnchrm/

sudo chmod 775 /home/ian_battaglia/

This should fix the issue as I was getting the same error after installing node 18.12.1 and it was showing The directory/home/ghost-mgr is not readable by other users

So I used this sudo chmod 775 /home/ghost-mgr and it fixed the issue.

1 Like

Okay, managed to clear everything up with this. This feels extremely specific to however I messed it up, but I’ll try and outline what I did just in case it’s helpful to anyone.

I corrected the permissions as listed by @Mr_Coder above, then went about removing the symlinks I added for the node directories using unlink. I then uninstalled and reinstalled node using:

sudo apt-get remove nodejs npm
sudo apt install nodejs
sudo apt install npm

Then I had to update npm, using npm install -g npm@10.2.3.

I went to try and restart ghost again at this point, but needed to update the CLI (since I switch the node version) and some of the supporting packages using the --force flag on ghost update.

From there, ghost said it was running, but still wasn’t resolvable, giving me a 502 error. mysql seemed to be running, but I saw here that node 18 doesn’t like ipv4, so I updated my config file to specify 127.0.0.1 instead of localhost, and blam, back online.

1 Like

Encountered the same issue but using ghost install still can’t solve it

It is really weird that the permits required are in /home/$USER when the installation is in /var/www/{site}

Changing the permits over the home might work… but there should be other method

Actually solved my issue by doing chown 755 /home/$USER
After digging a bit more… the user uses the node files on the home user to run ghost, this is why requires this permits.