{"record":{"id":"0c90da8b098740f3","repo":"crowdsecurity/crowdsec","slug":"unknown-level-s-w-0c90da","errorCode":null,"errorMessage":"unknown level %s: %w","messagePattern":"unknown level (.+?): %w","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/acquisition/modules/file/config.go","lineNumber":182,"sourceCode":"\t\treturn errors.New(\"empty file:// DSN\")\n\t}\n\n\tif len(args) == 2 && args[1] != \"\" {\n\t\tparams, err := url.ParseQuery(args[1])\n\t\tif err != nil {\n\t\t\treturn fmt.Errorf(\"could not parse file args: %w\", err)\n\t\t}\n\n\t\tfor key, value := range params {\n\t\t\tswitch key {\n\t\t\tcase \"log_level\":\n\t\t\t\tif len(value) != 1 {\n\t\t\t\t\treturn errors.New(\"expected zero or one value for 'log_level'\")\n\t\t\t\t}\n\n\t\t\t\tlvl, err := log.ParseLevel(value[0])\n\t\t\t\tif err != nil {\n\t\t\t\t\treturn fmt.Errorf(\"unknown level %s: %w\", value[0], err)\n\t\t\t\t}\n\n\t\t\t\ts.logger.Logger.SetLevel(lvl)\n\t\t\tcase \"max_buffer_size\":\n\t\t\t\tif len(value) != 1 {\n\t\t\t\t\treturn errors.New(\"expected zero or one value for 'max_buffer_size'\")\n\t\t\t\t}\n\n\t\t\t\tmaxBufferSize, err := strconv.Atoi(value[0])\n\t\t\t\tif err != nil {\n\t\t\t\t\treturn fmt.Errorf(\"could not parse max_buffer_size %s: %w\", value[0], err)\n\t\t\t\t}\n\n\t\t\t\ts.config.MaxBufferSize = maxBufferSize\n\t\t\tdefault:\n\t\t\t\treturn fmt.Errorf(\"unknown parameter %s\", key)\n\t\t\t}\n\t\t}","sourceCodeStart":164,"sourceCodeEnd":200,"githubUrl":"https://github.com/crowdsecurity/crowdsec/blob/909b5157986a2b2c2163300fdaef5ed01289f7d2/pkg/acquisition/modules/file/config.go#L164-L200","documentation":"ConfigureByDSN rejects a file:// DSN whose log_level query parameter is not a valid logrus level. It fires when log.ParseLevel fails on the user-supplied value, aborting acquisition configuration for that DSN.","triggerScenarios":"Thrown at pkg/acquisition/modules/file/config.go:182 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Use a valid level in the DSN: log_level=trace|debug|info|warn|warning|error|fatal|panic","Correct the typo in the log_level value in the acquisition yaml DSN"],"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"}