{"record":{"id":"80c2c8a152b2669c","repo":"crowdsecurity/crowdsec","slug":"can-t-enable-s-not-downloaded","errorCode":null,"errorMessage":"can't enable %s: not downloaded","messagePattern":"can't enable (.+?): not downloaded","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/hubops/enable.go","lineNumber":87,"sourceCode":"\tsrc := i.State.DownloadPath\n\n\tif err = os.Symlink(src, dest); err != nil {\n\t\treturn fmt.Errorf(\"while creating symlink from %s to %s: %w\", src, dest, err)\n\t}\n\n\ti.State.LocalPath = dest\n\n\treturn nil\n}\n\nfunc (c *EnableCommand) Run(_ context.Context, plan *ActionPlan) error {\n\ti := c.Item\n\n\tfmt.Fprintln(os.Stdout, \"enabling \" + colorizeItemName(i.FQName()))\n\n\tif !i.State.IsDownloaded() {\n\t\t// XXX: this a warning?\n\t\treturn fmt.Errorf(\"can't enable %s: not downloaded\", i.FQName())\n\t}\n\n\tif err := CreateInstallLink(i); err != nil {\n\t\treturn fmt.Errorf(\"while enabling %s: %w\", i.FQName(), err)\n\t}\n\n\tplan.ReloadNeeded = true\n\n\ti.State.Tainted = false\n\n\treturn nil\n}\n\nfunc (*EnableCommand) OperationType() string {\n\treturn \"enable\"\n}\n\nfunc (c *EnableCommand) ItemType() string {","sourceCodeStart":69,"sourceCodeEnd":105,"githubUrl":"https://github.com/crowdsecurity/crowdsec/blob/909b5157986a2b2c2163300fdaef5ed01289f7d2/pkg/hubops/enable.go#L69-L105","documentation":"The enable operation requires the item to already be downloaded (present in the hub's data/tarmac directory, checked via i.State.IsDownloaded()). Enabling only links an existing download into the install dir; this error means that prerequisite is missing. The code itself flags with XXX that this might warrant warning severity.","triggerScenarios":"Running `cscli <type> enable <item>` on an item that was listed (via `hub list`/`install`) but never downloaded — e.g. `taint`-free list entry with no matching file in the hub data dir, or the download step was skipped/failed earlier.","commonSituations":"Fresh install where the user enables before any `hub update`/download completed; the item's download previously failed (see errors 1092/1094); manual deletion of files under /var/lib/crowdsec/data; hub index and data dir out of sync.","solutions":["Download the item first: `cscli hub update` then `cscli <type> install <item>` (install downloads then enables).","Verify the item state with `cscli <type> inspect <item>` (check DownloadPath/IsDownloaded fields).","If the file was manually deleted, reinstall the item to restore it.","Check for prior download failures in the logs (network/permissions) and fix the root cause."],"exampleFix":"// before\ncscli parsers enable crowdsecurity/http-logs   # can't enable: not downloaded\n// after\ncscli hub update\ncscli parsers install crowdsecurity/http-logs   # downloads, then enables","handlingStrategy":"validation","validationCode":"st, err := cscliInspect(itemType, itemName)\nif err != nil || !st.Downloaded {\n    return fmt.Errorf(\"item %s not downloaded; run install first\", itemName)\n}","typeGuard":null,"tryCatchPattern":"if err := enableItem(name); err != nil {\n    if strings.Contains(err.Error(), \"not downloaded\") {\n        return installItem(name) // install downloads then enables\n    }\n    return err\n}","preventionTips":["Use `cscli <type> install` (download + enable) instead of bare enable for fresh items.","Always run `cscli hub update` before managing items on a fresh host.","Verify item state with `cscli <type> inspect <item>` before enabling.","Don't manually delete files under the hub data directory; use cscli remove instead."],"tags":["hub","state","precondition","cscli"],"backgroundTag":"resource-not-found","analyzedSha":"909b5157986a2b2c2163300fdaef5ed01289f7d2","analyzedAt":"2026-09-06T12:27:26.012Z","contentChangedAt":"2026-09-06T12:27:26.012Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}