{"record":{"id":"937f0f393ffad5e5","repo":"caddyserver/caddy","slug":"package-is-not-added","errorCode":null,"errorMessage":"package is not added","messagePattern":"package is not added","errorType":"console","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"cmd/packagesfuncs.go","lineNumber":116,"sourceCode":"\t\treturn caddy.ExitCodeFailedStartup, fmt.Errorf(\"at least one package name must be specified\")\n\t}\n\t_, nonstandard, _, err := getModules()\n\tif err != nil {\n\t\treturn caddy.ExitCodeFailedStartup, fmt.Errorf(\"unable to enumerate installed plugins: %v\", err)\n\t}\n\tpluginPkgs, err := getPluginPackages(nonstandard)\n\tif err != nil {\n\t\treturn caddy.ExitCodeFailedStartup, err\n\t}\n\n\tfor _, arg := range fl.Args() {\n\t\tmodule, _, err := splitModule(arg)\n\t\tif err != nil {\n\t\t\treturn caddy.ExitCodeFailedStartup, fmt.Errorf(\"invalid module name: %v\", err)\n\t\t}\n\t\tif _, ok := pluginPkgs[module]; !ok {\n\t\t\t// package does not exist\n\t\t\treturn caddy.ExitCodeFailedStartup, fmt.Errorf(\"package is not added\")\n\t\t}\n\t\tdelete(pluginPkgs, arg)\n\t}\n\n\treturn upgradeBuild(pluginPkgs, fl)\n}\n\nfunc upgradeBuild(pluginPkgs map[string]pluginPackage, fl Flags) (int, error) {\n\tl := caddy.Log()\n\n\tthisExecPath, err := os.Executable()\n\tif err != nil {\n\t\treturn caddy.ExitCodeFailedStartup, fmt.Errorf(\"determining current executable path: %v\", err)\n\t}\n\tthisExecStat, err := os.Stat(thisExecPath)\n\tif err != nil {\n\t\treturn caddy.ExitCodeFailedStartup, fmt.Errorf(\"retrieving current executable permission bits: %v\", err)\n\t}","sourceCodeStart":98,"sourceCodeEnd":134,"githubUrl":"https://github.com/caddyserver/caddy/blob/50e54ee279aa1e504fe218ca49ab6ae16c100410/cmd/packagesfuncs.go#L98-L134","documentation":"`caddy remove-package` rejects a module that is not part of the current build (lookup in the plugin-package map fails). Note the check uses the SPLIT module name but deletes by the raw arg, so version suffixes are tolerated in the lookup; a miss simply means the binary was never built with that plugin.","triggerScenarios":"`caddy remove-package github.com/caddy-dns/cloudflare` on a build that doesn't include it; typos in the module path; trying to remove a plugin that ships inside the standard module set.","commonSituations":"Removing a plugin you added on a different machine/binary; path spelled differently than when added (case, .v2 suffix); assuming a feature is a plugin when it is built-in.","solutions":["List what is actually installed: `caddy list-modules --versions --skip-standard` and copy the exact module path","Fix typos/case in the path and retry","If it is a standard module, it cannot be removed — rebuild from source with xcaddy and a trimmed standard set instead"],"exampleFix":"# before\ncaddy remove-package github.com/caddy-dns/cloudflar  # typo\n\n# after\ncaddy remove-package github.com/caddy-dns/cloudflare","handlingStrategy":"validation","validationCode":"MOD=github.com/caddy-dns/cloudflare\ncaddy list-modules -v --skip-standard 2>/dev/null | grep -q \"$MOD\" || echo \"$MOD not in this build; nothing to remove\"","typeGuard":null,"tryCatchPattern":null,"preventionTips":["List installed packages before removing","Record the module paths used at add time so removal matches exactly"],"tags":["caddy","remove-package","cli","plugins"],"backgroundTag":null,"analyzedSha":"50e54ee279aa1e504fe218ca49ab6ae16c100410","analyzedAt":"2026-08-15T09:20:21.641Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}