{"record":{"id":"1dbde9406e7644e2","repo":"caddyserver/caddy","slug":"loading-storage-module-v-1dbde9","errorCode":null,"errorMessage":"loading storage module: %v","messagePattern":"loading storage module: (.+?)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"modules/caddytls/capools.go","lineNumber":410,"sourceCode":"\tcerts   []*x509.Certificate\n}\n\n// CaddyModule implements caddy.Module.\nfunc (StoragePool) CaddyModule() caddy.ModuleInfo {\n\treturn caddy.ModuleInfo{\n\t\tID: \"tls.ca_pool.source.storage\",\n\t\tNew: func() caddy.Module {\n\t\t\treturn new(StoragePool)\n\t\t},\n\t}\n}\n\n// Provision implements caddy.Provisioner.\nfunc (ca *StoragePool) Provision(ctx caddy.Context) error {\n\tif ca.StorageRaw != nil {\n\t\tval, err := ctx.LoadModule(ca, \"StorageRaw\")\n\t\tif err != nil {\n\t\t\treturn fmt.Errorf(\"loading storage module: %v\", err)\n\t\t}\n\t\tcmStorage, err := val.(caddy.StorageConverter).CertMagicStorage()\n\t\tif err != nil {\n\t\t\treturn fmt.Errorf(\"creating storage configuration: %v\", err)\n\t\t}\n\t\tca.storage = cmStorage\n\t}\n\tif ca.storage == nil {\n\t\tca.storage = ctx.Storage()\n\t}\n\tif len(ca.PEMKeys) == 0 {\n\t\treturn fmt.Errorf(\"no PEM keys specified\")\n\t}\n\tcaPool := x509.NewCertPool()\n\tvar certs []*x509.Certificate\n\tfor _, caID := range ca.PEMKeys {\n\t\tbs, err := ca.storage.Load(ctx, caID)\n\t\tif err != nil {","sourceCodeStart":392,"sourceCodeEnd":428,"githubUrl":"https://github.com/caddyserver/caddy/blob/50e54ee279aa1e504fe218ca49ab6ae16c100410/modules/caddytls/capools.go#L392-L428","documentation":"StoragePool.Provision fails to load the nested storage module configured under `storage` in the `tls.ca_pool.source.storage` trust pool. ctx.LoadModule returned an error, typically an unknown module name or invalid module configuration inside the storage block.","triggerScenarios":"Configuring `trust_pool storage { storage <module> {...} }` where <module> is not a registered caddy storage module (e.g. typo like `s3` when the module is uninstalled, or `file_system` misspelled), or where the module's own provisioning failed.","commonSituations":"Using a storage module provided by a plugin that is not compiled into the custom Caddy build; typoing the storage module name; version changes that renamed storage modules.","solutions":["Correct the storage module name inside the trust_pool storage block (e.g. `file_system`, `redis` if the plugin is installed).","If the module comes from a plugin, rebuild Caddy with `xcaddy build --with <plugin>` so the module is registered.","Run `caddy list-modules` to confirm the storage module ID exists in your build."],"exampleFix":"# before\ntrust_pool storage {\n  storage file_ststem {\n    root /etc/caddy/certs\n  }\n  system_ca_pem path/to/roots.pem\n}\n\n# after\ntrust_pool storage {\n  storage file_system {\n    root /etc/caddy/certs\n  }\n  system_ca_pem path/to/roots.pem\n}","handlingStrategy":"validation","validationCode":"// check the storage module id is registered before loading\nif caddy.GetModuleID != nil { /* API varies; simplest check: */ }\n// practical: run `caddy list-modules` and grep for the storage module, e.g.\n//   caddy list-modules | grep -w 'caddy.storage.file_system'","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Pin plugin versions in your xcaddy build and record them (e.g. commit the build command).","Run `caddy list-modules` after every rebuild and diff against expectations in CI.","Use `caddy validate` on config changes referencing storage modules."],"tags":["caddy","caddytls","storage","module-loading","configuration"],"backgroundTag":null,"analyzedSha":"50e54ee279aa1e504fe218ca49ab6ae16c100410","analyzedAt":"2026-08-15T09:20:21.641Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}