acedanger

acedanger / docker debugging statements

Last active 22 hours ago

Like 0

Revision dee913b53ce1ea5b6b60bf5cb81ef3f090c09e7e

Additional debugging Raw
1TL;DR: A 502 Bad Gateway from Pangolin means the proxy can reach the network boundary, but nothing is successfully answering on the target IP and port. Hugo is either crashing on startup, failing to bind properly due to permissions or missing files, or Pangolin is pointed at the wrong internal port (e.g., expecting 80 instead of 1313).
2Here is how you dig into this crawl and squash the bug:
3 * Check the Container Runtime Status & Logs:
4 * Run docker ps -a --filter name=blog to verify the container is actually Up and not stuck in a restart loop.
5 * Inspect the container logs:
6 docker logs blog --tail 50
7
8 * Watch out for: Hugo building errors, missing themes, or permissions errors (especially since you forced user: "1000:1000" over the bind-mounted /src).
9 * Verify Pangolin's Target Port:
10 * Hugo is serving on port 1313, but most reverse proxy site definitions default to 80.
11 * Check your Pangolin resource config or dashboard for word.ptrwd.com.
12 * Ensure the upstream destination is explicitly set to http://blog:1313 (or the container's IP on port 1313), not http://blog:80.
13 * Test Network Reachability from Inside the Network:
14 * Spawn a temporary curl container on the pangolin network to see if the webserver actually responds to HTTP requests:
15 docker run --rm --network pangolin curlimages/curl -Iv http://blog:1313
16
17 * If curl returns Connection refused, Hugo is not listening on 0.0.0.0:1313.
18 * If it resolves and returns HTTP/2 200 or HTTP/1.1 200, the issue lies strictly inside Pangolin's upstream routing or SSL offloading rules.
19 * Check Pangolin Reverse Proxy Logs:
20 * Check the logs of your Pangolin container to see what IP and port it is attempting to hit when throwing the 502:
21 docker logs <pangolin_container_name> --tail 50
22
23 * Look for connection timeouts, DNS resolution failures for blog, or connection resets.
24
docker debugging Raw
1
2sudo systemctl enable --now docker
3docker compose -f /home/acedanger/docker/pangolin/docker-compose.yml up -d pangolin gerbil
4
5# Fastest fix: strip restart policies before testing
6
7systemctl start docker
8docker ps -a # see what just came up
9docker stop $(docker ps -q) # stop everything immediately
10docker update --restart=no $(docker ps -aq) # clear the restart policy on all containers
11
12# run a curl image connected to the pangolin network and attempt to connect using the same host:port nomenclature as the resource settings in pangolin
13docker run --rm --network pangolin curlimages/curl -Iv http://blog:1313
14