{"record":{"id":"26fd22b49f9007c8","repo":"crowdsecurity/crowdsec","slug":"no-crowdsec-labels","errorCode":null,"errorMessage":"no crowdsec labels","messagePattern":"no crowdsec labels","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/acquisition/modules/docker/source.go","lineNumber":81,"sourceCode":"\t\treturn false\n\t}\n\n\treturn containerDetails.Container.Config.Tty\n}\n\nfunc (d *Source) getContainerLabels(ctx context.Context, containerID string) map[string]any {\n\tcontainerDetails, err := d.Client.ContainerInspect(ctx, containerID, client.ContainerInspectOptions{})\n\tif err != nil {\n\t\treturn map[string]any{}\n\t}\n\n\treturn parseLabels(containerDetails.Container.Config.Labels)\n}\n\nfunc (d *Source) processCrowdsecLabels(parsedLabels map[string]any, entityID string, entityType string) (map[string]string, error) {\n\tif len(parsedLabels) == 0 {\n\t\td.logger.Tracef(\"%s has no 'crowdsec' labels set, ignoring %s: %s\", entityType, entityType, entityID)\n\t\treturn nil, errors.New(\"no crowdsec labels\")\n\t}\n\n\tif _, ok := parsedLabels[\"enable\"]; !ok {\n\t\td.logger.Errorf(\"%s has 'crowdsec' labels set but no 'crowdsec.enable' key found\", entityType)\n\t\treturn nil, errors.New(\"no crowdsec.enable key\")\n\t}\n\n\tenable, ok := parsedLabels[\"enable\"].(string)\n\tif !ok {\n\t\td.logger.Errorf(\"%s has 'crowdsec.enable' label set but it's not a string\", entityType)\n\t\treturn nil, errors.New(\"crowdsec.enable not a string\")\n\t}\n\n\tif strings.ToLower(enable) != \"true\" {\n\t\td.logger.Debugf(\"%s has 'crowdsec.enable' label not set to true ignoring %s: %s\", entityType, entityType, entityID)\n\t\treturn nil, errors.New(\"crowdsec.enable not true\")\n\t}\n","sourceCodeStart":63,"sourceCodeEnd":99,"githubUrl":"https://github.com/crowdsecurity/crowdsec/blob/909b5157986a2b2c2163300fdaef5ed01289f7d2/pkg/acquisition/modules/docker/source.go#L63-L99","documentation":"Returned by processCrowdsecLabels (called from EvalContainer/EvalService) when the parsed labels map is empty: the container or swarm service carries no 'crowdsec' labels (e.g. crowdsec.type), so there is nothing to derive acquisition labels from. It is largely informational — the caller uses it to decide to ignore the container for label-driven acquisition.","triggerScenarios":"Thrown at pkg/acquisition/modules/docker/source.go:81 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["If the container should be watched via labels, add labels such as crowdsec.type=nginx to its compose/service definition","If you select containers explicitly with container_name etc., this error is expected for unlabeled neighbors and can be ignored","Check the label namespace spelling — only labels under the crowdsec. prefix are considered"],"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-14T00:17:10.932Z"}