Docker icon indicating copy to clipboard operation
Docker copied to clipboard

CachetHQ will not start on OpenShift 3.6 php-fdm fails

Open gamkiller77 opened this issue 7 years ago • 8 comments

I am deploying the latest release of CachetHQ Docker on to OpenShift 3.6. When starting I am getting lots of errors that php-fdm can not load.

  | [15-Mar-2018 20:32:11] ALERT: [pool www] user has not been defined
  | [15-Mar-2018 20:32:11] ERROR: failed to post process the configuration
  | [15-Mar-2018 20:32:11] ERROR: failed to post process the configuration
  | [15-Mar-2018 20:32:11] ERROR: FPM initialization failed
  | [15-Mar-2018 20:32:11] ERROR: FPM initialization failed
  | 2018-03-15 20:32:11,494 INFO exited: php-fpm (exit status 78; not expected)
  | 2018-03-15 20:32:12,495 INFO gave up: php-fpm entered FATAL state, too many start retries too quickly

I tried to run php-pdm manually and I got basically the same error.

I was able to test a solution and it was able to start php-fdm. The fix is just below. php-fpm-pool.conf needs this added with in the www block

user = www-data

I was trying to do a PR but I am unable to publish my branch. I am still a nood to all this git stuff.

Andy

gamkiller77 avatar Mar 16 '18 17:03 gamkiller77

OK so www-data is root so new error. We will have to add a new non root user to the container then assign it to fpm-pool.


[16-Mar-2018 17:50:45] ERROR: [pool www] please specify user and group other than root
--
  | [16-Mar-2018 17:50:45] ERROR: [pool www] please specify user and group other than root

Sorry just saw this right now with some more testing.

gamkiller77 avatar Mar 16 '18 17:03 gamkiller77

Does it need to be set to 1001 maybe ?:

https://github.com/CachetHQ/Docker/blob/master/Dockerfile#L54

ref: https://github.com/CachetHQ/Docker/pull/270

djdefi avatar Mar 16 '18 18:03 djdefi

yah i think so. It just really wants a user that dose not have the same UID as root. I picked www-data as it looks to be the best one.

gamkiller77 avatar Mar 16 '18 18:03 gamkiller77

Let me test really fast i get back to you before the EOD PST.

gamkiller77 avatar Mar 16 '18 19:03 gamkiller77

Did not work with user 1001 i switched to user nginx It started up but i got new errors now.


[16-Mar-2018 21:02:28] WARNING: [pool www] child 79 said into stderr: "NOTICE: PHP message: [2018-03-16 21:02:28] Prod.ERROR: ErrorException: file_put_contents(/var/www/html/storage/framework/views/3a64bfbaf27fa49acabf10c56fa1ac29af86244c.php): failed to open stream: Permission denied in /var/www/html/vendor/laravel/framework/src/Illuminate/Filesystem/Filesystem.php:109"
--
  | [16-Mar-2018 21:02:28] WARNING: [pool www] child 79 said into stderr: "Stack trace:"
  | [16-Mar-2018 21:02:28] WARNING: [pool www] child 79 said into stderr: "#0 [internal function]: Illuminate\Foundation\Bootstrap\HandleExceptions->handleError(2, 'file_put_conten...', '/var/www/html/v...', 109, Array)"
  | [16-Mar-2018 21:02:28] WARNING: [pool www] child 79 said into stderr: "#1 /var/www/html/vendor/laravel/framework/src/Illuminate/Filesystem/Filesystem.php(109): file_put_contents('/var/www/html/s...', '<?php $__env->s...', 0)"
  | [16-Mar-2018 21:02:28] WARNING: [pool www] child 79 said into stderr: "#2 /var/www/html/vendor/laravel/framework/src/Illuminate/View/Compilers/BladeCompiler.php(116): Illuminate\Filesystem\Filesystem->put('/var/www/html/s...', '<?php $__env->s...')"
  | [16-Mar-2018 21:02:28] WARNING: [pool www] child 79 said into stderr: "#3 /var/www/html/vendor/laravel/framework/src/Illuminate/View/Engines/CompilerEngine.php(51): Illuminate\View\Compilers\BladeCompiler->compile('/var/www/html/r...')"
  | [16-Mar-2018 21:02:28] WARNING: [pool www] child 79 said into stderr: "#4 /var/www/html/vendor/laravel/framework/src/Illuminate/View/V..."
  | 10.0.13.1 - - [16/Mar/2018:21:02:28 +0000] "GET /setup HTTP/1.1" 500 3211 "-" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/64.0.3282.186 Safari/537.36" "173.36.103.13, 173.36.90.109, 173.36.90.102"
  | 2018/03/16 21:02:28 [error] 66#66: *1 FastCGI sent in stderr: "PHP message: [2018-03-16 21:02:28] Prod.ERROR: ErrorException: file_put_contents(/var/www/html/storage/framework/views/3a64bfbaf27fa49acabf10c56fa1ac29af86244c.php): failed to open stream: Permission denied in /var/www/html/vendor/laravel/framework/src/Illuminate/Filesystem/Filesystem.php:109
  | Stack trace:
  | #0 [internal function]: Illuminate\Foundation\Bootstrap\HandleExceptions->handleError(2, 'file_put_conten...', '/var/www/html/v...', 109, Array)
  | #1 /var/www/html/vendor/laravel/framework/src/Illuminate/Filesystem/Filesystem.php(109): file_put_contents('/var/www/html/s...', '<?php $__env->s...', 0)
  | #2 /var/www/html/vendor/laravel/framework/src/Illuminate/View/Compilers/BladeCompiler.php(116): Illuminate\Filesystem\Filesystem->put('/var/www/html/s...', '<?php $__env->s...')
  | #3 /var/www/html/vendor/laravel/framework/src/Illuminate/View/Engines/CompilerEngine.php(51): Illuminate\View\Compilers\BladeCompiler->compile('/var/www/html/r...')

gamkiller77 avatar Mar 16 '18 21:03 gamkiller77

Ok I was able to fix it.

Set the user to www-data

In supervisord.conf

add this to start php-fdm --allow-to-run-as-root Like this

[program:php-fpm]
command=/usr/sbin/php-fpm7 --allow-to-run-as-root -c /etc/php7/fpm/pool.d/www.conf

I finally got the setup page.

Andy

gamkiller77 avatar Mar 16 '18 22:03 gamkiller77

All test for me worked I am now up and working but update your code Ryan.

gamkiller77 avatar Mar 16 '18 22:03 gamkiller77

I am using Cachet (latest official image) in Openshift cluster (3.6 and 3.7) without the change.

I am using my own template. Is it possible that there is a problem with your OpenShift template?

cit1zen avatar Apr 06 '18 16:04 cit1zen