Strapi import fails, no write permissions on public folder

System Information
  • Strapi Version: 4.10.6
  • Operating System: Linux
  • Database: Postgres
  • Node Version: 16
  • NPM Version: 8.19.4
  • Yarn Version:

Hi! I’m new to Strapi. I’ve exported data from a remote Strapi instance following the docs and got a .tar.gz file. I want to import this same data on my local Strapi instance but it fails, here’s the log:

? The import will delete all assets and data in your database. Are you sure you want to proceed? Yes
Starting the compilation for TypeScript files in /opt/app
(node:354) Warning: S3 configuration options passed at root level of the plugin's providerOptions is deprecated and will be removed in a future release. Please wrap them inside the 's3Options:{}' property.
(Use `node --trace-warnings ...` to show where the warning was created)
(node:354) Warning: Missing transfer.token.salt: Data transfer features have been disabled.
Please set transfer.token.salt in config/admin.js (ex: you can generate one using Node with `crypto.randomBytes(16).toString('base64')`)
For security reasons, prefer storing the secret in an environment variable and read it in config/admin.js. See
Starting import...
✔ entities: 726 transfered (size: 662.5 KB) (elapsed: 15937 ms) 
[2023-05-31 07:42:45.569] error: [FATAL] The backup folder for the assets could not be created inside the public folder. Please ensure Strapi has write permissions on the public directory
Import process failed.

I don’t know how to solve this. I ran command chmod -R 777 on the public folder just to see if that would fix it quickly but it doesn’t solve it unfortunately. Also created the backup folder manually but the same error is still thrown. How do I set write permissions for Strapi?

1 Like

The same issue. Did you find out solution?

The underlying issue is: strapi import fails: error: [FATAL] EBUSY: resource busy or locked · Issue #15613 · strapi/strapi · GitHub

Most likely you are using docker or docker-compose or something else is locking uploads folder from moving to backup.

In my case, I am using docker compose and I just changed public/uploads mount to just the whole public dir. That worked.