Caddy reload hangs on blinking cursor

1. Caddy version (caddy version): 2.4.6

2. How I run Caddy:

# desired Caddy version
ARG VERSION=2.4.6

###########
# builder #
FROM caddy:${VERSION}-builder-alpine AS builder
ARG VERSION
RUN xcaddy build v${VERSION} \
    --with github.com/caddy-dns/cloudflare

#########
# image #
FROM caddy:${VERSION}-alpine
COPY --from=builder /usr/bin/caddy /usr/bin/caddy%

a. System environment:

OS Information 	linux x86_64 Slackware 14.2 x86_64 (post 14.2 -current)
Kernel Version 	5.10.28-Unraid
Total CPU 	16
Total memory 	16.8 GB
Version 	20.10.5 (API: 1.41)
Root directory 	/var/lib/docker
Storage Driver 	btrfs
Logging Driver 	json-file
Volume Plugins 	local
Network Plugins 	bridge, host, ipvlan, macvlan, null, overlay

b. Command:

caddy reload --config /etc/caddy/Caddyfile

c. Service/unit/compose file:

version: '3.9'

services:
  caddy:
    image: erfianugrah/caddy-cfdns:v1.2-2.4.6
    hostname: caddy
    container_name: caddy
    restart: unless-stopped
    network_mode: host
    privileged: true

    volumes:
      - /mnt/user/data/caddy/Caddyfile:/etc/caddy/Caddyfile
      - /mnt/user/data/caddy/site:/srv
      - /mnt/user/data/caddy/data:/data
      - /mnt/user/data/caddy/config:/config
    environment:
      - TZ=Asia/Singapore
      - CF_API_TOKEN=${CF_API_TOKEN}
      - EMAIL=${EMAIL}
Paste full file contents here.
Make sure backticks stay on their own lines,
and the post looks nice in the preview pane.

d. My complete Caddyfile or JSON config:

{
	email {env.EMAIL}
	acme_dns cloudflare {env.CF_API_TOKEN}
	cert_issuer acme
	http_port 80
	https_port 443
	admin localhost:2019
	debug
	log {
		level debug
		output file /var/log/access.log {
			roll_size 1gb
			roll_keep 5
			roll_keep_for 720h
		}
	}
	servers {
		protocol {
			strict_sni_host
		}
	}
}

erfianugrah.com {
	reverse_proxy 172.18.0.2:2368
}

port.erfianugrah.com {
	reverse_proxy 172.17.0.3:9000
}

servarr.erfianugrah.com {
	reverse_proxy localhost:88
}

plex.erfianugrah.com {
	reverse_proxy 172.19.0.8:32400
}

hydra.erfianugrah.com {
	reverse_proxy 172.19.0.7:5076
}

nzb.erfianugrah.com {
	reverse_proxy 172.19.0.6:7000
}

sonarr.erfianugrah.com {
	reverse_proxy 172.19.0.3:8989
}

radarr.erfianugrah.com {
	reverse_proxy 172.19.0.2:7878
}

bazarr.erfianugrah.com {
	reverse_proxy 172.19.0.4:6767
}

lidarr.erfianugrah.com {
	reverse_proxy 172.19.0.5:8686
}

nextcloud.erfianugrah.com {
	reverse_proxy 172.21.0.2:80
}

grafana-unraid.erfianugrah.com {
	reverse_proxy 172.17.0.2:3000
}

prom-unraid.erfianugrah.com {
	reverse_proxy 172.17.0.4:9090
}

3. The problem I’m having:

The reload hangs

4. Error messages and/or full log output:

Okay I’m a total noob, I don’t know where the debug logs are stored, but access logs yes

5. What I already tried:

So it works sometimes but not every time especially if I build the image with the DNS plugin

6. Links to relevant resources:

Process/debug logs are just printed to stderr by default, so you should check your container’s stderr for those logs.

It’s possible that a long-lived connection is keeping the server running. What if you try setting grace_period 5s in your global options?

Yeah reloading that currently hangs it, I think I need to restart the docker container

So it still hangs forever even after adding grace_period 5s?

Thing is it’s hard to test because if I restart it, it’ll work for a bit then maybe some time later I try again, it’ll hang if I reload. Not sure if it’s because the admin API isn’t working as the 2019 port is bound?

Restarted:

I’ll report back if I make any changes and if this hangs it up, grace_period should be the solution I think too

1 Like

This topic was automatically closed after 30 days. New replies are no longer allowed.