"I have to go..." and shutdown at boot only

Running in docker compose, I see that the entire server is booted, the service starts but then shuts down. If I docker compose down && docker compose up -d, it runs fine.

Why does træfik decide "I have to go..." and then shutdown during server boot?

docker-compose.yaml:

services:
  reverse-proxy:
    # I also tried with:
    # image: traefik:latest
    image: traefik:v3.1.2
    command: --log.level=DEBUG

Diff between logs after a restart and after a boot (timestamps removed):

--- restart.log	2024-08-25 12:58:12.029754668 +0200
+++ boot.log	2024-08-25 12:57:37.718261207 +0200
@@ -13,3 +13,11 @@
 DBG github.com/traefik/traefik/v3/pkg/provider/aggregator/aggregator.go:203 > *acme.ChallengeTLSALPN provider configuration config={}
 DBG github.com/traefik/traefik/v3/pkg/server/configurationwatcher.go:227 > Configuration received config={"http":{"serversTransports":{"default":{"maxIdleConnsPerHost":200}},"services":{"noop":{}}},"tcp":{"serversTransports":{"default":{"dialKeepAlive":"15s","dialTimeout":"30s"}}},"tls":{},"udp":{}} providerName=internal
 DBG github.com/traefik/traefik/v3/pkg/tls/tlsmanager.go:321 > No default certificate, fallback to the internal generated certificate tlsStoreName=default
+INF github.com/traefik/traefik/v3/pkg/server/server.go:51 > I have to go...
+INF github.com/traefik/traefik/v3/pkg/server/server.go:52 > Stopping server gracefully
+DBG github.com/traefik/traefik/v3/pkg/server/server_entrypoint_tcp.go:295 > Waiting 10s seconds before killing connections entryPointName=http
+ERR github.com/traefik/traefik/v3/pkg/server/server_entrypoint_tcp.go:237 > error="accept tcp [::]:80: use of closed network connection" entryPointName=http
+ERR github.com/traefik/traefik/v3/pkg/server/server_entrypoint_tcp.go:313 > error="close tcp [::]:80: use of closed network connection" entryPointName=http
+DBG github.com/traefik/traefik/v3/pkg/server/server_entrypoint_tcp.go:153 > Entrypoint closed entryPointName=http
+INF github.com/traefik/traefik/v3/pkg/server/server.go:76 > Server stopped
+INF github.com/traefik/traefik/v3/cmd/traefik/traefik.go:163 > Shutting down

This does not provide any hints about why it decides "I have to go...".

I have 14 other docker containers that behave nicely at boot as far as I can tell.

Full boot.log:

version=3.1.2
DBG github.com/traefik/traefik/v3/cmd/traefik/traefik.go:108 > Static configuration loaded [json] staticConfiguration={"entryPoints":{"http":{"address":":80","forwardedHeaders":{},"http":{},"http2":{"maxConcurrentStreams":250},"transport":{"lifeCycle":{"graceTimeOut":"10s"},"respondingTimeouts":{"idleTimeout":"3m0s","readTimeout":"1m0s"}},"udp":{"timeout":"3s"}}},"global":{"checkNewVersion":true},"log":{"format":"common","level":"DEBUG"},"providers":{"providersThrottleDuration":"2s"},"serversTransport":{"maxIdleConnsPerHost":200},"tcpServersTransport":{"dialKeepAlive":"15s","dialTimeout":"30s"}}
INF github.com/traefik/traefik/v3/cmd/traefik/traefik.go:617 > 
reverse-proxy-1  | Stats collection is disabled.
reverse-proxy-1  | Help us improve Traefik by turning this feature on :)
reverse-proxy-1  | More details on: https://doc.traefik.io/traefik/contributing/data-collection/
reverse-proxy-1  | 
INF github.com/traefik/traefik/v3/pkg/server/configurationwatcher.go:73 > Starting provider aggregator aggregator.ProviderAggregator
DBG github.com/traefik/traefik/v3/pkg/server/server_entrypoint_tcp.go:228 > Starting TCP Server entryPointName=http
INF github.com/traefik/traefik/v3/pkg/provider/aggregator/aggregator.go:202 > Starting provider *traefik.Provider
DBG github.com/traefik/traefik/v3/pkg/provider/aggregator/aggregator.go:203 > *traefik.Provider provider configuration config={}
INF github.com/traefik/traefik/v3/pkg/provider/aggregator/aggregator.go:202 > Starting provider *acme.ChallengeTLSALPN
DBG github.com/traefik/traefik/v3/pkg/provider/aggregator/aggregator.go:203 > *acme.ChallengeTLSALPN provider configuration config={}
DBG github.com/traefik/traefik/v3/pkg/server/configurationwatcher.go:227 > Configuration received config={"http":{"serversTransports":{"default":{"maxIdleConnsPerHost":200}},"services":{"noop":{}}},"tcp":{"serversTransports":{"default":{"dialKeepAlive":"15s","dialTimeout":"30s"}}},"tls":{},"udp":{}} providerName=internal
DBG github.com/traefik/traefik/v3/pkg/tls/tlsmanager.go:321 > No default certificate, fallback to the internal generated certificate tlsStoreName=default
INF github.com/traefik/traefik/v3/pkg/server/server.go:51 > I have to go...
INF github.com/traefik/traefik/v3/pkg/server/server.go:52 > Stopping server gracefully
DBG github.com/traefik/traefik/v3/pkg/server/server_entrypoint_tcp.go:295 > Waiting 10s seconds before killing connections entryPointName=http
ERR github.com/traefik/traefik/v3/pkg/server/server_entrypoint_tcp.go:237 > error="accept tcp [::]:80: use of closed network connection" entryPointName=http
ERR github.com/traefik/traefik/v3/pkg/server/server_entrypoint_tcp.go:313 > error="close tcp [::]:80: use of closed network connection" entryPointName=http
DBG github.com/traefik/traefik/v3/pkg/server/server_entrypoint_tcp.go:153 > Entrypoint closed entryPointName=http
INF github.com/traefik/traefik/v3/pkg/server/server.go:76 > Server stopped
INF github.com/traefik/traefik/v3/cmd/traefik/traefik.go:163 > Shutting down

Running on NixOS 24.05 with

peter@kosh:~$ docker --version        
Docker version 25.0.6, build v25.0.6
peter@kosh:~$ docker compose version  
Docker Compose version 2.27.0

You are aware that NixOS is not officially supported by Docker (link)?

Yeah, but neither is Azure linux, Amazon Linux or many other linux distros.

Duh! My bad.

I had forgotten to add this to docker-compose.yaml:

restart: unless-stopped

The log I was seeing after a boot was the log from last time the container ran - from before the reboot. And it wrote out I have to go... during shutdown, not during boot.

After adding restart: unless-stopped it now starts up as it should and all is well. Sorry about the noise.

(and this would've been the same for every linux flavor...)

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.