{"record":{"id":"996878628a502514","repo":"caddyserver/caddy","slug":"config-is-required","errorCode":null,"errorMessage":"--config is required","messagePattern":"--config is required","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"cmd/storagefuncs.go","lineNumber":69,"sourceCode":"\terr = json.Unmarshal(cfg, &tmpStruct)\n\tif err != nil {\n\t\t// default case, ignore the error\n\t\tvar jsonError *json.SyntaxError\n\t\tif errors.As(err, &jsonError) {\n\t\t\treturn nil, nil\n\t\t}\n\t\treturn nil, err\n\t}\n\n\treturn &tmpStruct, nil\n}\n\nfunc cmdImportStorage(fl Flags) (int, error) {\n\timportStorageCmdConfigFlag := fl.String(\"config\")\n\timportStorageCmdImportFile := fl.String(\"input\")\n\n\tif importStorageCmdConfigFlag == \"\" {\n\t\treturn caddy.ExitCodeFailedStartup, errors.New(\"--config is required\")\n\t}\n\tif importStorageCmdImportFile == \"\" {\n\t\treturn caddy.ExitCodeFailedStartup, errors.New(\"--input is required\")\n\t}\n\n\t// extract storage from config if possible\n\tstorageCfg, err := determineStorage(importStorageCmdConfigFlag, \"\")\n\tif err != nil {\n\t\treturn caddy.ExitCodeFailedStartup, err\n\t}\n\n\t// load specified storage or fallback to default\n\tvar stor certmagic.Storage\n\tctx, cancel := caddy.NewContext(caddy.Context{Context: context.Background()})\n\tdefer cancel()\n\tif storageCfg != nil && storageCfg.StorageRaw != nil {\n\t\tval, err := ctx.LoadModule(storageCfg, \"StorageRaw\")\n\t\tif err != nil {","sourceCodeStart":51,"sourceCodeEnd":87,"githubUrl":"https://github.com/caddyserver/caddy/blob/50e54ee279aa1e504fe218ca49ab6ae16c100410/cmd/storagefuncs.go#L51-L87","documentation":"During ECH Provision, Caddy failed to instantiate the configured publication modules (PublishersRaw) for an entry in the tls.encrypted_client_hello publication list. ctx.LoadModule resolves each embedded publisher module (e.g. DNS provider modules) from the JSON config, and that resolution or construction failed.","triggerScenarios":"An ech.publication entry references a module name that is not registered in the build (e.g. a DNS provider not compiled in), or the module's own provisioning failed (bad provider credentials shape, unknown fields).","commonSituations":"Using a Caddy build without the required DNS provider plugin (custom builds via xcaddy); typos in the module name in the JSON config or Caddyfile adaptation; version drift where a plugin changed its module ID.","solutions":["Check the wrapped error for the exact module name that failed to load.","If a DNS publisher is configured, build Caddy with the matching DNS provider module (xcaddy build with the plugin, or use a build containing it).","Correct the module name/namespace in the tls { ech { publication } } config.","Verify plugin and Caddy versions are compatible after upgrades."],"exampleFix":"# before: config references a publisher whose plugin is absent\nxcaddy build\n# caddy errors: loading ECH publication modules: ...\n\n# after: include the DNS provider module\nxcaddy build --with github.com/caddy-dns/cloudflare","handlingStrategy":"validation","validationCode":"// Before deploying, confirm required modules are present in the build:\n// caddy list-modules | grep <publisher-module-id>\n// Or validate config against the running binary:\n// caddy validate --config Caddyfile","typeGuard":null,"tryCatchPattern":"Treat as fatal config error: run `caddy validate --config Caddyfile` in CI to catch missing modules before deploy; the wrapped error names the module that failed.","preventionTips":["Build with xcaddy including every DNS provider module referenced by ECH publication config.","Pin plugin versions and validate configs in CI against the exact production binary.","After upgrades, re-run caddy list-modules to confirm module IDs still exist."],"tags":["caddy","caddytls","ech","modules","dns","xcaddy"],"backgroundTag":null,"analyzedSha":"50e54ee279aa1e504fe218ca49ab6ae16c100410","analyzedAt":"2026-08-15T09:20:21.641Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}