R
Railway9mo ago
Ratix

Volume

Hi I recently suscribe to a hobby plan and I'would like to have a page for uploading images using volumes. How can I configure volumen because it seems that I don't have permissions
No description
55 Replies
Percy
Percy9mo ago
Project ID: 08568194-e50d-414f-80c8-71ca1b547dc2
Ratix
Ratix9mo ago
08568194-e50d-414f-80c8-71ca1b547dc2
Brody
Brody9mo ago
please show any errors you are getting
Ratix
Ratix9mo ago
I use this code tu upload with a simple form in php
No description
Ratix
Ratix9mo ago
The output was " permission denied"
Brody
Brody9mo ago
show me the code that saves the file to the volume?
Ratix
Ratix9mo ago
And other case was that using "mkdir" had the same output Ok
Ratix
Ratix9mo ago
No description
No description
Brody
Brody9mo ago
try mounting the volume to /app/imagenes then storing the files into imagenes (note the lack of a forward slash) and dont do any mkdir
Ratix
Ratix9mo ago
The output was "failed to open stream: permission denied"
Brody
Brody9mo ago
youve tried what i suggested?
Ratix
Ratix9mo ago
Ok ok i will try it
Brody
Brody9mo ago
ah okay sounds good
Ratix
Ratix9mo ago
the output was this, and the volume/code is this
No description
No description
No description
No description
Brody
Brody9mo ago
I'll have to call in the big guns
Ratix
Ratix9mo ago
hahahah okok
Brody
Brody9mo ago
@Vin please grace us with your immense knowledge
Ratix
Ratix9mo ago
LET'S lfg
MantisInABox
MantisInABox9mo ago
Lemme read Instead of specifying a path, mount your volume where you want it to be and use the environment variable RAILWAY_VOLUME_MOUNT_PATH where you would reference the location in your code
Ratix
Ratix9mo ago
okok
Ratix
Ratix9mo ago
same situation failed to open stream permission denied
No description
No description
No description
No description
Brody
Brody9mo ago
RAILWAY_VOLUME_MOUNT_PATH is set automatically for you, you dont need to set it yourself are you deploying with nixpacks or a dockerfile?
Ratix
Ratix9mo ago
ok i will delete it, nixpacks
No description
Brody
Brody9mo ago
@aleks please help
Ratix
Ratix9mo ago
done
Brody
Brody9mo ago
i know php has so many issues with permissions
Ratix
Ratix9mo ago
hahahha its complicated
Brody
Brody9mo ago
pretty sure its not your fault at this point
Ratix
Ratix9mo ago
in other hosting (free) miarroba.com same code it works
MantisInABox
MantisInABox9mo ago
It really does.
Brody
Brody9mo ago
yeah its not an issue with your code
thomas
thomas9mo ago
Can you summarize your issue @Ratix ? It's hard to tell from the logs
root
root9mo ago
I think it's the same permissions error folks were running into before, which is that volumes weren't mounted with the right permissions for the nginx user (which PHP apps run under) to edit them
Brody
Brody9mo ago
aleks please please just run php apps as root like how ever other nixpacks provider runs their code
Ratix
Ratix8mo ago
i wanna upload images to the volume "imagenes" but "failed to open stream: permission denied" using a simple form then "move_uploaded_file"
root
root8mo ago
i refuse on moral grounds
Brody
Brody8mo ago
then how can this be solved now?
MantisInABox
MantisInABox8mo ago
@Ratix, are you able to share your repo? If you are, I can try and do some testing to see if I can get a solution for you that works
Brody
Brody8mo ago
vin, what about mounting to /app/storage/images ? you've had success with php and a mount point inside of /app/storage before right?
MantisInABox
MantisInABox8mo ago
Yeah, I did. The only way I got it working with PHP was placing the mount path inside of /app/ but the environment variable should work as well, so, if they can share their repo, I can do some deeper testing and hopefully get a solution
Ratix
Ratix8mo ago
GitHub
GitHub - iAmRatix/rooms
Contribute to iAmRatix/rooms development by creating an account on GitHub.
Ratix
Ratix8mo ago
only the part for uploading images
MantisInABox
MantisInABox8mo ago
Okay, thanks. I’ll give it a look in a little while and see what I can come up with for you
Ratix
Ratix8mo ago
thanks a lot dont worry hi good poggers
Adam
Adam8mo ago
@Vin ^
Ratix
Ratix8mo ago
what's up @Adam can u help me? hahaha im done it's been 84 years
Adam
Adam8mo ago
No, I'm just here to ping in Vin for visibility since he said he'd look into it
Brody
Brody8mo ago
damn in 84 years you could have learnt how to write a dockerfile
Ratix
Ratix8mo ago
thx u 2 hahaa xd
Brody
Brody8mo ago
I already know how to write a dockerfile for the languages that I know
Ratix
Ratix8mo ago
😦
MantisInABox
MantisInABox8mo ago
Sorry, I’ve been away from my computer all day. Went to the renaissance festival. I’ll check on that code tonight. My bad @Ratix
MantisInABox
MantisInABox8mo ago
Hey @Ratix sorry about the delay... I just tested the code that you sent me... The attached screencast shows that it is working properly. From a fresh deploy with your code exactly how you sent it to me, no changes at all. I hope the screencast helps. If not, feel free to tag me in this thread and I'll be more than happy to do some further testing for you.
MantisInABox
MantisInABox8mo ago
I forgot to attach a screenshot of the actual PHP service environment variables.
No description
Ratix
Ratix8mo ago
it works thanks /app/storage was the correct mount path