a year ago
I attached a volume to a service. Its mount point is
/PATH_TO_WEB_ROOT/APP_RELATIVE_PATH/files(with real values in the service's settings)The user trying to write to the mount is
www-dataI've set a variable
RAILWAY_RUN_UID=0on the attached service per https://docs.railway.com/guides/volumes#permissions
The volume is still unwritable during run time.
How can I debug this problem? (couldn't find anything meaningful in the logs)
Should the directory (in my case
files) should already exist before I mount a volume on it?)
59 Replies
a year ago
can you please provide us the actual mount point
fwiw, I was about to explicitly chmod 755 on this mount in my Dockerfile. (holding on that for now)
a year ago
what service id?
a year ago
there are no logs in here, can you do whatever would be neeed to trigger some error logs?
I see the error directly here: https://drupal-cms-railway-template-production.up.railway.app/core/install.php
a year ago
was this a template deploy?
a year ago
is there a template for drupal lol
It uses a non-existent root directory, but even so - I'm learning to use Railway so I'm taking the hard path
a year ago
i think once this is solved it would be best to attempt to work with the current template owner
a year ago
duplicate templates just cause confusion
yeah, I'll refrain from publishing it for now - really this is just learning the edges of Railway
a year ago
any reason why you are using a dockerfile instead of the image?
Maybe - I want to initialize the installation with a config file which already has the DB credentials. The image doesn't have it
And I'm also using a different flavor of Drupal than what the image provides, but now you get me thinking whether i left something behind..)
in any case, for the sake of educating myself - regardless of the specific template - how should I achieve a writable mount in such a setup?
a year ago
RAILWAY_RUN_UID=0 - its just a question of why thats not working
Am I right to assume that this variable is needed because internally it is www-data who tries to write to the mount?
a year ago
root@e0bea80480b5:/opt/drupal/web/sites/default# ls -la
total 100
drwxr-xr-x 1 www-data www-data 4096 Jan 21 16:35 .
drwxr-xr-x 1 www-data www-data 4096 Jan 21 16:12 ..
-rw-r--r-- 1 www-data www-data 10656 Jan 21 16:12 default.services.yml
-rw-r--r-- 1 www-data www-data 35786 Jan 21 16:12 default.settings.php
drwxr-xr-x 3 root root 4096 Jan 21 14:56 files
-rw-r--r-- 1 www-data www-data 35786 Jan 21 16:35 settings.phpa year ago
did you add RAILWAY_RUN_UID after the first install?
to be honest I don't remember as I did many changes.
I'm fine with deleting and recreating the services if that would help debugging
a year ago
a year ago
the power of chown
a year ago
just do a chown in your start command
So - to be a good student - I will try the whole installation from Zero using this order:
set up a new service from my repo
add a start up command
attach a mount
deploy.
?
a year ago
i think, but what start command?
a year ago
yeah but whats the full start command?
a year ago
but if you set that as the start command its just going to run chown and never start the web server
a year ago
it wouldn't, even if we supported that lol
a year ago
whatever the default start command is
ok - I'll keep on learning. Will update here if there's any public interest to it
a year ago
i'd like to see your thought process on the correct start command
a year ago
then we can compare our start commands
This one seems to be working:/bin/sh -c "exec apache2-foreground && chown www-data:www-data /opt/drupal/web/sites/default"
a year ago
/bin/sh -c "chown -R www-data:www-data /opt/drupal/web/sites/default/files && exec apache2-foreground"a year ago
you where close
a year ago
exec is a good idea, updated mine
a year ago
no problem!
a year ago
am i good to mark this as solved?
a year ago
!s
Status changed to Solved brody • about 1 year ago