Newly installed Ghost v5.44 cannot upload themes

I just installed Ghost via the Digital Ocean 1-click installer and everything appears to work fine until I tried uploading a new theme zip file and it fails with the following log error:

[2023-04-25 08:11:44] ERROR "POST /ghost/api/admin/themes/upload/" 422 73ms

NAME: ValidationError
CODE: EACCES
MESSAGE: Failed to read zip file

level: normal

"krabi(1).zip"
"Your zip file might be corrupted, try unzipping and zipping again."
ERROR DETAILS:
    "EACCES: permission denied, mkdir '/tmp/1c1707e7-44ae-4b80-aee5-9a5f64636649/.github/workflows/'"

Error: EACCES: permission denied, mkdir '/tmp/1c1707e7-44ae-4b80-aee5-9a5f64636649/.github/workflows/'
    at /var/www/ghost/versions/5.44.0/node_modules/gscan/lib/read-zip.js:43:19

Setup information

Ghost Version
Debug Information:
OS: Ubuntu, v22.04.1 LTS
Node Version: v16.17.0
Ghost Version: 5.44.0
Ghost-CLI Version: 1.24.0
Environment: production

How did you install Ghost?
1-click Ubuntu 22.04 installer on DO.

Browser & OS version
Firefox

Welcome to the Ghost communities, @Scott_Richmond.

The error message states that Ghost couldn’t open the zip file. Have you checked the file can be opened, and isn’t corrupt on another machine?

Also, have you checked Ghost folder permissions? Use ghost doctor.

Yes I can open and unzip the zip file no problems. Ghost doctor reports no issues.

In fact I cannot even upload images:

[2023-04-25 08:51:16] ERROR "POST /ghost/api/admin/images/upload/" 500 202ms

NAME: InternalServerError
CODE: UNEXPECTED_ERROR
MESSAGE: An unexpected error occurred, please try again.

level: critical

"EACCES: permission denied, mkdir '/var/www/ghost/content/images/2023'"
Error: EACCES: permission denied, mkdir '/var/www/ghost/content/images/2023'
    at module.exports.prepareError (/var/www/ghost/versions/5.44.0/node_modules/@tryghost/mw-error-handler/lib/mw-error-handler.js:92:19)

It seems that the folders created in /tmp/ for example are created under the user “ghost” and the owner for /var/www/ghost is owned by “ghost-mgr”. Does that sound right?

I suspect this is caused by having two Ghost users setup. When using the official guide (linked below) you create a user with sudo privileges. It appears that you have two accounts, and one may not have the correct permissions.

What’s the output from these commands?

users
groups <user>

Likewise, what permissions are set for the Ghost folder?

ls -la /var/www/<ghost-folder>

Thanks for your help but I ended up blowing the whole thing away and doing it manually. You should alert your team that your 1-click installer is broken - I never added any users of my own as I simply booted the DO image and went through the install process that was there.

@Scott_Richmond, I am a Ghost user and volunteer community moderator.

The recommended method to install Ghost is included in the documentation, which I posted.

I’ve been trying to install Ghost all day today (following the install steps) and have finally been able to walk through the install process with zero errors or issues and get the site up and running. However uploading theme zip files fails with mkdir permission denied errors in the logs.
Errors:

[2023-04-25 11:57:31] ERROR "POST /ghost/api/admin/themes/upload/" 422 140ms

NAME: ValidationError
CODE: EACCES
MESSAGE: Failed to read zip file

level: normal

"krabi(1).zip"
"Your zip file might be corrupted, try unzipping and zipping again."
ERROR DETAILS:
    "EACCES: permission denied, mkdir '/tmp/f7cecb0a-5d93-4301-8bab-20379a8903e6/.github/workflows/'"

Error: EACCES: permission denied, mkdir '/tmp/f7cecb0a-5d93-4301-8bab-20379a8903e6/.github/workflows/'
    at /var/www/ghost/versions/5.44.0/node_modules/gscan/lib/read-zip.js:43:19
Debug Information:
    OS: Ubuntu, v22.04.2 LTS
    Node Version: v18.16.0
    Ghost Version: 5.44.0
    Ghost-CLI Version: 1.24.0
    Environment: production

Ghost Doctor:

✔ Checking system Node.js version - found v18.16.0
✔ Checking logged in user
✔ Ensuring user is not logged in as ghost user
✔ Checking if logged in user is directory owner
✔ Checking current folder permissions
✔ Checking system compatibility
✔ Checking for a MySQL installation
+ sudo systemctl is-active ghost_blog-galacticare-com
Instance is currently running
ℹ Validating config [skipped]
✔ Checking folder permissions
✔ Checking file permissions
✔ Checking content folder ownership
✔ Checking memory availability
✔ Checking binary dependencies
✔ Checking free space
✔ Checking systemd unit file
✔ Checking systemd node version - found v18.16.0

@Scott_Richmond, please don’t open multiple threads on the same topic. Thanks.

I assume this is resolved now since you reinstalled Ghost using the official guide.

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