{"record":{"id":"b35c10cc06283c47","repo":"crowdsecurity/crowdsec","slug":"no-containers-or-services-configuration-provided","errorCode":null,"errorMessage":"no containers or services configuration provided","messagePattern":"no containers or services configuration provided","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/acquisition/modules/docker/config.go","lineNumber":69,"sourceCode":"}\n\nfunc (d *Source) UnmarshalConfig(yamlConfig []byte) error {\n\td.Config = Configuration{\n\t\tFollowStdout: true, // default\n\t\tFollowStdErr: true, // default\n\t}\n\n\tif err := yaml.UnmarshalWithOptions(yamlConfig, &d.Config, yaml.Strict()); err != nil {\n\t\treturn fmt.Errorf(\"while parsing DockerAcquisition configuration: %s\", yaml.FormatError(err, false, false))\n\t}\n\n\tif d.logger != nil {\n\t\td.logger.Tracef(\"DockerAcquisition configuration: %+v\", d.Config)\n\t}\n\n\t// Check if we have any container or service configuration\n\tif !d.Config.hasContainerConfig() && !d.Config.hasServiceConfig() {\n\t\treturn errors.New(\"no containers or services configuration provided\")\n\t}\n\n\tif d.Config.UseContainerLabels && (len(d.Config.ContainerName) > 0 || len(d.Config.ContainerID) > 0 || len(d.Config.ContainerIDRegexp) > 0 || len(d.Config.ContainerNameRegexp) > 0) {\n\t\treturn errors.New(\"use_container_labels and container_name, container_id, container_id_regexp, container_name_regexp are mutually exclusive\")\n\t}\n\n\tif d.Config.UseServiceLabels && (len(d.Config.ServiceName) > 0 || len(d.Config.ServiceID) > 0 || len(d.Config.ServiceIDRegexp) > 0 || len(d.Config.ServiceNameRegexp) > 0) {\n\t\treturn errors.New(\"use_service_labels and service_name, service_id, service_id_regexp, service_name_regexp are mutually exclusive\")\n\t}\n\n\tif d.Config.CheckInterval != \"\" && d.logger != nil {\n\t\td.logger.Warn(\"check_interval is ignored: this datasource now uses events instead of polling (will be removed in a future version)\")\n\t}\n\n\tif d.Config.Mode == \"\" {\n\t\td.Config.Mode = configuration.TAIL_MODE\n\t}\n","sourceCodeStart":51,"sourceCodeEnd":87,"githubUrl":"https://github.com/crowdsecurity/crowdsec/blob/909b5157986a2b2c2163300fdaef5ed01289f7d2/pkg/acquisition/modules/docker/config.go#L51-L87","documentation":"Validation guard in the docker datasource's UnmarshalConfig: after strict YAML parsing, neither a container configuration (container_name, container_id, and regexp variants) nor a service configuration (service_name, service_id, and variants) is present. The docker source has nothing to watch, so the config is rejected.","triggerScenarios":"Thrown at pkg/acquisition/modules/docker/config.go:69 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Add at least one container selector, e.g. container_name: [my-app], or a service selector like service_name: [web]","For swarm deployments use the service_* fields; for plain docker use container_* fields","Remember docker is the only source that may omit labels, but it still requires a selector"],"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"}