exadel-inc / CompreFace

Leading free and open-source face recognition system
https://exadel.com/accelerator-showcase/compreface/
Apache License 2.0
5.69k stars 775 forks source link

Error in nginx server in cf-fe #1175

Open salembaira opened 1 year ago

salembaira commented 1 year ago

Describe the bug Error in nginx server in cf-fe

A clear and concise description of what the bug is. kubectl logs cf-fe-74c69d8f87-5v7db -n matching /docker-entrypoint.sh: /docker-entrypoint.d/ is not empty, will attempt to perform configuration /docker-entrypoint.sh: Looking for shell scripts in /docker-entrypoint.d/ /docker-entrypoint.sh: Launching /docker-entrypoint.d/10-listen-on-ipv6-by-default.sh 10-listen-on-ipv6-by-default.sh: info: /etc/nginx/conf.d/default.conf is not a file or does not exist /docker-entrypoint.sh: Launching /docker-entrypoint.d/20-envsubst-on-templates.sh 20-envsubst-on-templates.sh: Running envsubst on /etc/nginx/templates/nginx.conf.template to /etc/nginx/conf.d/nginx.conf /docker-entrypoint.sh: Launching /docker-entrypoint.d/30-tune-worker-processes.sh /docker-entrypoint.sh: Configuration complete; ready for start up 2023/09/09 23:27:49 [emerg] 1#1: "client_max_body_size" directive invalid value in /etc/nginx/conf.d/nginx.conf:18 nginx: [emerg] "client_max_body_size" directive invalid value in /etc/nginx/conf.d/nginx.conf:18

I'm using 1.2.0

toby200 commented 10 months ago

Hey, I've just updated to the latest version (1.2.0) using docker-compose (via portainer) and am seeing the same issue. Fix is below

I've tried using version 1.1.0 and that has the same issue, but version 1.0.1 works ok so have currently reverted to that. For comparison, the 1.0.1 logs show:

/docker-entrypoint.sh: /docker-entrypoint.d/ is not empty, will attempt to perform configuration /docker-entrypoint.sh: Looking for shell scripts in /docker-entrypoint.d/ /docker-entrypoint.sh: Launching /docker-entrypoint.d/10-listen-on-ipv6-by-default.sh 10-listen-on-ipv6-by-default.sh: info: /etc/nginx/conf.d/default.conf is not a file or does not exist /docker-entrypoint.sh: Launching /docker-entrypoint.d/20-envsubst-on-templates.sh /docker-entrypoint.sh: Launching /docker-entrypoint.d/30-tune-worker-processes.sh /docker-entrypoint.sh: Configuration complete; ready for start up

So the first difference appears to be this line in 1.1/1.2 that wasn't in 1.0.1: 20-envsubst-on-templates.sh: Running envsubst on /etc/nginx/templates/nginx.conf.template to /etc/nginx/conf.d/nginx.conf followed by the warning about client_max_body_size.

Looking for client_max_body_size in the code, I can see the docker-compose.yml was changed under EFRS-1186:

 environment:
      - CLIENT_MAX_BODY_SIZE=${client_max_body_size}
      became
      - CLIENT_MAX_BODY_SIZE=${max_request_size}

So basically - solution is to update your docker-compose file, and also make sure you have the latest .env variables from 1.2 branch. As of 1.2 the default variable is max_request_size = 10M. Or you could add this directly in your docker file

 environment:
      - CLIENT_MAX_BODY_SIZE=10M