R
Railway12mo ago
Kevinmac

Directus files

Tech support upgraded my Directus to using Docker and also migrated me to V2 and added a persistent volume for file storage earlier today. Now when I try and add an image I get "[SERVICE_UNAVAILABLE] Service "files" is unavailable. Couldn't save file.... " any ideas? Thanks.
Solution:
going to jump in here becuase ive seen this same thing when helping setup the Directus template, like attacler said the app is started as user node and the volume is mounted as root, set a RAILWAY_RUN_UID service variable to 0 to run the app as root instead
Jump to solution
16 Replies
Percy
Percy12mo ago
Project ID: d911897c-20b8-46c5-8fa1-00af65bac5f5
Kevinmac
KevinmacOP12mo ago
d911897c-20b8-46c5-8fa1-00af65bac5f5
Brody
Brody12mo ago
where was the volume mounted to on directus?
Attacler/Bart
Attacler/Bart12mo ago
if you use Directus, you should mount the uploads folder at /directus/uploads if it does not work after that, please share what the logs of your instance have
Kevinmac
KevinmacOP12mo ago
Mount path The path where the volume will be mounted inside the container /directus/uploads
Attacler/Bart
Attacler/Bart12mo ago
alright, do your logs say anything of the Directus instance?
Kevinmac
KevinmacOP12mo ago
Deploy logs? Also, everything else is working fine Well at least appears to be
Attacler/Bart
Attacler/Bart12mo ago
yes, try to upload something and then see if anything usefull is logged there
Kevinmac
KevinmacOP12mo ago
[11:16:06.742] WARN: Couldn't save file 13dd53be-cf56-4c2f-93c9-0417b421b67d.png [11:16:06.743] WARN: EACCES: permission denied, open '/directus/uploads/13dd53be-cf56-4c2f-93c9-0417b421b67d.png' err: { "type": "Error", "message": "EACCES: permission denied, open '/directus/uploads/13dd53be-cf56-4c2f-93c9-0417b421b67d.png'", "stack": Error: EACCES: permission denied, open '/directus/uploads/13dd53be-cf56-4c2f-93c9-0417b421b67d.png' "errno": -13, "code": "EACCES", "syscall": "open", "path": "/directus/uploads/13dd53be-cf56-4c2f-93c9-0417b421b67d.png" } [11:16:07.418] WARN: Couldn't delete file 13dd53be-cf56-4c2f-93c9-0417b421b67d.png [11:16:07.418] WARN: ENOENT: no such file or directory, unlink '/directus/uploads/13dd53be-cf56-4c2f-93c9-0417b421b67d.png' err: { "type": "Error", "message": "ENOENT: no such file or directory, unlink '/directus/uploads/13dd53be-cf56-4c2f-93c9-0417b421b67d.png'", "stack": Error: ENOENT: no such file or directory, unlink '/directus/uploads/13dd53be-cf56-4c2f-93c9-0417b421b67d.png' "errno": -2, "code": "ENOENT", "syscall": "unlink", "path": "/directus/uploads/13dd53be-cf56-4c2f-93c9-0417b421b67d.png" } [11:16:07] POST /files 503 1.5s [11:16:07] GET /files?aggregate[countDistinct]=id 304 121ms [11:16:07] GET /files?filter[_and][0][type][_nnull]=true&filter[_and][1][folder][_null]=true&aggregate[countDistinct]=id 304 143ms [11:16:07] GET /files?limit=25&fields[]=id&fields[]=modified_on&fields[]=type&fields[]=title&fields[]=type&fields[]=filesize&sort[]=-uploaded_on&page=1&filter[_and][0][type][_nnull]=true&filter[_and][1][folder][_null]=true 304 185ms
Attacler/Bart
Attacler/Bart12mo ago
@Brody Directus is running under a user called "node" (not root) might it be that the permissions are screwed in some way?
Solution
Brody
Brody12mo ago
going to jump in here becuase ive seen this same thing when helping setup the Directus template, like attacler said the app is started as user node and the volume is mounted as root, set a RAILWAY_RUN_UID service variable to 0 to run the app as root instead
Kevinmac
KevinmacOP12mo ago
I do that where? In the variables area?
Kevinmac
KevinmacOP12mo ago
Woohoo! That worked.....thank you so much!
Attacler/Bart
Attacler/Bart12mo ago
no problem, do keep in mind that there are no backups for volumes right now 9/10 times i use some S3 storage so that i can reach the files anytime i need them
Kevinmac
KevinmacOP12mo ago
I think I'm going to go with Cloudinary for the images....once I read that chapter....lol
Want results from more Discord servers?
Add your server