R
Railway14mo 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
Percy14mo ago
Project ID: 08568194-e50d-414f-80c8-71ca1b547dc2
Ratix
RatixOP14mo ago
08568194-e50d-414f-80c8-71ca1b547dc2
Brody
Brody14mo ago
please show any errors you are getting
Ratix
RatixOP14mo ago
I use this code tu upload with a simple form in php
No description
Ratix
RatixOP14mo ago
The output was " permission denied"
Brody
Brody14mo ago
show me the code that saves the file to the volume?
Ratix
RatixOP14mo ago
And other case was that using "mkdir" had the same output Ok
Ratix
RatixOP14mo ago
No description
No description
Brody
Brody14mo 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
RatixOP14mo ago
The output was "failed to open stream: permission denied"
Brody
Brody14mo ago
youve tried what i suggested?
Ratix
RatixOP14mo ago
Ok ok i will try it
Brody
Brody14mo ago
ah okay sounds good
Ratix
RatixOP14mo ago
the output was this, and the volume/code is this
No description
No description
No description
No description
Brody
Brody14mo ago
I'll have to call in the big guns
Ratix
RatixOP14mo ago
hahahah okok
Brody
Brody14mo ago
@Vin please grace us with your immense knowledge
Ratix
RatixOP14mo ago
LET'S lfg
MantisInABox
MantisInABox14mo 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
RatixOP14mo ago
okok
Ratix
RatixOP14mo ago
same situation failed to open stream permission denied
No description
No description
No description
No description
Brody
Brody14mo 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
RatixOP14mo ago
ok i will delete it, nixpacks
No description
Brody
Brody14mo ago
@aleks please help
Ratix
RatixOP14mo ago
done
Brody
Brody14mo ago
i know php has so many issues with permissions
Ratix
RatixOP14mo ago
hahahha its complicated
Brody
Brody14mo ago
pretty sure its not your fault at this point
Ratix
RatixOP14mo ago
in other hosting (free) miarroba.com same code it works
MantisInABox
MantisInABox14mo ago
It really does.
Brody
Brody14mo ago
yeah its not an issue with your code
thomas
thomas14mo ago
Can you summarize your issue @Ratix ? It's hard to tell from the logs
root
root14mo 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
Brody14mo ago
aleks please please just run php apps as root like how ever other nixpacks provider runs their code
Ratix
RatixOP14mo 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
root14mo ago
i refuse on moral grounds
Brody
Brody14mo ago
then how can this be solved now?
MantisInABox
MantisInABox14mo 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
Brody14mo 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
MantisInABox14mo 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
RatixOP14mo ago
GitHub
GitHub - iAmRatix/rooms
Contribute to iAmRatix/rooms development by creating an account on GitHub.
Ratix
RatixOP14mo ago
only the part for uploading images
MantisInABox
MantisInABox14mo ago
Okay, thanks. I’ll give it a look in a little while and see what I can come up with for you
Ratix
RatixOP14mo ago
thanks a lot dont worry hi good poggers
Adam
Adam14mo ago
@Vin ^
Ratix
RatixOP14mo ago
what's up @Adam can u help me? hahaha im done it's been 84 years
Adam
Adam14mo ago
No, I'm just here to ping in Vin for visibility since he said he'd look into it
Brody
Brody14mo ago
damn in 84 years you could have learnt how to write a dockerfile
Ratix
RatixOP14mo ago
thx u 2 hahaa xd
Brody
Brody14mo ago
I already know how to write a dockerfile for the languages that I know
Ratix
RatixOP14mo ago
😦
MantisInABox
MantisInABox14mo 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
MantisInABox14mo 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
MantisInABox14mo ago
I forgot to attach a screenshot of the actual PHP service environment variables.
No description
Ratix
RatixOP14mo ago
it works thanks /app/storage was the correct mount path
Want results from more Discord servers?
Add your server