tiredofit / docker-fusiondirectory

Dockerized web based LDAP manager
MIT License
48 stars 18 forks source link

`docker-compose up` creates errors after first boot #47

Closed tareko closed 2 years ago

tareko commented 2 years ago

Summary

Two errors exist in the current docker image.

  1. rest.template is written in multiple times, which means it causes an error after first boot and no web service
  2. /etc/php-fpm/fpm/php-fpm.conf has a string added to the last line with each boot, causing FPM to not start.

Steps to reproduce

  1. docker-compose up -d
  2. docker-compose stop
  3. docker-compose up

What is the expected correct behavior?

FD should boot up and become accessible

Environment

Possible fixes

Regarding the first error, a workaround is:

  1. Comment out the following line: https://github.com/tiredofit/docker-fusiondirectory/blob/cb88185fdc339fcf1345568d1518b1d30e8f6490/install/etc/cont-init.d/40-fusiondirectory#L51
  2. Add the following line to install/etc/nginx/conf.d/default.conf: include /etc/nginx/conf.available/rest.template;
  3. Rebuild image: docker build . -t tiredofit/fusiondirectory:1.4

Regarding the second error, I have no fix. This is how the error manifests when looking at the last line of /etc/php-fpm/fpm/php-fpm.conf:

access.format='%{%Y-%m-%dT%H:%M:%S%z}T %{HTTP_X_FORWARDED_FOR}e %R %u %s %m "%{REQUEST_URI}e" %{HTTP_X_REQUEST_ID}e %{SERVER_PROTOCOL}e %l "%{HTTP_REFERER}e" "%{HTTP_USER_AGENT}e" %M %C %d'access.format='%{%Y-%m-%dT%H:%M:%S%z}T %{HTTP_X_FORWARDED_FOR}e %R %u %s %m "%{REQUEST_URI}e" %{HTTP_X_REQUEST_ID}e %{SERVER_PROTOCOL}e %l "%{HTTP_REFERER}e" "%{HTTP_USER_AGENT}e" %M %C %d'access.format='%{%Y-%m-%dT%H:%M:%S%z}T %{HTTP_X_FORWARDED_FOR}e %R %u %s %m "%{REQUEST_URI}e" %{HTTP_X_REQUEST_ID}e %{SERVER_PROTOCOL}e %l "%{HTTP_REFERER}e" "%{HTTP_USER_AGENT}e" %M %C %d'

Note that the correct line is repeated multiple times. I can't find the origin of this particular error.

One workaround here is to do docker-compose down then docker-compose up each time.

tiredofit commented 2 years ago

Hi thanks. Interesting I am tracking a similar issue over in another repo. The difference with yours is you are doing a first boot and seeing issues.

In your logs can you see if the following is present? I think if the container isn't fully stopped (docker-compose down as you say) then it will write the access log directive multiple times (which happens here: https://github.com/tiredofit/docker-nginx-php-fpm/blob/9cf2fb7f79f1e49190c3060c232aca84d599094f/install/etc/cont-init.d/20-php-fpm#L87)

[cont-init.d] 00-startup: executing...
�[100m[NOTICE]�[49m ** [container-init] Detected Container that has been restarted - Cleaning '/tmp/state' files
tiredofit commented 2 years ago

For your first report - You would want to set the following environment variables:

PLUGIN_WEBSERVICE=FALSE
PLUGIN_REST=FALSE

I think I know exactly whats going on here and I am building a new version of the upstream image (tiredofit/nginx-php-fpm). Following successful build I will make a new build of tiredofit/fusiondirectory which should alleviate this. Although to close the loop and satisfy my curiosity if you could let me know if you see that string above.

tiredofit commented 2 years ago

New image should be available and fix above issues, let me know.

tareko commented 2 years ago

Hello friend. My apologies for the radio silence. I was in the middle of a busy time at work. You have fixed the issue!

I tried to replicate it by doing docker-compose up, ctrl-c to close once up, then docker-compose up. There are no issues.

I deleted the image for fusiondirectory (docker rmi) before issuing the up command to ensure it downloaded the new image.

Thank you so much for this! I'll mark as closed successfully for now.

tiredofit commented 2 years ago

Fantastic!