exadel-inc / CompreFace

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

"Sorry, something went wrong" with Sign Up on DigitalOcean hosted docker droplet #924

Open robdevil opened 1 year ago

robdevil commented 1 year ago

The error seems to be happening in the compreface-ui when I attempt to Sign Up after running the installation process.

The first series of errors I think is occurring before I attempt to register. I have replaced my ip address below for privacy reasons.

Why is the code attempting to call the ip addresses 151.210.164.7 and 172.20.0.4. 172.20.0.4 is the IP address of the docker container for compreface-fe (compreface-ui). I can't figure out which contained the 151.210.164.7 IP address belongs to.

The error below appears several times "connect() failed (111: Connection refused) while connecting to upstream, client..."

compreface-ui | /docker-entrypoint.sh: /docker-entrypoint.d/ is not empty, will attempt to perform configuration compreface-ui | /docker-entrypoint.sh: Looking for shell scripts in /docker-entrypoint.d/ compreface-ui | /docker-entrypoint.sh: Launching /docker-entrypoint.d/10-listen-on-ipv6-by-default.sh compreface-ui | 10-listen-on-ipv6-by-default.sh: info: /etc/nginx/conf.d/default.conf is not a file or does not exist compreface-ui | /docker-entrypoint.sh: Launching /docker-entrypoint.d/20-envsubst-on-templates.sh compreface-ui | 20-envsubst-on-templates.sh: Running envsubst on /etc/nginx/templates/nginx.conf.template to /etc/nginx/conf.d/nginx.conf compreface-ui | /docker-entrypoint.sh: Launching /docker-entrypoint.d/30-tune-worker-processes.sh compreface-ui | /docker-entrypoint.sh: Configuration complete; ready for start up compreface-ui | 151.210.164.7 - - [19/Oct/2022:05:51:39 +0000] "GET /sign-up HTTP/1.1" 200 1077 "-" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/16.0 Safari/605.1.15" compreface-ui | 2022/10/19 05:51:40 [error] 27#27: *1 connect() failed (111: Connection refused) while connecting to upstream, client: 151.210.164.7, server: ui, request: "GET /api/v1/consistence/status HTTP/1.1", upstream: "http://172.20.0.4:8080/api/v1/consistence/status", host: "<my-ip-address>:8000", referrer: "http://<my-ip-address>:8000/sign-up" compreface-ui | 151.210.164.7 - - [19/Oct/2022:05:51:40 +0000] "GET /api/v1/consistence/status HTTP/1.1" 502 150 "http://<my-ip-address>:8000/sign-up" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/16.0 Safari/605.1.15" compreface-ui | 2022/10/19 05:51:43 [error] 27#27: *1 connect() failed (111: Connection refused) while connecting to upstream, client: 151.210.164.7, server: ui, request: "GET /api/v1/consistence/status HTTP/1.1", upstream: "http://172.20.0.4:8080/api/v1/consistence/status", host: "<my-ip-address>:8000", referrer: "http://<my-ip-address>:8000/login" compreface-ui | 151.210.164.7 - - [19/Oct/2022:05:51:43 +0000] "GET /api/v1/consistence/status HTTP/1.1" 502 150 "http://<my-ip-address>:8000/login" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/16.0 Safari/605.1.15" compreface-ui | 2022/10/19 05:51:45 [error] 27#27: *1 connect() failed (111: Connection refused) while connecting to upstream, client: 151.210.164.7, server: ui, request: "GET /api/v1/consistence/status HTTP/1.1", upstream: "http://172.20.0.4:8080/api/v1/consistence/status", host: "<my-ip-address>:8000", referrer: "http://<my-ip-address>:8000/sign-up"

And when I click on Sign Up these are the errors produced.

compreface-ui | 151.210.164.7 - - [19/Oct/2022:05:51:45 +0000] "GET /api/v1/consistence/status HTTP/1.1" 502 150 "http://<my-ip-address>:8000/sign-up" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/16.0 Safari/605.1.15" compreface-ui | 2022/10/19 05:52:11 [error] 27#27: *1 connect() failed (111: Connection refused) while connecting to upstream, client: 151.210.164.7, server: ui, request: "POST /admin/user/register HTTP/1.1", upstream: "http://172.20.0.5:8080/user/register", host: "<my-ip-address>:8000", referrer: "http://<my-ip-address>:8000/sign-up"

To Reproduce Steps to reproduce the behavior: 1.) Create a new droplet on DigitalOcean with Docker 19.03.12 on Ubuntu 20.4 (there is a pre-existing install). This also installed Docker Compose by default. 2.) Download CompreFace_1.1.0.zip archive or run: wget -q -O tmp.zip 'https://github.com/exadel-inc/CompreFace/releases/download/v1.1.0/CompreFace_1.1.0.zip' && unzip tmp.zip && rm tmp.zip 3.) To start CompreFace run: docker-compose up -d 4.) Open in your browser: http://:8000/login 5.) Click on Create an account 6.) Enter your details and click Sign Up

Despite nothing being run on the droplet, without any calls to compreface the droplet still runs at CPU 100% every 5 minutes.

Screen Shot 2022-10-19 at 6 58 17 PM
pospielov commented 1 year ago

I don't think the problem is with compreface-ui, as you successfully opened this page. I think the problem is with one of the other containers Could you run: docker ps docker-compose logs and share the responses?

robdevil commented 1 year ago

IPv4 address for br-1407bfeb21c7: 172.20.0.1 IPv4 address for docker0: 172.17.0.1 IPv4 address for eth0: 146.190.222.172 IPv4 address for eth0: 10.10.0.5 IPv4 address for eth1: 10.116.0.2

The REST call to admin/user/register in the browser to the api returns an error "Failed to load resource: the server responded with a status of 502 (Bad Gateway)"

Screen Shot 2022-10-22 at 8 41 54 PM

Result from docker-compose logs from today:

compreface-api | Listening for transport dtsocket at address: 5005 compreface-api | compreface-api | . ____ compreface-api | /\ / __' () _ \ \ \ \ compreface-api | ( ( )_ | ' | '| | ' \/ ` | \ \ \ \ compreface-api | \/ _)| |)| | | | | || (| | ) ) ) ) compreface-api | ' |__| .|| ||| |\, | / / / / compreface-api | =========|_|==============|_/=///_/ compreface-api | :: Spring Boot :: (v2.5.13) compreface-api | compreface-api | 2022-10-22 07:40:40.110 INFO 6 --- [ main] com.exadel.frs.TrainServiceApplication : Starting TrainServiceApplication v0.0.1-SNAPSHOT using Java 11.0.8 on 962a16485a81 with PID 6 (/home/app.jar started by root in /) compreface-api | 2022-10-22 07:40:40.146 INFO 6 --- [ main] com.exadel.frs.TrainServiceApplication : The following 1 profile is active: "dev" compreface-api | 2022-10-22 07:40:40.691 WARN 6 --- [ main] o.s.b.c.config.ConfigDataEnvironment : Property 'spring.profiles' imported from location 'class path resource [application.yml]' is invalid and should be replaced with 'spring.config.activate.on-profile' [origin: class path resource [application.yml] from app.jar - 94:13] compreface-api | 2022-10-22 07:40:51.105 INFO 6 --- [ main] .s.d.r.c.RepositoryConfigurationDelegate : Bootstrapping Spring Data JPA repositories in DEFAULT mode. compreface-api | 2022-10-22 07:40:52.028 INFO 6 --- [ main] .s.d.r.c.RepositoryConfigurationDelegate : Finished Spring Data repository scanning in 825 ms. Found 8 JPA repository interfaces. compreface-api | 2022-10-22 07:40:57.799 INFO 6 --- [ main] o.s.cloud.context.scope.GenericScope : BeanFactory id=9776d44d-52e1-38dc-b671-bd86977f22bf compreface-api | 2022-10-22 07:41:01.543 INFO 6 --- [ main] trationDelegate$BeanPostProcessorChecker : Bean 'cacheConfig' of type [com.exadel.frs.core.trainservice.config.CacheConfig$$EnhancerBySpringCGLIB$$8de28b80] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying) compreface-api | 2022-10-22 07:41:05.271 INFO 6 --- [ main] o.s.b.w.embedded.tomcat.TomcatWebServer : Tomcat initialized with port(s): 8080 (http) compreface-api | 2022-10-22 07:41:05.376 INFO 6 --- [ main] o.a.coyote.http11.Http11NioProtocol : Initializing ProtocolHandler ["http-nio-8080"] compreface-api | 2022-10-22 07:41:05.378 INFO 6 --- [ main] o.apache.catalina.core.StandardService : Starting service [Tomcat] compreface-api | 2022-10-22 07:41:05.379 INFO 6 --- [ main] org.apache.catalina.core.StandardEngine : Starting Servlet engine: [Apache Tomcat/9.0.62] compreface-api | 2022-10-22 07:41:06.187 INFO 6 --- [ main] o.a.c.c.C.[Tomcat].[localhost].[/] : Initializing Spring embedded WebApplicationContext compreface-api | 2022-10-22 07:41:06.188 INFO 6 --- [ main] w.s.c.ServletWebServerApplicationContext : Root WebApplicationContext: initialization completed in 25483 ms compreface-api | 2022-10-22 07:41:10.416 INFO 6 --- [ main] o.hibernate.jpa.internal.util.LogHelper : HHH000204: Processing PersistenceUnitInfo [name: default] compreface-api | 2022-10-22 07:41:11.266 INFO 6 --- [ main] org.hibernate.Version : HHH000412: Hibernate ORM core version 5.4.33 compreface-api | 2022-10-22 07:41:11.281 INFO 6 --- [ main] org.hibernate.cfg.Environment : HHH000205: Loaded properties from resource hibernate.properties: {hibernate.bytecode.use_reflection_optimizer=false, hibernate.types.print.banner=false} compreface-api | 2022-10-22 07:41:13.269 INFO 6 --- [ main] o.hibernate.annotations.common.Version : HCANN000001: Hibernate Commons Annotations {5.1.2.Final} compreface-api | 2022-10-22 07:41:18.356 INFO 6 --- [ main] com.zaxxer.hikari.HikariDataSource : HikariPool-1 - Starting... compreface-api | 2022-10-22 07:41:18.766 INFO 6 --- [ main] com.zaxxer.hikari.HikariDataSource : HikariPool-1 - Start completed. compreface-api | 2022-10-22 07:41:18.853 INFO 6 --- [ main] org.hibernate.dialect.Dialect : HHH000400: Using dialect: org.hibernate.dialect.PostgreSQL10Dialect compreface-api | 2022-10-22 07:41:21.080 INFO 6 --- [ main] o.h.validator.internal.util.Version : HV000001: Hibernate Validator 6.2.3.Final compreface-api | Killed compreface-api | Listening for transport dt_socket at address: 5005 compreface-api | compreface-api | . __ _ compreface-api | /\ / ' () _ \ \ \ \ compreface-api | ( ( )_ | ' | '| | ' \/ ` | \ \ \ \ compreface-api | \/ )| |)| | | | | || (_| | ) ) ) ) compreface-api | ' |__| .|| ||| |_, | / / / / compreface-api | =========||==============|__/=//// compreface-api | :: Spring Boot :: (v2.5.13) compreface-api | compreface-api | 2022-10-22 07:42:00.873 INFO 6 --- [ main] com.exadel.frs.TrainServiceApplication : Starting TrainServiceApplication v0.0.1-SNAPSHOT using Java 11.0.8 on 962a16485a81 with PID 6 (/home/app.jar started by root in /) compreface-api | 2022-10-22 07:42:00.906 INFO 6 --- [ main] com.exadel.frs.TrainServiceApplication : The following 1 profile is active: "dev" compreface-api | 2022-10-22 07:42:01.347 WARN 6 --- [ main] o.s.b.c.config.ConfigDataEnvironment : Property 'spring.profiles' imported from location 'class path resource [application.yml]' is invalid and should be replaced with 'spring.config.activate.on-profile' [origin: class path resource [application.yml] from app.jar - 94:13] compreface-api | 2022-10-22 07:42:08.910 INFO 6 --- [ main] .s.d.r.c.RepositoryConfigurationDelegate : Bootstrapping Spring Data JPA repositories in DEFAULT mode. compreface-api | 2022-10-22 07:42:09.864 INFO 6 --- [ main] .s.d.r.c.RepositoryConfigurationDelegate : Finished Spring Data repository scanning in 845 ms. Found 8 JPA repository interfaces. compreface-api | 2022-10-22 07:42:13.991 INFO 6 --- [ main] o.s.cloud.context.scope.GenericScope : BeanFactory id=9776d44d-52e1-38dc-b671-bd86977f22bf compreface-api | 2022-10-22 07:42:17.111 INFO 6 --- [ main] trationDelegate$BeanPostProcessorChecker : Bean 'cacheConfig' of type [com.exadel.frs.core.trainservice.config.CacheConfig$$EnhancerBySpringCGLIB$$55e6c6c] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying) compreface-api | 2022-10-22 07:42:19.812 INFO 6 --- [ main] o.s.b.w.embedded.tomcat.TomcatWebServer : Tomcat initialized with port(s): 8080 (http) compreface-api | 2022-10-22 07:42:19.880 INFO 6 --- [ main] o.a.coyote.http11.Http11NioProtocol : Initializing ProtocolHandler ["http-nio-8080"] compreface-api | 2022-10-22 07:42:19.881 INFO 6 --- [ main] o.apache.catalina.core.StandardService : Starting service [Tomcat] compreface-api | 2022-10-22 07:42:19.882 INFO 6 --- [ main] org.apache.catalina.core.StandardEngine : Starting Servlet engine: [Apache Tomcat/9.0.62] compreface-api | 2022-10-22 07:42:20.423 INFO 6 --- [ main] o.a.c.c.C.[Tomcat].[localhost].[/] : Initializing Spring embedded WebApplicationContext compreface-api | 2022-10-22 07:42:20.424 INFO 6 --- [ main] w.s.c.ServletWebServerApplicationContext : Root WebApplicationContext: initialization completed in 19073 ms compreface-api | 2022-10-22 07:42:23.537 INFO 6 --- [ main] o.hibernate.jpa.internal.util.LogHelper : HHH000204: Processing PersistenceUnitInfo [name: default] compreface-api | 2022-10-22 07:42:24.554 INFO 6 --- [ main] org.hibernate.Version : HHH000412: Hibernate ORM core version 5.4.33 compreface-api | 2022-10-22 07:42:24.575 INFO 6 --- [ main] org.hibernate.cfg.Environment : HHH000205: Loaded properties from resource hibernate.properties: {hibernate.bytecode.use_reflection_optimizer=false, hibernate.types.print.banner=false} compreface-api | 2022-10-22 07:42:26.465 INFO 6 --- [ main] o.hibernate.annotations.common.Version : HCANN000001: Hibernate Commons Annotations {5.1.2.Final} compreface-api | compreface-api | . _ compreface-api | /\ / __' () _ \ \ \ \ compreface-api | ( ( )__ | ' | '| | ' \/ _` | \ \ \ \ compreface-api | \/ _)| |)| | | | | || (| | ) ) ) ) compreface-api | ' |__| .|| ||| |\, | / / / / compreface-api | =========|_|==============|__/=//// compreface-api | :: Spring Boot :: (v2.5.13) compreface-api | compreface-api | 2022-10-22 07:43:48.006 INFO 7 --- [ main] com.exadel.frs.TrainServiceApplication : Starting TrainServiceApplication v0.0.1-SNAPSHOT using Java 11.0.8 on 962a16485a81 with PID 7 (/home/app.jar started by root in /) compreface-api | 2022-10-22 07:43:48.018 INFO 7 --- [ main] com.exadel.frs.TrainServiceApplication : The following 1 profile is active: "dev" compreface-api | 2022-10-22 07:43:48.474 WARN 7 --- [ main] o.s.b.c.config.ConfigDataEnvironment : Property 'spring.profiles' imported from location 'class path resource [application.yml]' is invalid and should be replaced with 'spring.config.activate.on-profile' [origin: class path resource [application.yml] from app.jar - 94:13] compreface-api | 2022-10-22 07:43:56.084 INFO 7 --- [ main] .s.d.r.c.RepositoryConfigurationDelegate : Bootstrapping Spring Data JPA repositories in DEFAULT mode. compreface-api | 2022-10-22 07:43:57.061 INFO 7 --- [ main] .s.d.r.c.RepositoryConfigurationDelegate : Finished Spring Data repository scanning in 875 ms. Found 8 JPA repository interfaces. compreface-api | 2022-10-22 07:44:01.438 INFO 7 --- [ main] o.s.cloud.context.scope.GenericScope : BeanFactory id=9776d44d-52e1-38dc-b671-bd86977f22bf compreface-api | 2022-10-22 07:44:04.367 INFO 7 --- [ main] trationDelegate$BeanPostProcessorChecker : Bean 'cacheConfig' of type [com.exadel.frs.core.trainservice.config.CacheConfig$$EnhancerBySpringCGLIB$$50285fb4] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying) compreface-api | 2022-10-22 07:44:07.673 INFO 7 --- [ main] o.s.b.w.embedded.tomcat.TomcatWebServer : Tomcat initialized with port(s): 8080 (http) compreface-api | 2022-10-22 07:44:07.742 INFO 7 --- [ main] o.a.coyote.http11.Http11NioProtocol : Initializing ProtocolHandler ["http-nio-8080"] compreface-api | 2022-10-22 07:44:07.744 INFO 7 --- [ main] o.apache.catalina.core.StandardService : Starting service [Tomcat] compreface-api | 2022-10-22 07:44:07.745 INFO 7 --- [ main] org.apache.catalina.core.StandardEngine : Starting Servlet engine: [Apache Tomcat/9.0.62] compreface-api | 2022-10-22 07:44:08.291 INFO 7 --- [ main] o.a.c.c.C.[Tomcat].[localhost].[/] : Initializing Spring embedded WebApplicationContext compreface-api | 2022-10-22 07:44:08.295 INFO 7 --- [ main] w.s.c.ServletWebServerApplicationContext : Root WebApplicationContext: initialization completed in 19817 ms compreface-api | 2022-10-22 07:44:11.306 INFO 7 --- [ main] o.hibernate.jpa.internal.util.LogHelper : HHH000204: Processing PersistenceUnitInfo [name: default] compreface-api | 2022-10-22 07:44:12.447 INFO 7 --- [ main] org.hibernate.Version : HHH000412: Hibernate ORM core version 5.4.33 compreface-api | 2022-10-22 07:44:12.469 INFO 7 --- [ main] org.hibernate.cfg.Environment : HHH000205: Loaded properties from resource hibernate.properties: {hibernate.bytecode.use_reflection_optimizer=false, hibernate.types.print.banner=false} compreface-api | 2022-10-22 07:44:14.133 INFO 7 --- [ main] o.hibernate.annotations.common.Version : HCANN000001: Hibernate Commons Annotations {5.1.2.Final} compreface-api | Killed root@docker-CompreFace:~#

robdevil commented 1 year ago

I've done a bit more testing and was able to install CompreFace on a Vultr docker instance without any difficulty. Had a couple of out of memory issues because I used a tiny configuration, but CompreFace ran perfectly. By default, Vultr doesn't create firewalls for everything. I'm wondering if the default action of DigitalOcean blocking all ports could be the reason for the errors. I tried opening up ports 8080 and 8000 which are blocked by default but this didn't seem to make a difference. I then switched off the firewall completely and still had the same error making my request from the webbrowser. Still getting Error 502, 'Bad Gateway', url: 'http://:8000/api/v1/consistence/status'

pospielov commented 1 year ago

There is a chance DigitalOcean doesn't support the AVX technology required for CompreFace. But from your screenshot and logs, I see that compreface-core service is running. And I don't see compreface-core logs. I don't think that the problem is with the firewall. By default, only one port is exposed, from what I see, you mapped it to 80 ports. CompreFace UI should send requests only to this port, so I think it should work as soon as you see UI.