Cannot access Dokploy dashboard on domain. How can I debug CloudFlare bad gateway error?

I use a VPS on Hetzner and a domain on CloudFlare. I have two A records on Cloudflare pointing to the IP address of the server. 1. *.domain.com 2. domain.com In Dokploy I successfuly deployed an app and specified the domain to be domain.com. I also specified the Dokploy domain to be available on dokploy.domain.com in Dokploy settings. This setup worked this week. I stopped and started the server on Hetzner. While the app is still available on domain.com I no longer can access the Dokploy dashobard on dokploy.domain.com. I am getting a bad gateway error from CloudFlare:
Bad gateway Error code 502
Visit cloudflare.com for more information.
2024-08-28 13:59:35 UTC
Bad gateway Error code 502
Visit cloudflare.com for more information.
2024-08-28 13:59:35 UTC
Restarting the VPS doesn't help. And Im unsure of how to debug this, any help is welcome. The dokploy.domain.com worked this week without problems. I am unsure of what caused the issue to happen. - Why would a VPS restart cause this? - I think cleaning the storage in Settings might have caused this? But I don't know... I use Dokploy v0.7.2.
6 Replies
Bunny
Bunny9mo ago
Check traefik logs, I had invalid configuration in one application and after restart some applications was not reachable
Siumauricio
Siumauricio9mo ago
Try to run this: 1. docker service ls 2. docker service logs dokplo-traefik as @Bunny said if you have invalid traefik configuration you run in the risk of losing the access to domains
Bunny
Bunny9mo ago
Typo in second command docker service logs dokploy-traefik
predragnikolic
predragnikolicOP9mo ago
Thank you @Bunny @Siumauricio unfortunately in turn of events, I won't be able to try you suggestion until next week. Here is the output of docker service logs dokploy-traefik
dokploy-traefik.1.ux806yn2ff9q@knjizara-server | time="2024-08-28T13:41:35Z" level=info msg="Configuration loaded from file: /etc/traefik/traefik.yml"
dokploy-traefik.1.1v6jrrzzjljy@knjizara-server | time="2024-08-28T13:58:56Z" level=info msg="Configuration loaded from file: /etc/traefik/traefik.yml"
dokploy-traefik.1.rm9x102xksek@knjizara-server | time="2024-08-28T13:47:47Z" level=info msg="Configuration loaded from file: /etc/traefik/traefik.yml"
dokploy-traefik.1.x5omrql3om9w@knjizara-server | time="2024-08-28T12:35:48Z" level=info msg="Configuration loaded from file: /etc/traefik/traefik.yml"
dokploy-traefik.1.x5omrql3om9w@knjizara-server | time="2024-08-28T12:44:01Z" level=error msg="accept tcp [::]:80: use of closed network connection" entryPointName=web
dokploy-traefik.1.x5omrql3om9w@knjizara-server | time="2024-08-28T12:44:01Z" level=error msg="Error while starting server: accept tcp [::]:80: use of closed network connection" entryPointName=web
dokploy-traefik.1.x5omrql3om9w@knjizara-server | time="2024-08-28T12:44:01Z" level=error msg="accept tcp [::]:8080: use of closed network connection" entryPointName=traefik
dokploy-traefik.1.x5omrql3om9w@knjizara-server | time="2024-08-28T12:44:01Z" level=error msg="accept tcp [::]:443: use of closed network connection" entryPointName=websecure
dokploy-traefik.1.x5omrql3om9w@knjizara-server | time="2024-08-28T12:44:01Z" level=error msg="Error while starting server: accept tcp [::]:443: use of closed network connection" entryPointName=websecure
dokploy-traefik.1.x5omrql3om9w@knjizara-server | time="2024-08-28T12:44:01Z" level=error msg="close tcp [::]:8080: use of closed network connection" entryPointName=traefik
dokploy-traefik.1.l9bc0joduama@knjizara-server | time="2024-08-28T12:46:55Z" level=info msg="Configuration loaded from file: /etc/traefik/traefik.yml"
dokploy-traefik.1.ux806yn2ff9q@knjizara-server | time="2024-08-28T13:41:35Z" level=info msg="Configuration loaded from file: /etc/traefik/traefik.yml"
dokploy-traefik.1.1v6jrrzzjljy@knjizara-server | time="2024-08-28T13:58:56Z" level=info msg="Configuration loaded from file: /etc/traefik/traefik.yml"
dokploy-traefik.1.rm9x102xksek@knjizara-server | time="2024-08-28T13:47:47Z" level=info msg="Configuration loaded from file: /etc/traefik/traefik.yml"
dokploy-traefik.1.x5omrql3om9w@knjizara-server | time="2024-08-28T12:35:48Z" level=info msg="Configuration loaded from file: /etc/traefik/traefik.yml"
dokploy-traefik.1.x5omrql3om9w@knjizara-server | time="2024-08-28T12:44:01Z" level=error msg="accept tcp [::]:80: use of closed network connection" entryPointName=web
dokploy-traefik.1.x5omrql3om9w@knjizara-server | time="2024-08-28T12:44:01Z" level=error msg="Error while starting server: accept tcp [::]:80: use of closed network connection" entryPointName=web
dokploy-traefik.1.x5omrql3om9w@knjizara-server | time="2024-08-28T12:44:01Z" level=error msg="accept tcp [::]:8080: use of closed network connection" entryPointName=traefik
dokploy-traefik.1.x5omrql3om9w@knjizara-server | time="2024-08-28T12:44:01Z" level=error msg="accept tcp [::]:443: use of closed network connection" entryPointName=websecure
dokploy-traefik.1.x5omrql3om9w@knjizara-server | time="2024-08-28T12:44:01Z" level=error msg="Error while starting server: accept tcp [::]:443: use of closed network connection" entryPointName=websecure
dokploy-traefik.1.x5omrql3om9w@knjizara-server | time="2024-08-28T12:44:01Z" level=error msg="close tcp [::]:8080: use of closed network connection" entryPointName=traefik
dokploy-traefik.1.l9bc0joduama@knjizara-server | time="2024-08-28T12:46:55Z" level=info msg="Configuration loaded from file: /etc/traefik/traefik.yml"
Here is a prettified version of the logs:
"Error while starting server: accept tcp [::]:80: use of closed network connection" entryPointName=web
"accept tcp [::]:8080: use of closed network connection" entryPointName=traefik
"accept tcp [::]:443: use of closed network connection" entryPointName=websecure
"Error while starting server: accept tcp [::]:443: use of closed network connection" entryPointName=websecure
"close tcp [::]:8080: use of closed network connection" entryPointName=traefik
Configuration loaded from file: /etc/traefik/traefik.yml
"Error while starting server: accept tcp [::]:80: use of closed network connection" entryPointName=web
"accept tcp [::]:8080: use of closed network connection" entryPointName=traefik
"accept tcp [::]:443: use of closed network connection" entryPointName=websecure
"Error while starting server: accept tcp [::]:443: use of closed network connection" entryPointName=websecure
"close tcp [::]:8080: use of closed network connection" entryPointName=traefik
Configuration loaded from file: /etc/traefik/traefik.yml
Here are the things running on port 80, 443, 8080:
root@knjizara-server:~# sudo lsof -i :80
COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME
docker-pr 1727 root 4u IPv4 10037 0t0 TCP *:http (LISTEN)
docker-pr 1739 root 4u IPv6 10042 0t0 TCP *:http (LISTEN)
root@knjizara-server:~# sudo lsof -i :443
COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME
docker-pr 1603 root 4u IPv4 10532 0t0 TCP *:https (LISTEN)
docker-pr 1613 root 4u IPv6 9911 0t0 TCP *:https (LISTEN)
root@knjizara-server:~# sudo lsof -i :8080
root@knjizara-server:~#
root@knjizara-server:~# sudo lsof -i :80
COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME
docker-pr 1727 root 4u IPv4 10037 0t0 TCP *:http (LISTEN)
docker-pr 1739 root 4u IPv6 10042 0t0 TCP *:http (LISTEN)
root@knjizara-server:~# sudo lsof -i :443
COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME
docker-pr 1603 root 4u IPv4 10532 0t0 TCP *:https (LISTEN)
docker-pr 1613 root 4u IPv6 9911 0t0 TCP *:https (LISTEN)
root@knjizara-server:~# sudo lsof -i :8080
root@knjizara-server:~#
Here is how the /etc/traefik/traefik.yml looks like
providers:
docker:
exposedByDefault: false
file:
directory: /etc/dokploy/traefik/dynamic
watch: true
entryPoints:
web:
address: ':80'
websecure:
address: ':443'
http:
tls:
certResolver: letsencrypt
api:
insecure: true
certificatesResolvers:
letsencrypt:
acme:
storage: /etc/dokploy/traefik/dynamic/acme.json
httpChallenge:
entryPoint: web
providers:
docker:
exposedByDefault: false
file:
directory: /etc/dokploy/traefik/dynamic
watch: true
entryPoints:
web:
address: ':80'
websecure:
address: ':443'
http:
tls:
certResolver: letsencrypt
api:
insecure: true
certificatesResolvers:
letsencrypt:
acme:
storage: /etc/dokploy/traefik/dynamic/acme.json
httpChallenge:
entryPoint: web
predragnikolic
predragnikolicOP9mo ago
Stack Overflow
docker-pr proc already listening on port 80? Installed docker with ...
I ran this: docker run -ti -p 80:80 --name esproxy "$tag" but I get this error: docker: Error response from daemon: driver failed programming external connectivity on endpoint esproxy (
predragnikolic
predragnikolicOP9mo ago
Well I f*** up I think I will just reinstall Dokploy

Did you find this page helpful?