{"record":{"id":"da65698f80e667f4","repo":"crowdsecurity/crowdsec","slug":"while-pulling-allowlist-w","errorCode":null,"errorMessage":"while pulling allowlist: %w","messagePattern":"while pulling allowlist: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/apiserver/apic.go","lineNumber":704,"sourceCode":"\t\t}\n\t}\n\n\treturn nil\n}\n\n// we receive a link to a blocklist, we pull the content of the blocklist and we create one alert\nfunc (a *apic) PullBlocklist(ctx context.Context, blocklist *modelscapi.BlocklistLink, forcePull bool) error {\n\taddCounters, _ := makeAddAndDeleteCounters()\n\tif err := a.UpdateBlocklists(ctx, []*modelscapi.BlocklistLink{blocklist}, addCounters, forcePull); err != nil {\n\t\treturn fmt.Errorf(\"while pulling blocklist: %w\", err)\n\t}\n\n\treturn nil\n}\n\nfunc (a *apic) PullAllowlist(ctx context.Context, allowlist *modelscapi.AllowlistLink, forcePull bool) error {\n\tif err := a.UpdateAllowlists(ctx, []*modelscapi.AllowlistLink{allowlist}, forcePull); err != nil {\n\t\treturn fmt.Errorf(\"while pulling allowlist: %w\", err)\n\t}\n\n\treturn nil\n}\n\nfunc (a *apic) updateOneAllowlist(ctx context.Context, client *apiclient.ApiClient, link *modelscapi.AllowlistLink) error {\n\tif log.IsLevelEnabled(log.TraceLevel) {\n\t\tlog.Tracef(\"allowlist body: %+v\", spew.Sdump(link))\n\t}\n\n\tif link.Name == nil {\n\t\tlog.Warn(\"allowlist has no name\")\n\t\treturn nil\n\t}\n\n\tif link.URL == nil {\n\t\tlog.Warnf(\"allowlist %s has no URL\", *link.Name)\n\t\treturn nil","sourceCodeStart":686,"sourceCodeEnd":722,"githubUrl":"https://github.com/crowdsecurity/crowdsec/blob/909b5157986a2b2c2163300fdaef5ed01289f7d2/pkg/apiserver/apic.go#L686-L722","documentation":"PullAllowlist failed while updating a single allowlist link via UpdateAllowlists (download of the allowlist content, parsing, applying). The inner error carries the real cause; this wrapper only identifies the allowlist-pull stage. Note the message text says 'blocklist' — a copy-paste in the wrap.","triggerScenarios":"Thrown at pkg/apiserver/apic.go:704 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Check the wrapped error for the real cause: URL fetch failure, bad content, or DB error","Verify the allowlist URL is reachable and returns the expected plain-text format","Retry on the next pull cycle once the upstream allowlist host recovers"],"exampleFix":null,"handlingStrategy":"retry","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"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"}