loculus-project / loculus

An open-source software package to power microbial genomic databases
https://loculus.org
GNU Affero General Public License v3.0
35 stars 2 forks source link

BUG: Backend not reachable when setting up with `docker compose up` #242

Closed corneliusroemer closed 1 year ago

corneliusroemer commented 1 year ago

I followed the documentation to set up the backend locally. It doesn't work anymore, http://127.0.0.1:8079/swagger-ui/index.html responds with ERR_CONNECTION_REFUSED

Steps I've taken:

  1. export DOCKER_DEFAULT_PLATFORM=linux/amd64
  2. docker pull ghcr.io/pathoplexus/backend
  3. DOCKER_IMAGE_NAME=ghcr.io/pathoplexus/backend:latest docker compose up

Logs:

$ DOCKER_IMAGE_NAME=ghcr.io/pathoplexus/backend:latest docker compose up
[+] Running 2/2
 ✔ Container backend-database-1  Recreated                                                                                              0.4s 
 ✔ Container backend-backend-1   Recreated                                                                                              0.1s 
Attaching to backend-backend-1, backend-database-1
backend-backend-1   | Setting Active Processor Count to 6
backend-database-1  | 
backend-database-1  | PostgreSQL Database directory appears to contain a database; Skipping initialization
backend-database-1  | 
backend-database-1  | 
backend-database-1  | 2023-09-12 18:00:26.971 UTC [1] LOG:  starting PostgreSQL 15.4 (Debian 15.4-1.pgdg120+1) on x86_64-pc-linux-gnu, compiled by gcc (Debian 12.2.0-14) 12.2.0, 64-bit
backend-database-1  | 2023-09-12 18:00:26.975 UTC [1] LOG:  listening on IPv4 address "0.0.0.0", port 5432
backend-database-1  | 2023-09-12 18:00:26.975 UTC [1] LOG:  listening on IPv6 address "::", port 5432
backend-database-1  | 2023-09-12 18:00:27.005 UTC [1] LOG:  listening on Unix socket "/var/run/postgresql/.s.PGSQL.5432"
backend-database-1  | 2023-09-12 18:00:27.049 UTC [30] LOG:  database system was shut down at 2023-09-12 17:59:43 UTC
backend-database-1  | 2023-09-12 18:00:27.078 UTC [1] LOG:  database system is ready to accept connections
backend-backend-1   | Calculating JVM memory based on 10384828K available memory
backend-backend-1   | For more information on this calculation, see https://paketo.io/docs/reference/java-reference/#memory-calculator
backend-backend-1   | Calculated JVM Memory Configuration: -XX:MaxDirectMemorySize=10M -Xmx9783325K -XX:MaxMetaspaceSize=89502K -XX:ReservedCodeCacheSize=240M -Xss1M (Total Memory: 10384828K, Thread Count: 250, Loaded Class Count: 13388, Headroom: 0%)
backend-backend-1   | Enabling Java Native Memory Tracking
backend-backend-1   | Spring Cloud Bindings Enabled
backend-backend-1   | Picked up JAVA_TOOL_OPTIONS: -Djava.security.properties=/layers/paketo-buildpacks_bellsoft-liberica/java-security-properties/java-security.properties -XX:+ExitOnOutOfMemoryError -XX:ActiveProcessorCount=6 -XX:MaxDirectMemorySize=10M -Xmx9783325K -XX:MaxMetaspaceSize=89502K -XX:ReservedCodeCacheSize=240M -Xss1M -XX:+UnlockDiagnosticVMOptions -XX:NativeMemoryTracking=summary -XX:+PrintNMTStatistics -Dorg.springframework.cloud.bindings.boot.enable=true
backend-backend-1   | 
backend-backend-1   | 
backend-backend-1   |   .   ____          _            __ _ _
backend-backend-1   |  /\\ / ___'_ __ _ _(_)_ __  __ _ \ \ \ \
backend-backend-1   | ( ( )\___ | '_ | '_| | '_ \/ _` | \ \ \ \
backend-backend-1   |  \\/  ___)| |_)| | | | | || (_| |  ) ) ) )
backend-backend-1   |   '  |____| .__|_| |_|_| |_\__, | / / / /
backend-backend-1   |  =========|_|==============|___/=/_/_/_/
backend-backend-1   |  :: Spring Boot ::                (v3.1.3)
backend-backend-1   | 
backend-backend-1   | 

System details

macOS 13.5.2 (ARM)

TobiasKampmann commented 1 year ago

the output seems fine and the backend should be accessible under the url you mentioned.

Does the backend worked before? Is this reproducible?

theosanderson commented 1 year ago

I had a go last night and seemed to see the same issue - I haven't previously tried it so can't say if it worked before. This was on macOS (but of course through Docker)

corneliusroemer commented 1 year ago

The output seems fine and the backend should be accessible under the url you mentioned.

Unfortunately it isn't. Something with port forwarding from outside to inside?

Did the backend worked before?

Yes, when I wrote the README a month ago it worked

Is this reproducible?

Yes, it always doesn't work for me, and not for Theo either it seems. Note this is macOS 13.5.1 (ARM) - what's your system?

TobiasKampmann commented 1 year ago

Unfortunately it isn't. Something with port forwarding from outside to inside?

Currently we use the host network which does not work properly on Mac/Windows.

Solution will be using the bridge network, which should work independently from the OS.

I create a new Ticket #245 and would close this.