{"record":{"id":"7376ec01fdb46a9a","repo":"crowdsecurity/crowdsec","slug":"service-id-regexp-w","errorCode":null,"errorMessage":"service_id_regexp: %w","messagePattern":"service_id_regexp: %w","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/acquisition/modules/docker/config.go","lineNumber":122,"sourceCode":"\t\t\treturn fmt.Errorf(\"container_id_regexp: %w\", err)\n\t\t}\n\n\t\td.compiledContainerID = append(d.compiledContainerID, compiled)\n\t}\n\n\tfor _, svc := range d.Config.ServiceNameRegexp {\n\t\tcompiled, err := regexp.Compile(svc)\n\t\tif err != nil {\n\t\t\treturn fmt.Errorf(\"service_name_regexp: %w\", err)\n\t\t}\n\n\t\td.compiledServiceName = append(d.compiledServiceName, compiled)\n\t}\n\n\tfor _, svc := range d.Config.ServiceIDRegexp {\n\t\tcompiled, err := regexp.Compile(svc)\n\t\tif err != nil {\n\t\t\treturn fmt.Errorf(\"service_id_regexp: %w\", err)\n\t\t}\n\n\t\td.compiledServiceID = append(d.compiledServiceID, compiled)\n\t}\n\n\tif d.Config.Since == \"\" {\n\t\td.Config.Since = time.Now().UTC().Format(time.RFC3339)\n\t}\n\n\td.containerLogsOptions = &client.ContainerLogsOptions{\n\t\tShowStdout: d.Config.FollowStdout,\n\t\tShowStderr: d.Config.FollowStdErr,\n\t\tFollow:     true,\n\t\tSince:      d.Config.Since,\n\t}\n\n\tif d.Config.Until != \"\" {\n\t\td.containerLogsOptions.Until = d.Config.Until","sourceCodeStart":104,"sourceCodeEnd":140,"githubUrl":"https://github.com/crowdsecurity/crowdsec/blob/909b5157986a2b2c2163300fdaef5ed01289f7d2/pkg/acquisition/modules/docker/config.go#L104-L140","documentation":"During UnmarshalConfig, each `service_id_regexp` entry is compiled with regexp.Compile; a failing compile aborts startup with this wrapped error. It means one of the service_id_regexp values is not a valid Go (RE2) regular expression.","triggerScenarios":"Configure/UnmarshalConfig called with d.Config.ServiceIDRegexp containing an invalid pattern string rejected by regexp.Compile.","commonSituations":"Typo in a Swarm service ID filter regex in acquis.yaml or DSN; using unsupported regex syntax copied from another tool; missing escape on characters like `+` or `{`.","solutions":["Correct the regex syntax so it compiles under Go regexp.","Drop RE2-unsupported constructs (backreferences, lookarounds).","Validate with `regexp.Compile(pattern)` in a snippet or `go run` before deploying.","Use `service_id` (exact list) when a regex is unnecessary."],"exampleFix":"// before\nservice_id_regexp:\n  - \"^[abc{\"   // invalid character class\n// after\nservice_id_regexp:\n  - \"^[a-f0-9]{12}$\"","handlingStrategy":"validation","validationCode":"for _, re := range cfg.ServiceIDRegexp {\n    if _, err := regexp.Compile(re); err != nil {\n        return fmt.Errorf(\"invalid service_id_regexp %q: %w\", re, err)\n    }\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Test the pattern with a quick `go run` snippet or RE2 playground first.","Escape metacharacters in literal IDs.","Use plain service_id lists when a regex adds no value."],"tags":["regex","config","docker"],"backgroundTag":"invalid-regex-pattern","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"}