{"record":{"id":"9db6f0bd5aa8a3c9","repo":"caddyserver/caddy","slug":"download-failed-http-d-s-id-s","errorCode":null,"errorMessage":"download failed: HTTP %d: %s (id=%s)","messagePattern":"download failed: HTTP (.+?): (.+?) \\(id=(.+?)\\)","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"cmd/packagesfuncs.go","lineNumber":302,"sourceCode":"\t\tzap.String(\"arch\", qs.Get(\"arch\")),\n\t\tzap.Strings(\"packages\", qs[\"p\"]))\n\tresp, err := http.Get(fmt.Sprintf(\"%s?%s\", downloadPath, qs.Encode()))\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"secure request failed: %v\", err)\n\t}\n\tif resp.StatusCode >= 400 {\n\t\tvar details struct {\n\t\t\tStatusCode int `json:\"status_code\"`\n\t\t\tError      struct {\n\t\t\t\tMessage string `json:\"message\"`\n\t\t\t\tID      string `json:\"id\"`\n\t\t\t} `json:\"error\"`\n\t\t}\n\t\terr2 := json.NewDecoder(resp.Body).Decode(&details)\n\t\tif err2 != nil {\n\t\t\treturn nil, fmt.Errorf(\"download and error decoding failed: HTTP %d: %v\", resp.StatusCode, err2)\n\t\t}\n\t\treturn nil, fmt.Errorf(\"download failed: HTTP %d: %s (id=%s)\", resp.StatusCode, details.Error.Message, details.Error.ID)\n\t}\n\treturn resp, nil\n}\n\nfunc getPluginPackages(modules []moduleInfo) (map[string]pluginPackage, error) {\n\tpluginPkgs := make(map[string]pluginPackage)\n\tfor _, mod := range modules {\n\t\tif mod.goModule.Replace != nil {\n\t\t\treturn nil, fmt.Errorf(\"cannot auto-upgrade when Go module has been replaced: %s => %s\",\n\t\t\t\tmod.goModule.Path, mod.goModule.Replace.Path)\n\t\t}\n\t\tpluginPkgs[mod.goModule.Path] = pluginPackage{Version: mod.goModule.Version, Path: mod.goModule.Path}\n\t}\n\treturn pluginPkgs, nil\n}\n\nfunc writeCaddyBinary(path string, body *io.ReadCloser, fileInfo os.FileInfo) error {\n\tl := caddy.Log()","sourceCodeStart":284,"sourceCodeEnd":320,"githubUrl":"https://github.com/caddyserver/caddy/blob/50e54ee279aa1e504fe218ca49ab6ae16c100410/cmd/packagesfuncs.go#L284-L320","documentation":"The download API returned HTTP >= 400 with a well-formed JSON error body, and this is that server-reported message surfaced verbatim (with the API's error ID). Common server-side rejections: unknown or unavailable plugin package, build failure for the requested combination, or invalid parameters (os/arch/packages).","triggerScenarios":"Passing a plugin path that does not exist or is not a Caddy plugin to 'caddy add-package'; requesting a package version incompatible with the current Caddy core; the build API failing to compile the requested plugin set; platform not supported by a plugin.","commonSituations":"Typo in a module path (caddy-nginx instead of caddy-certmagic, etc.); plugin abandoned/renamed upstream; plugin not updated for the current Caddy version so the API's build fails.","solutions":["Read the message and id — the API states the exact reason (e.g. unknown package, build error)","Verify the module path: check the plugin's README or 'go list -m' against what you passed to 'caddy add-package'","Pin a known-good version: caddy add-package github.com/authelia/authelia@v4.38.0","If the build fails for the latest version, try the plugin's previous tagged version or build locally with xcaddy"],"exampleFix":"# before\ncaddy add-package github.com/example/caddy-frobnicate\n# error: download failed: HTTP 400: unknown package (id=...)\n\n# after\n# correct module path from the plugin's README\ncaddy add-package github.com/example/caddy-frob","handlingStrategy":"validation","validationCode":"# confirm the module exists and builds before adding it\ngo list -m -versions github.com/mholt/caddy-ratelimit 2>/dev/null || echo 'module not found'","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Copy plugin module paths verbatim from their README/Go import path","Pin explicit versions: caddy add-package <module>@<tag>","Check plugin compatibility with your Caddy version before adding"],"tags":["api","plugins","upgrade","http"],"backgroundTag":null,"analyzedSha":"50e54ee279aa1e504fe218ca49ab6ae16c100410","analyzedAt":"2026-08-15T09:20:21.641Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}