{"record":{"id":"d0da57956fe6ffb2","repo":"crowdsecurity/crowdsec","slug":"only-one-log-level-parameters-is-required-not-m","errorCode":null,"errorMessage":"only one 'log_level' parameters is required, not many","messagePattern":"only one 'log_level' parameters is required, not many","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/acquisition/modules/docker/config.go","lineNumber":248,"sourceCode":"\t}\n\n\tcontainerNameOrID := parsedURL.Host\n\n\tif containerNameOrID == \"\" {\n\t\treturn fmt.Errorf(\"empty %s DSN\", d.GetName()+\"://\")\n\t}\n\n\td.Config.ContainerName = append(d.Config.ContainerName, containerNameOrID)\n\t// we add it as an ID also so user can provide docker name or docker ID\n\td.Config.ContainerID = append(d.Config.ContainerID, containerNameOrID)\n\n\tparameters := parsedURL.Query()\n\n\tfor k, v := range parameters {\n\t\tswitch k {\n\t\tcase \"log_level\":\n\t\t\tif len(v) != 1 {\n\t\t\t\treturn errors.New(\"only one 'log_level' parameters is required, not many\")\n\t\t\t}\n\t\t\tlvl, err := log.ParseLevel(v[0])\n\t\t\tif err != nil {\n\t\t\t\treturn fmt.Errorf(\"unknown level %s: %w\", v[0], err)\n\t\t\t}\n\t\t\td.logger.Logger.SetLevel(lvl)\n\t\tcase \"until\":\n\t\t\tif len(v) != 1 {\n\t\t\t\treturn errors.New(\"only one 'until' parameters is required, not many\")\n\t\t\t}\n\t\t\td.containerLogsOptions.Until = v[0]\n\t\tcase \"since\":\n\t\t\tif len(v) != 1 {\n\t\t\t\treturn errors.New(\"only one 'since' parameters is required, not many\")\n\t\t\t}\n\t\t\td.containerLogsOptions.Since = v[0]\n\t\tcase \"follow_stdout\":\n\t\t\tif len(v) != 1 {","sourceCodeStart":230,"sourceCodeEnd":266,"githubUrl":"https://github.com/crowdsecurity/crowdsec/blob/909b5157986a2b2c2163300fdaef5ed01289f7d2/pkg/acquisition/modules/docker/config.go#L230-L266","documentation":"DSN validation in the docker datasource's ConfigureByDSN: the log_level query parameter appears more than once in the docker:// DSN. url.ParseQuery groups repeated keys into a multi-element slice and the guard demands exactly one value.","triggerScenarios":"Thrown at pkg/acquisition/modules/docker/config.go:248 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Specify log_level at most once, e.g. docker://mycontainer?log_level=debug","Generate DSNs programmatically with url.Values.Set to avoid duplicate keys"],"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"}