{"record":{"id":"0fc5386b324eabbf","repo":"caddyserver/caddy","slug":"module-s-t-is-not-a-packet-conn-wrapper","errorCode":null,"errorMessage":"module %s (%T) is not a packet conn wrapper","messagePattern":"module (.+?) \\(%T\\) is not a packet conn wrapper","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"caddyconfig/httpcaddyfile/serveroptions.go","lineNumber":117,"sourceCode":"\t\t\t\tjsonListenerWrapper := caddyconfig.JSONModuleObject(\n\t\t\t\t\tlistenerWrapper,\n\t\t\t\t\t\"wrapper\",\n\t\t\t\t\tlistenerWrapper.(caddy.Module).CaddyModule().ID.Name(),\n\t\t\t\t\tnil,\n\t\t\t\t)\n\t\t\t\tserverOpts.ListenerWrappersRaw = append(serverOpts.ListenerWrappersRaw, jsonListenerWrapper)\n\t\t\t}\n\n\t\tcase \"packet_conn_wrappers\":\n\t\t\tfor nesting := d.Nesting(); d.NextBlock(nesting); {\n\t\t\t\tmodID := \"caddy.packetconns.\" + d.Val()\n\t\t\t\tunm, err := caddyfile.UnmarshalModule(d, modID)\n\t\t\t\tif err != nil {\n\t\t\t\t\treturn nil, err\n\t\t\t\t}\n\t\t\t\tpacketConnWrapper, ok := unm.(caddy.PacketConnWrapper)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn nil, fmt.Errorf(\"module %s (%T) is not a packet conn wrapper\", modID, unm)\n\t\t\t\t}\n\t\t\t\tjsonPacketConnWrapper := caddyconfig.JSONModuleObject(\n\t\t\t\t\tpacketConnWrapper,\n\t\t\t\t\t\"wrapper\",\n\t\t\t\t\tpacketConnWrapper.(caddy.Module).CaddyModule().ID.Name(),\n\t\t\t\t\tnil,\n\t\t\t\t)\n\t\t\t\tserverOpts.PacketConnWrappersRaw = append(serverOpts.PacketConnWrappersRaw, jsonPacketConnWrapper)\n\t\t\t}\n\n\t\tcase \"timeouts\":\n\t\t\tfor nesting := d.Nesting(); d.NextBlock(nesting); {\n\t\t\t\tswitch d.Val() {\n\t\t\t\tcase \"read_body\":\n\t\t\t\t\tif !d.NextArg() {\n\t\t\t\t\t\treturn nil, d.ArgErr()\n\t\t\t\t\t}\n\t\t\t\t\tdur, err := caddy.ParseDuration(d.Val())","sourceCodeStart":99,"sourceCodeEnd":135,"githubUrl":"https://github.com/caddyserver/caddy/blob/50e54ee279aa1e504fe218ca49ab6ae16c100410/caddyconfig/httpcaddyfile/serveroptions.go#L99-L135","documentation":"Same pattern as listener_wrappers but for 'packet_conn_wrappers' in the servers block: the module under 'caddy.packetconns.' must implement caddy.PacketConnWrapper (wrap a net.PacketConn, e.g. for QUIC/HTTP-3 UDP sockets). The type assertion failing means the resolved module is not a packet-conn wrapper.","triggerScenarios":"Using a listener-wrapper-only module in packet_conn_wrappers; a plugin registered under caddy.packetconns that lacks WrapPacketConn; version skew between core and plugin after upgrade.","commonSituations":"Configuring QUIC/UDP-related wrappers without the right build; plugin API changes across minor Caddy releases.","solutions":["Verify the module is listed under 'caddy.packetconns.' via 'caddy list-modules'.","Move listener-only modules back to listener_wrappers if they were misplaced.","Rebuild the plugin against your Caddy version.","If developing the plugin, implement WrapPacketConn plus a compile-time guard."],"exampleFix":null,"handlingStrategy":"validation","validationCode":"caddy list-modules | grep '^caddy.packetconns.'  # confirm the module exists","typeGuard":"var _ caddy.PacketConnWrapper = (*MyWrapper)(nil)","tryCatchPattern":null,"preventionTips":["Keep listener wrappers and packet-conn wrappers in their respective blocks.","Rebuild UDP/QUIC-related plugins with each core upgrade."],"tags":["caddyfile","server-options","packet-conn","quic","plugin"],"backgroundTag":null,"analyzedSha":"50e54ee279aa1e504fe218ca49ab6ae16c100410","analyzedAt":"2026-08-15T09:20:21.641Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}