{"record":{"id":"1b29432fd658b737","repo":"crowdsecurity/crowdsec","slug":"expected-zero-or-one-argument-for-end-date","errorCode":null,"errorMessage":"expected zero or one argument for 'end_date'","messagePattern":"expected zero or one argument for 'end_date'","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/acquisition/modules/cloudwatch/config.go","lineNumber":256,"sourceCode":"\t\tcase \"profile\":\n\t\t\tif len(v) != 1 {\n\t\t\t\treturn errors.New(\"expected zero or one value for 'profile'\")\n\t\t\t}\n\n\t\t\tawsprof := v[0]\n\t\t\ts.Config.AwsProfile = &awsprof\n\t\t\ts.logger.Debugf(\"profile set to '%s'\", *s.Config.AwsProfile)\n\t\tcase \"start_date\":\n\t\t\tif len(v) != 1 {\n\t\t\t\treturn errors.New(\"expected zero or one argument for 'start_date'\")\n\t\t\t}\n\t\t\t// let's reuse our parser helper so that a ton of date formats are supported\n\t\t\tstrdate, startDate := parser.GenDateParse(v[0])\n\t\t\ts.logger.Debugf(\"parsed '%s' as '%s'\", v[0], strdate)\n\t\t\ts.Config.StartTime = &startDate\n\t\tcase \"end_date\":\n\t\t\tif len(v) != 1 {\n\t\t\t\treturn errors.New(\"expected zero or one argument for 'end_date'\")\n\t\t\t}\n\t\t\t// let's reuse our parser helper so that a ton of date formats are supported\n\t\t\tstrdate, endDate := parser.GenDateParse(v[0])\n\t\t\ts.logger.Debugf(\"parsed '%s' as '%s'\", v[0], strdate)\n\t\t\ts.Config.EndTime = &endDate\n\t\tcase \"backlog\":\n\t\t\tif len(v) != 1 {\n\t\t\t\treturn errors.New(\"expected zero or one argument for 'backlog'\")\n\t\t\t}\n\t\t\t// let's reuse our parser helper so that a ton of date formats are supported\n\t\t\tduration, err := time.ParseDuration(v[0])\n\t\t\tif err != nil {\n\t\t\t\treturn fmt.Errorf(\"unable to parse '%s' as duration: %w\", v[0], err)\n\t\t\t}\n\n\t\t\ts.logger.Debugf(\"parsed '%s' as '%s'\", v[0], duration)\n\t\t\tstart := time.Now().UTC().Add(-duration)\n\t\t\ts.Config.StartTime = &start","sourceCodeStart":238,"sourceCodeEnd":274,"githubUrl":"https://github.com/crowdsecurity/crowdsec/blob/909b5157986a2b2c2163300fdaef5ed01289f7d2/pkg/acquisition/modules/cloudwatch/config.go#L238-L274","documentation":"Validation guard in ConfigureByDSN of the cloudwatch source: the 'start_date'/'end_date' DSN parameter accepts exactly one value; the query string supplied more than one value for 'end_date' (e.g. end_date=a&end_date=b), so the DSN is rejected.","triggerScenarios":"Thrown at pkg/acquisition/modules/cloudwatch/config.go:256 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Provide end_date exactly once in the DSN","Pair it with a single start_date to define the retrieval window"],"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-14T00:17:10.932Z"}