gregorip02
gregorip02
RRailway
Created by gregorip02 on 8/22/2024 in #✋|help
Laravel app: permission denied to write on mounted volume
I am using serversideup/php:8.3-unit as docker image in my application. The home directory of my application is /var/www/html/ and I am mounting the volume to /var/www/html/storage/app/public which is where the files that are uploaded to my application are stored. I already set the environment variable RAILWAY_RUN_UID=0 but I have permission issues to write to the mounted volume. The container is running as a non-privileged user www-data but i still have the following error:
[2024-08-22 15:57:00] production.ERROR: file_put_contents(/var/www/html/storage/app/public/hello.txt): Failed to open stream: Permission denied {"userId":1,"exception":"[object] (ErrorException(code: 0): file_put_contents(/var/www/html/storage/app/public/storage/hello.txt): Failed to open stream: Permission denied at /var/www/html/vendor/laravel/framework/src/Illuminate/Filesystem/Filesystem.php:204)
[2024-08-22 15:57:00] production.ERROR: file_put_contents(/var/www/html/storage/app/public/hello.txt): Failed to open stream: Permission denied {"userId":1,"exception":"[object] (ErrorException(code: 0): file_put_contents(/var/www/html/storage/app/public/storage/hello.txt): Failed to open stream: Permission denied at /var/www/html/vendor/laravel/framework/src/Illuminate/Filesystem/Filesystem.php:204)
This is the code that generates the error:
Route::get('/example', function () {
File::put('/var/www/html/storage/app/public/hello.txt', now()->toDateTimeString());

return File::get('/var/www/html/storage/app/public/hello.txt');
});
Route::get('/example', function () {
File::put('/var/www/html/storage/app/public/hello.txt', now()->toDateTimeString());

return File::get('/var/www/html/storage/app/public/hello.txt');
});
16 replies
RRailway
Created by gregorip02 on 3/16/2024 in #✋|help
I can't access my MySQL database using the private network.
I am using the unit:php8.2 docker image to deploy a Laravel application. I used MYSQL_PRIVATE_URL variable to connect to the database but I get the error "SQLSTATE[HY000] [2002] php_network_getaddresses: getaddrinfo for mysql.railway.internal failed: nodename nor servname provided, or not known"
26 replies
RRailway
Created by gregorip02 on 2/1/2024 in #✋|help
s6-overlay-suexec: fatal: can only run as pid 1
For months I have been using the serversideup/php docker images without any problems in railway, however, since yesterday I have had this error when deploying new versions of my app. Can someone help me solve this problem please.
12 replies