"EACCES: permission denied, copyfile" when uploading images after migrating images

hi, I created a blog on digital ocean and migrated content and images.
before uploading images.zip I renamed the existing folders that otherwise would have been overwritten, and then moved the files in the correct folders.

now I can’t upload images anymore because of EACCES: permission denied.

I did everything as root. I tried to solve with

chown ghost-mgr:ghost-mgr /var/www/ghost/.ghost-cli
chown ghost-mgr:ghost-mgr /var/www/ghost/config.production.json
sudo chown ghost-mgr:ghost-mgr /var/www/ghost/content/images/

but I was not able to solve, and I am now wondering I did something not good.

anyone can help here?

1 Like

Same issue. I also see it if I try and download a new theme, change the favicon, etc.

I have see the EACCES error as well as a EPERM: operation not permitted, copyfile ‘/tmp/6bd0f1eb65144d4a5e3b517e16687c2c_processed’ → ‘/var/lib/ghost/content/images/2021/09/filename.png’ depending on which of the tasks above I am doing.

I am using the docker images latest. I also tried using the two previous builds and same issue. I even tried the latest and a brand new fresh install (didn’t copy over my images or import my JSON) and I still see this error setting the favicon. It creates the 2021/09 folder directory in the images folder so it has write permissions to do that.

Connecting to the docker container I see everything is owned by the node user in my case (which the container seems to use). As node, I can write files to /tmp and copy them to the images and images/2021/09 directory just fine.

If I install a theme, I see a folder created in /tmp but nothing is inside it. t also creates a folder in the themes collection but nothing is inside it.

Last resort, I also tried doing a recursive chmod 777 and no change.

I gave up on getting this to work and installed an S3 plugin.

I moved all my old blog images to S3 and now all new images will also upload to S3