{"record":{"id":"6682a0ea5fa7eb14","repo":"caddyserver/caddy","slug":"unrecognized-config-adapter-s-6682a0","errorCode":null,"errorMessage":"unrecognized config adapter: %s","messagePattern":"unrecognized config adapter: (.+?)","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"cmd/main.go","lineNumber":206,"sourceCode":"\t\t\t} else {\n\t\t\t\t// success reading default Caddyfile\n\t\t\t\tconfigFile = \"Caddyfile\"\n\t\t\t\tlogger.Info(\"using adjacent Caddyfile\")\n\t\t\t}\n\t\t}\n\t}\n\n\tif yes, err := isCaddyfile(configFile, adapterName); yes {\n\t\tadapterName = \"caddyfile\"\n\t} else if err != nil {\n\t\treturn nil, \"\", \"\", err\n\t}\n\n\t// load config adapter\n\tif adapterName != \"\" {\n\t\tcfgAdapter = caddyconfig.GetAdapter(adapterName)\n\t\tif cfgAdapter == nil {\n\t\t\treturn nil, \"\", \"\", fmt.Errorf(\"unrecognized config adapter: %s\", adapterName)\n\t\t}\n\t}\n\n\t// adapt config\n\tif cfgAdapter != nil {\n\t\tadaptedConfig, warnings, err := cfgAdapter.Adapt(config, map[string]any{\n\t\t\t\"filename\": configFile,\n\t\t})\n\t\tif err != nil {\n\t\t\treturn nil, \"\", \"\", fmt.Errorf(\"adapting config using %s: %v\", adapterName, err)\n\t\t}\n\t\tlogger.Info(\"adapted config to JSON\", zap.String(\"adapter\", adapterName))\n\t\tfor _, warn := range warnings {\n\t\t\tmsg := warn.Message\n\t\t\tif warn.Directive != \"\" {\n\t\t\t\tmsg = fmt.Sprintf(\"%s: %s\", warn.Directive, warn.Message)\n\t\t\t}\n\t\t\tlogger.Warn(msg,","sourceCodeStart":188,"sourceCodeEnd":224,"githubUrl":"https://github.com/caddyserver/caddy/blob/50e54ee279aa1e504fe218ca49ab6ae16c100410/cmd/main.go#L188-L224","documentation":"The adapter name given via --adapter (or inferred) has no registered caddyconfig.Adapter in this binary. Stock Caddy ships the caddyfile adapter; other adapters exist only if compiled in as plugins.","triggerScenarios":"Running 'caddy adapt --config x.yaml --adapter yaml' on a build without the yaml adapter plugin; misspelling 'caddyfile'; using an adapter plugin that was not compiled into the custom build actually being invoked.","commonSituations":"Custom xcaddy builds missing a plugin; docs referencing an adapter the installed binary lacks; PATH picking up a different caddy binary than the one built with the plugin.","solutions":["Check spelling: the built-in adapter is 'caddyfile'","List what your binary supports; if the adapter is a plugin, rebuild with xcaddy including it","Confirm which binary runs: which caddy && caddy version"],"exampleFix":"# before\ncaddy adapt --config app.yaml --adapter yaml   # unrecognized config adapter: yaml\n\n# after (build with the plugin, or use the built-in adapter)\nxcaddy build --with github.com/caddyserver/format-awslambda  # example plugin flow\ncaddy adapt --config Caddyfile --adapter caddyfile","handlingStrategy":"validation","validationCode":"// Verify the adapter exists in this binary before using it:\nif caddyconfig.GetAdapter(adapterName) == nil { return fmt.Errorf(\"adapter %q not compiled in; rebuild with xcaddy --with <plugin>\", adapterName) }","typeGuard":"func hasAdapter(name string) bool { return caddyconfig.GetAdapter(name) != nil }","tryCatchPattern":null,"preventionTips":["Standard builds only include the caddyfile adapter — others are plugins","Pin and document xcaddy build flags alongside deployment scripts","Verify with 'which caddy && caddy version' that the plugin-built binary is the one on PATH"],"tags":["cli","adapter","plugin","invalid-argument"],"backgroundTag":null,"analyzedSha":"50e54ee279aa1e504fe218ca49ab6ae16c100410","analyzedAt":"2026-08-15T09:20:21.641Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}