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.
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?
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.
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
✔ 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