d8ahazard / FlexTV

Other
215 stars 32 forks source link

Docker: error on signin #31

Closed beirtipol closed 4 years ago

beirtipol commented 4 years ago

I decided to try out the Docker image. It starts up and lets me log in to my Plex account, but then nothing is displayed on screen. Looking at the logs, it seems there's an error executing 'chmod' from php.

2020/01/26 12:37:34 [error] 313#313: *2 FastCGI sent in stderr: "PHP message: PHP Warning:  chmod(): Operation not permitted in /config/www/php/util.php on line 2523
PHP message: PHP Warning:  chmod(): Operation not permitted in /config/www/php/webApp.php on line 671
PHP message: PHP Warning:  chmod(): Operation not permitted in /config/www/php/webApp.php on line 671
PHP message: PHP Warning:  chmod(): Operation not permitted in /config/www/php/webApp.php on line 671
PHP message: PHP Warning:  chmod(): Operation not permitted in /config/www/php/webApp.php on line 671" while reading response header from upstream, client: 192.168.86.93, server: _, request: "GET / HTTP/1.1", upstream: "fastcgi://127.0.0.1:9000", host: "myhost:5666"

Which is coming from this code.

    foreach ($files as $file) {
        if (!file_exists($file)) {
                $name = basename($file);
            write_log("Creating file $name","INFO",false,false,true);
            touch($file);
            chmod($file, 0777);
            file_put_contents($file, $secureString);
        }

My docker service is running on Ubuntu 18.04.

It's strange as all the config files were created in my mounted volume but I expect there's some user / group issue due to my docker installation that I need to fix. I'll update if/when I figure it out but thought it useful to share on here for others

beirtipol commented 4 years ago

Yup, as suspected, the location of the 'config' directory was accessible to the user running the docker process, but was not writable from PHP running inside docker. All I needed to do was move the volume back in to my home folder and all was well.