Ghost Not Starting Due to content Folder Permissions

Hi.

I was making some changes to config.production.json and now my ghost instance won’t start when I use ghost start. The error I keep getting is ‘SystemError occurred.’ Underneath a message that says “The content folder is not owned by the current user. Ensure the content folder has correct permissions and try again.” Running ghost doctor provides no helpful commands, everything is green/satisfied. Running ‘ghost run’ however provides an error regarding permissions due to a file that does not even exist, which I highlighted in the provided ghost run screenshot. I searched through this forum, and I have not yet found anything helpful where I can continue troubleshooting. May someone please help me. My website is brianfajardo.com

Thanks in advance!

Can you do ls -ltr in your ghost directory? Anything accidentally owned by the wrong user? Also check that content and logs are not accidentally owned by root.

Hi Cathy!

Thank you very much for helping me.

Below is the output from doing ls -ltr

Hey Cathy. Just wanted to share some additional context. This problem occurred when I was updating ghost, WITHOUT first updating nodejs and npm to the latest supported versions. I had updated ghost and made changes to the config.production.json file first without having updated node. Apparently if you don’t do this in the correct order as described, ghost won’t start as described here: [Supported node versions for self-hosted installs of Ghost]. I of course just did this in this order, but still getting same error. Here is the output from sudo journalctl -u ghost

The ownership in the one directory you screenshotted looks OK. Can you check (ls -ltr again) that the logs folder (and all folders between it and the ghost directory) referenced in your error message is also owned by your canquillo09 user and group. My logs folder has permissions drwxrwsr-x. If yours doesn’t, you may need to adjust (using chmod).

I’m suspecting that you’re going to find that root or some other user ended up owning something they shouldn’t have, based on that error message. Maybe you ran your upgrade as the wrong user, or with sudo when not needed, or something? :)

Hey Cathy, thanks for the continued help here!

Which logs folder exactly? Where can I find this?

Read your error message in the screenshot. It tells you specifically where it’s trying to write to.

That file ‘https___brianfajardo_com_production.error.log’ does not exist in the logs directory. Only a READ.md lives there. See screenshot.
logs permission

It’s looking at the wrong directory. That file exists in the /content/logs, which is correctly owned by ghost, while where it is trying to write to, it is owned by canquillo09.

ghost run is correctly failing because you’re running as your own user, and only the ghost user has write access to the logs folder.

Can you try setting the content folder ownership to your user, running ghost doctor, and if clean, starting ghost with ghost start?

e: Can you first share the output of ghost start before making any changes?

1 Like

Hey Vikaspotluri123, thank you for helping me.

Sorry, I did not see the part that said to share the output of ghost start before making any change. But as I included in the first comment, the output said ‘SystemError occurred.’ Underneath a message that says “The content folder is not owned by the current user. Ensure the content folder has correct permissions and try again.”

My site is now running, however no images are loading. My site is brianfajardo.com

Yeah I added that pretty late :grin:

Can you check your Ghost logs (ghost log -e) to see if there are any messages?

1 Like

Thanks for the continued help Vikaspotluri123.

When I run the command ghost log -e I get the below error. I followed this guide Configuration - Adapt your publication to suit your needs but it’s not working. Did I not follow the instructions correctly?

Here are the config changes I made to config.production.json

Same happened to me.

I am getting a bunch of 404 errors. Also, I cannot enable file logging as per following these instructions, Configuration - Adapt your publication to suit your needs.


Sorry for jumping in on your post adamrice. Hope we can solve our issues together!

@canquillo09 , I’ve relocated your post from another user’s help thread to your own thread. It does not make it easier to help you if the details of your problem are scattered across multiple posts.

1 Like

It might be helpful to see your full config file also (minus passwords). I’m wondering if you have the same problem, with a missing path declaration?

1 Like

Hi Cathy. Sure, sorry about that, new around here.

Looks like you’ve got a nesting error in this file. It’s a little hard to deal with, because you’ve posted an image (instead of the actual text inside the </> code block), but I think you’ve got paths nested within logging - is that right?

(A JSON prettifier might make that easier to see - I usually use https://jsonformatter.org/ – or if you’re using an IDE, you can just tell it to format the file.)

type or paste code here{
  "url": "https://brianfajardo.com",
  "server": {
    "port": 2368,
    "host": "127.0.0.1"
  },
  "database": {
    "client": "mysql",
    "connection": {
      "host": "localhost",
      "user": "canquillo09",
      "password": "SOMETHING",
      "database": "brianfajardo_OLDprod"
    },
    "mail": {
      "transport": "Direct"
    },
    "logging": {
      "path": "content/logs/",
      "useLocalTime": true,
      "level": "info",
      "rotation": {
        "enabled": true,
        "count": 15,
        "period": "1d",
        "transports": [
          "file",
          "stdout"
        ]
      },
      "process": "systemd",
      "paths": {
        "contentPath": "/var/www/brianfajardo/content"
      }
    }
  }
}