LemmyNet / lemmy-ansible

A docker deploy for ansible
GNU Affero General Public License v3.0
248 stars 94 forks source link

[Bug]: Getting nginx 502 bad gateway error when deploying lemmy with ansible #220

Closed 3nderall closed 6 months ago

3nderall commented 6 months ago

Requirements

Summary

When I deploy lemmy with ansible on the rpi5, nginx gives a 502 bad gateway error

Steps to Reproduce

  1. Follow the steps on the Lemmy Ansilble readme.md
  2. I modified the docker-compose.yml in /templates slightly to request the arm64 image because by default it requests an image that doesn't exist when using raspberryPiOS
  3. Run the ansible playbook

Technical Details

Proxy container logs:

/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: Getting the checksum of /etc/nginx/conf.d/default.conf
10-listen-on-ipv6-by-default.sh: info: Enabled listen on IPv6 in /etc/nginx/conf.d/default.conf
/docker-entrypoint.sh: Sourcing /docker-entrypoint.d/15-local-resolvers.envsh
/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
2024/01/20 21:32:49 [error] 29#29: *1 lemmy-ui could not be resolved (3: Host not found), client: 192.168.178.62, server: localhost, request: "GET / HTTP/1.1", host: "192.168.178.57:12373"
192.168.178.62 - - [20/Jan/2024:21:32:49 +0000] "GET / HTTP/1.1" 502 150 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:121.0) Gecko/20100101 Firefox/121.0"
2024/01/20 21:32:50 [error] 29#29: *1 lemmy-ui could not be resolved (3: Host not found), client: 192.168.178.62, server: localhost, request: "GET /favicon.ico HTTP/1.1", host: "192.168.178.57:12373", referrer: "http://192.168.178.57:12373/"
192.168.178.62 - - [20/Jan/2024:21:32:50 +0000] "GET /favicon.ico HTTP/1.1" 502 150 "http://192.168.178.57:12373/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:121.0) Gecko/20100101 Firefox/121.0"

I am on the latest RaspberryPiOS I already have NginxProxyMangaer running before the setup but it doesn't seem to be causing any issues (I think the problem is with the proxy config, which I haven't touched)

Version

0.19.2

Lemmy Instance URL

No response

3nderall commented 6 months ago

Also, if I look at the containers in portainer, they have no ports, not even internal docker ports

Nutomic commented 6 months ago

Use docker-compose logs to check for any error messages, particularly after restart.

3nderall commented 6 months ago

I have managed to deploy lemmy with a different method (lemmy-easy-deploy)