{"record":{"id":"7e90c0ba63e04469","repo":"crowdsecurity/crowdsec","slug":"could-not-parse-max-buffer-size-s-w","errorCode":null,"errorMessage":"could not parse max_buffer_size %s: %w","messagePattern":"could not parse max_buffer_size (.+?): %w","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/acquisition/modules/file/config.go","lineNumber":193,"sourceCode":"\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}\n\t}\n\n\ts.config.Labels = labels\n\ts.config.Mode = configuration.CAT_MODE\n\ts.config.UniqueId = uuid\n\n\ts.logger.Debugf(\"Will try pattern %s\", args[0])\n\n\tfiles, err := filepath.Glob(args[0])\n\tif err != nil {\n\t\treturn fmt.Errorf(\"glob failure: %w\", err)","sourceCodeStart":175,"sourceCodeEnd":211,"githubUrl":"https://github.com/crowdsecurity/crowdsec/blob/909b5157986a2b2c2163300fdaef5ed01289f7d2/pkg/acquisition/modules/file/config.go#L175-L211","documentation":"ConfigureByDSN of the file source expects the 'max_buffer_size' DSN parameter to be an integer; strconv.Atoi failed on the given value (non-numeric or out of range), so the DSN is rejected with the offending value embedded.","triggerScenarios":"Thrown at pkg/acquisition/modules/file/config.go:193 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Provide max_buffer_size as a plain integer, e.g. max_buffer_size=100 (megabytes)","Remove the max_buffer_size parameter to use the default buffer size"],"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"}