Can't upload images

If you’re looking for some help, it’s important to provide as much context as possible so that people are able to assist you. Try to always mention:

  • What’s your URL? This is the easiest way for others to debug your issue

  • What version of Ghost are you using?
    2.22.1

  • What configuration?
    {
    “url”: “”,
    “server”: {
    “port”: 2368,
    “host”: “127.0.0.1”
    },
    “database”: {
    “client”: “mysql”,
    “connection”: {
    “host”: “”,
    “user”: “”,
    “password”: “”,
    “database”: “”
    }
    },
    “mail”: {
    “transport”: “Direct”
    },
    “logging”: {
    “transports”: [
    “file”,
    “stdout”
    ]
    },
    “process”: “systemd”,
    “paths”: {
    “contentPath”: “”
    }
    }

  • What browser?
    Google Chrome Version 74.0.3729.131 (Official Build) (64-bit)

  • What errors or information do you see in the console?
    vendor.min-88fd89b03f4551ace634a8920d36a189.js:850 POST https://blog.importgenius.com/ghost/api/v2/admin/images/upload/ 500

  • What steps could someone else take to reproduce the issue you’re having?
    I’ve installed ghost in a CentOS environment, I understand that this isn’t officially supported. But I got everything working except the upload part. I’ve run ghost doctor but everything checks out fine including file permissions.

Please help

Hi @paulopmx! What kind of image are you trying to upload? Also would be good to know the error which 500 is producing on the server side (can be found in the logs, by default stored in content/logs folder).

Hi @naz, thank you for the quick response. I wasn’t able to find an entry for the error on content/logs, but I was able to find an entry in the nginx logs: 2019/05/15 07:02:09 [crit] 6150#0: *5637 open() “/var/lib/nginx/tmp/client_body/0000000029” failed (13: Permission denied), client: 54.239.178.44, server: blog.domain.com, request: “POST /ghost/api/v2/admin/images/upload/ HTTP/1.1”

I’ve already tried setting the folder permission to 777, to no avail.

FYI, I’m uploading publication icon and logo using png files, which works by the way on my local installation.

Are you using any storage adapters with your Ghost instance? Which folder are you setting 777 permissions to?

When images are uploaded to the server, apart from standard stoarage folder /content/images, uploader uses OS’s default temporary file storage folder - /tmp is CentOS case (or any other POSIX system). Could be worth checking if there’s anything funky going on with permissions there :wink:

No storage adapters.

I’ve tried setting 777, starting with just content/images, then even content, I’ve checked /tmp and it’s permission was already 777.

@naz, I’ve figured it out. Hopefully this will be helpful to other CentOS users, but I didn’t just to give permission to the /tmp folder but have to include the parent. In this case: /var/lib/nginx/

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