caddyserver/caddy · error

config for a listener wrapper did not provide a value that…

Error message

config for a listener wrapper did not provide a value that implements caddy.ListenerWrapper

What it means

A config value in the 'listener_wrapper' pile did not actually implement caddy.ListenerWrapper after loading, i.e. the module registered under that name is the wrong type. serversFromPairings refuses to attach it to the listener.

Solutions

  1. Ensure the listener wrapper module's configuration unmarshals into a value that implements caddy.ListenerWrapper.
  2. Verify the module name is a registered listener wrapper.
Defensive patterns

Strategy: type-guard

When it happens

Trigger: Thrown at caddyconfig/httpcaddyfile/httptype.go:893 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of caddyserver/caddy@50e54ee279 (2026-08-15). Data as JSON: /api/errors/96865b50b68a2f90. Report an issue: GitHub.

Appendix: source

Thrown at caddyconfig/httpcaddyfile/httptype.go:893

				// we'll need to remember if the address qualifies for auto-HTTPS, so we
				// can add a TLS conn policy if necessary
				if addr.Scheme == "https" ||
					(addr.Scheme != "http" && addr.Port != httpPort && hasTLSEnabled) {
					addressQualifiesForTLS = true
				}

				// predict whether auto-HTTPS will add the conn policy for us; if so, we
				// may not need to add one for this server
				autoHTTPSWillAddConnPolicy = autoHTTPSWillAddConnPolicy &&
					(addr.Port == httpsPort || (addr.Port != httpPort && addr.Host != ""))
			}

			// Look for any config values that provide listener wrappers on the server block
			for _, listenerConfig := range sblock.pile["listener_wrapper"] {
				listenerWrapper, ok := listenerConfig.Value.(caddy.ListenerWrapper)
				if !ok {
					return nil, fmt.Errorf("config for a listener wrapper did not provide a value that implements caddy.ListenerWrapper")
				}
				jsonListenerWrapper := caddyconfig.JSONModuleObject(
					listenerWrapper,
					"wrapper",
					listenerWrapper.(caddy.Module).CaddyModule().ID.Name(),
					warnings,
				)
				srv.ListenerWrappersRaw = append(srv.ListenerWrappersRaw, jsonListenerWrapper)
			}

			// Look for any config values that provide packet conn wrappers on the server block
			for _, listenerConfig := range sblock.pile["packet_conn_wrapper"] {
				packetConnWrapper, ok := listenerConfig.Value.(caddy.PacketConnWrapper)
				if !ok {
					return nil, fmt.Errorf("config for a packet conn wrapper did not provide a value that implements caddy.PacketConnWrapper")
				}
				jsonPacketConnWrapper := caddyconfig.JSONModuleObject(
					packetConnWrapper,

View on GitHub (pinned to 50e54ee279)