question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

No connection to backend server, try again in a few minutes.

See original GitHub issue

Ubuntu 20.04 Docker 20.10.2 Docker-compose 1.28.0

No connection to backend server, try again in a few minutes.

I have taken the docker-compose.yml from github and amended a little bit:

` networks:

libre: driver: bridge services: proxy: image: reallibrephotos/librephotos-proxy:${tag} tty: true container_name: librephotos-proxy restart: always ports: - ${httpPort}:80 networks: - libre librephotos-db: image: postgres container_name: librephotos-db restart: always environment: - POSTGRES_USER=${dbUser} - POSTGRES_PASSWORD=${dbPass} - POSTGRES_DB=${dbName} volumes: - /data/libredb/config:/var/lib/postgresql/data command: postgres -c fsync=off -c synchronous_commit=off -c full_page_writes=off -c random_page_cost=1.0 healthcheck: test: [‘CMD-SHELL’, ‘pg_isready -d $dbName -U $dbUser’] interval: 5s timeout: 5s retries: 5 networks: - libre

frontend: image: reallibrephotos/librephotos-frontend:${tag} container_name: librephotos-frontend restart: always tty: true networks: - libre

backend: image: reallibrephotos/librephotos:${tag} container_name: librephotos-backend restart: always volumes: - /mnt/data/media/pictures/mobile:/data - /mnt/data/media/libre/thumbs:/code/protected_media - /data/libre/config:/code/logs - /mnt/data/media/libre/cache:/root/.cache

environment:
  - SECRET_KEY=${shhhhKey}
  - BACKEND_HOST=backend
  - ADMIN_EMAIL=${adminEmail}
  - ADMIN_USERNAME=${userName}
  - ADMIN_PASSWORD=${userPass}
  - DEBUG=true
  - DB_BACKEND=postgresql
  - DB_NAME=${dbName}
  - DB_USER=${dbUser}
  - DB_PASS=${dbPass}
  - DB_HOST=librephotos-db
  - DB_PORT=5432
  - REDIS_HOST=librephotos-redis
  - REDIS_PORT=6379
  - MAPBOX_API_KEY=${mapApiKey}
  - TIME_ZONE=${timeZone}
  - WEB_CONCURRENCY=${gunniWorkers}
  - WORKER_TIMEOUT=${workerTimeOut}
  - SKIP_PATTERNS=${skipPatterns}

# Wait for Postgres
depends_on:
  librephotos-db:
    condition: service_healthy
networks:
  - libre

librephotos-redis: image: redis:alpine container_name: librephotos-redis restart: always networks: - libre `

The .env file:

tag=dev dbUser=libre dbPass=libre123 dbName=libre shhhhKey=c7rf4YENv3XL3hVMM5Mv adminEmail=xxx userName=xxx userPass=xxx mapApiKey= timeZone=Europe/Amsterdam gunniWorkers=2 workerTimeOut=1800 skipPatterns= httpPort=3000

All logs are looking fine.

Backend:

21:40:45 Cleaning registries for queue: default, [2021-01-22 21:40:30 +0000] [99] [INFO] Starting gunicorn 20.0.4, Running backend server..., [2021-01-22 21:40:30 +0000] [99] [INFO] Listening at: http://0.0.0.0:8001 (99), [2021-01-22 21:40:30 +0000] [99] [INFO] Using worker: gevent, [2021-01-22 21:40:30 +0000] [103] [INFO] Booting worker with pid: 103, [2021-01-22 21:40:30 +0000] [104] [INFO] Booting worker with pid: 104, 21:40:45 Worker rq:worker:f9fe87c1baec474a9df19803ce5ca77b: started, version 1.6.1, 21:40:45 Subscribing to channel rq:pubsub:f9fe87c1baec474a9df19803ce5ca77b, 21:40:45 *** Listening on default...

DB:

PostgreSQL init process complete; ready for start up., 2021-01-22 21:45:16.458 UTC [1] LOG: database system is ready to accept connections, 2021-01-22 21:45:16.454 UTC [75] LOG: database system was shut down at 2021-01-22 21:45:16 UTC, 2021-01-22 21:45:16.452 UTC [1] LOG: listening on Unix socket "/var/run/postgresql/.s.PGSQL.5432", 2021-01-22 21:45:16.451 UTC [1] LOG: listening on IPv6 address "::", port 5432, 2021-01-22 21:45:16.451 UTC [1] LOG: listening on IPv4 address "0.0.0.0", port 5432, 2021-01-22 21:45:16.451 UTC [1] LOG: starting PostgreSQL 13.1 (Debian 13.1-1.pgdg100+1) on x86_64-pc-linux-gnu, compiled by gcc (Debian 8.3.0-6) 8.3.0, 64-bit

Frontend:

│ - On Your Network: http://172.29.0.2:3000 │ , │ - Local: http://localhost:3000 │ , │ Serving! │

Proxy:

/docker-entrypoint.sh: Configuration complete; ready for start up ,/docker-entrypoint.sh: Launching /docker-entrypoint.d/20-envsubst-on-templates.sh ,10-listen-on-ipv6-by-default.sh: info: Enabled listen on IPv6 in /etc/nginx/conf.d/default.conf ,/docker-entrypoint.sh: Launching /docker-entrypoint.d/10-listen-on-ipv6-by-default.sh ,10-listen-on-ipv6-by-default.sh: info: Getting the checksum of /etc/nginx/conf.d/default.conf ,/docker-entrypoint.sh: Looking for shell scripts in /docker-entrypoint.d/ ,/docker-entrypoint.sh: /docker-entrypoint.d/ is not empty, will attempt to perform configuration

Redis:

1:C 22 Jan 2021 21:45:15.132 # oO0OoO0OoO0Oo Redis is starting oO0OoO0OoO0Oo, 1:C 22 Jan 2021 21:45:15.132 # Redis version=6.0.10, bits=64, commit=00000000, modified=0, pid=1, just started, 1:C 22 Jan 2021 21:45:15.132 # Warning: no config file specified, using the default config. In order to specify a config file use redis-server /path/to/redis.conf, 1:M 22 Jan 2021 21:45:15.134 # WARNING overcommit_memory is set to 0! Background save may fail under low memory condition. To fix this issue add 'vm.overcommit_memory = 1' to /etc/sysctl.conf and then reboot or run the command 'sysctl vm.overcommit_memory=1' for this to take effect., 1:M 22 Jan 2021 21:45:15.134 # Server initialized, 1:M 22 Jan 2021 21:45:15.134 * Running mode=standalone, port=6379., 1:M 22 Jan 2021 21:45:15.136 * Ready to accept connections

I’ve done another pull, but am I up-to-date.

Any ideas? Google only gives me old issues…

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:6 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
TheFehrcommented, Mar 9, 2021

just to followup* I’m certain this is an issue with my configuration; LibrePhotos works perfectly fine when hitting it from the local ip. The frontend is able to reach the backend without issue. My problem relates to how I’m reverse-proxying the frontend with traefik v2 and in this case, the frontend is unable to connect to the backend. Hope to revisit this when I have more time as it’s a super cool project!

Have you figured out a solution? I managed to get it set up with traefik. I believe the two most important steps were:

  1. Add 2 networks to the docker-compose file. One being the one traefik is on as well. And one with external: false for the internal communication between the librephotos components.
  2. Remove the port mapping from the proxy container and just let traefik figure out how to talk to the proxy.
0reactions
derneuerecommented, Feb 23, 2021

I am not sure how traefik is different from nginx, but we refactored all the nginx.conf’s into one file. Maybe that helps you finding that issue: https://github.com/LibrePhotos/librephotos-docker/blob/main/proxy/nginx.conf

Read more comments on GitHub >

github_iconTop Results From Across the Web

No connection to backend server #52 - hooram/ownphotos
This happens when you try and access from another host, not the localhost:3000. e.g. If the server ip is 192.168.1.10 and I go...
Read more >
LibrePhotos - A fork of OwnPhotos with video support - Reddit
The demo doesn't seem to work, got: No connection to backend server, try again in a few minutes.
Read more >
What does "Can't Connect to Server" mean, and how to fix it?
This request is routed to the backend web server via a router and an ISP, and the server responds with all of the...
Read more >
OS Recovery Tool "unable to connect to back end" - Dell
I need to reinstall Windows 10 on my daughter's Inspiron 3052, apparently due to an issue when she was trying to update Windows...
Read more >
"Cannot connect the computer to the server" error message ...
Fixes a problem in which you receive a error "Cannot connect the computer to the server" error ... or, restart the computer and...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found