{"record":{"id":"2928015cb3117857","repo":"crowdsecurity/crowdsec","slug":"allowlist-s-has-no-id","errorCode":null,"errorMessage":"allowlist %s has no ID","messagePattern":"allowlist (.+?) has no ID","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/apiserver/apic.go","lineNumber":726,"sourceCode":"}\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\n\t}\n\n\tif link.ID == nil {\n\t\treturn fmt.Errorf(\"allowlist %s has no ID\", *link.Name)\n\t}\n\n\tdescription := \"\"\n\tif link.Description != nil {\n\t\tdescription = *link.Description\n\t}\n\n\treq, err := http.NewRequestWithContext(ctx, http.MethodGet, *link.URL, http.NoBody)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"while pulling allowlist: %s\", err)\n\t}\n\n\tresp, err := client.GetClient().Do(req)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"while pulling allowlist: %s\", err)\n\t}\n\tdefer resp.Body.Close()\n","sourceCodeStart":708,"sourceCodeEnd":744,"githubUrl":"https://github.com/crowdsecurity/crowdsec/blob/909b5157986a2b2c2163300fdaef5ed01289f7d2/pkg/apiserver/apic.go#L708-L744","documentation":"An allowlist entry received from CAPI has a name and URL but a nil ID field. The ID is required to key the allowlist in local state; a missing ID means the CAPI payload is malformed/incomplete for this entry, so it is rejected rather than silently mis-keyed.","triggerScenarios":"Thrown at pkg/apiserver/apic.go:726 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Retry the pull later — transient stream glitches can drop fields","Upgrade crowdsec if a version mismatch in the CAPI contract is suspected","If persistent, capture the allowlist entry and report it to CrowdSec"],"exampleFix":null,"handlingStrategy":"validation","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-14T05:17:10.506Z"}