{"record":{"id":"9e9e47fedc31db27","repo":"caddyserver/caddy","slug":"loading-config-loader-module-s","errorCode":null,"errorMessage":"loading config loader module: %s","messagePattern":"loading config loader module: (.+?)","errorType":"http","errorClass":null,"httpStatus":500,"severity":"error","filePath":"caddy.go","lineNumber":614,"sourceCode":"\t// so that cert management of this endpoint doesn't prevent user's\n\t// servers from starting which likely also use HTTP/HTTPS ports;\n\t// but before remote management which may depend on these creds)\n\terr := manageIdentity(ctx, cfg)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"provisioning remote admin endpoint: %v\", err)\n\t}\n\n\t// replace any remote admin endpoint\n\terr = replaceRemoteAdminServer(ctx, cfg)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"provisioning remote admin endpoint: %v\", err)\n\t}\n\n\t// if dynamic config is requested, set that up and run it\n\tif cfg != nil && cfg.Admin != nil && cfg.Admin.Config != nil && cfg.Admin.Config.LoadRaw != nil {\n\t\tval, err := ctx.LoadModule(cfg.Admin.Config, \"LoadRaw\")\n\t\tif err != nil {\n\t\t\treturn fmt.Errorf(\"loading config loader module: %s\", err)\n\t\t}\n\n\t\tlogger := Log().Named(\"config_loader\").With(\n\t\t\tzap.String(\"module\", val.(Module).CaddyModule().ID.Name()),\n\t\t\tzap.Int(\"load_delay\", int(cfg.Admin.Config.LoadDelay)))\n\n\t\trunLoadedConfig := func(config []byte) error {\n\t\t\tlogger.Info(\"applying dynamically-loaded config\")\n\t\t\terr := changeConfig(http.MethodPost, \"/\"+rawConfigKey, config, \"\", false)\n\t\t\tif errors.Is(err, errSameConfig) {\n\t\t\t\treturn err\n\t\t\t}\n\t\t\tif err != nil {\n\t\t\t\tlogger.Error(\"failed to run dynamically-loaded config\", zap.Error(err))\n\t\t\t\treturn err\n\t\t\t}\n\t\t\tlogger.Info(\"successfully applied dynamically-loaded config\")\n\t\t\treturn nil","sourceCodeStart":596,"sourceCodeEnd":632,"githubUrl":"https://github.com/caddyserver/caddy/blob/50e54ee279aa1e504fe218ca49ab6ae16c100410/caddy.go#L596-L632","documentation":"Thrown when the Admin.Config.LoadRaw module cannot be loaded via ctx.LoadModule. The dynamic config loader module (anything implementing ConfigLoader registered under the config load namespace) failed to provision or its raw JSON could not be decoded into the module.","triggerScenarios":"cfg.Admin.Config.LoadRaw is non-nil (dynamic config requested) and ctx.LoadModule(cfg.Admin.Config, \"LoadRaw\") returns an error: unknown module name, invalid inline JSON for the loader, or the loader's Provision() failing.","commonSituations":"A config JSON with admin.config.load referencing a module that is not compiled into the custom Caddy build, or with malformed loader arguments. Also occurs when a third-party loader module panics/errors during provisioning.","solutions":["Check the wrapped error: 'unknown module' means the loader is missing from the build; rebuild with the correct plugin","Validate the admin.config.load JSON object against the loader module's expected schema","If a custom loader, test its Provision() independently (e.g. via caddy adapt + unit tests)","Remove admin.config temporarily to isolate whether the rest of the config is valid"],"exampleFix":"// before (module not in build)\n{\"admin\": {\"config\": {\"load\": {\"myloader\": {}}}}}\n// after (use a loader compiled in, e.g. http)\n{\"admin\": {\"config\": {\"load\": {\"http\": {\"url\": \"http://cfg.internal/current\"}}}}}","handlingStrategy":"validation","validationCode":"// confirm the loader module exists in this build before running\nname := \"http\" // module name under config loaders\nif _, found := caddy.GetModule(\"caddy.config_loaders.\" + name); ! found {\n    return fmt.Errorf(\"loader %q not compiled in\", name)\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Pin and test custom builds that include config loader plugins","Validate admin.config.load JSON with `caddy validate --adapter json`","Unit-test custom loader Provision() methods"],"tags":["dynamic-config","modules","admin","startup"],"backgroundTag":null,"analyzedSha":"50e54ee279aa1e504fe218ca49ab6ae16c100410","analyzedAt":"2026-08-15T09:20:21.641Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}