{"record":{"id":"cd419752f0714910","repo":"argoproj/argo-workflows","slug":"retrymultiple-cannot-be-less-than-0","errorCode":null,"errorMessage":"retryMultiple cannot be less than 0","messagePattern":"retryMultiple cannot be less than 0","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"util/sqldb/session.go","lineNumber":71,"sourceCode":"\tUsername      string\n\tPassword      string\n\tMaxRetries    int\n\tBaseDelay     time.Duration\n\tMaxDelay      time.Duration\n}\n\nfunc validateProxyParams(proxy *SessionProxy) error {\n\tif proxy.maxRetries < 0 {\n\t\treturn fmt.Errorf(\"maxRetries cannot be less than 0\")\n\t}\n\tif proxy.baseDelay < 0 {\n\t\treturn fmt.Errorf(\"baseDelay cannot be less than 0\")\n\t}\n\tif proxy.maxDelay < 0 {\n\t\treturn fmt.Errorf(\"maxDelay cannot be less than 0\")\n\t}\n\tif proxy.retryMultiple < 0 {\n\t\treturn fmt.Errorf(\"retryMultiple cannot be less than 0\")\n\t}\n\treturn nil\n}\n\n// NewSessionProxy creates a new SessionProxy with the given configuration\nfunc NewSessionProxy(ctx context.Context, config SessionProxyConfig) (*SessionProxy, error) {\n\tdbType := dbTypeFromConfig(&config.DBConfig)\n\tproxy := &SessionProxy{\n\t\tkubectlConfig: config.KubectlConfig,\n\t\tnamespace:     config.Namespace,\n\t\tdbConfig:      &config.DBConfig,\n\t\tusername:      config.Username,\n\t\tpassword:      config.Password,\n\t\tdbType:        dbType,\n\t\tmaxRetries:    config.MaxRetries,\n\t\tbaseDelay:     config.BaseDelay,\n\t\tmaxDelay:      config.MaxDelay,\n\t\tretryMultiple: 2.0,","sourceCodeStart":53,"sourceCodeEnd":89,"githubUrl":"https://github.com/argoproj/argo-workflows/blob/35bff19146f5a6ada77468c431f2624bd577e373/util/sqldb/session.go#L53-L89","documentation":"validateProxyParams rejects a negative retryMultiple, the exponential backoff multiplier applied to baseDelay on each reconnect attempt. A negative multiplier would invert the backoff progression, so NewSessionProxy rejects it. Pure input validation.","triggerScenarios":"Calling NewSessionProxy with DBConfig.DBReconnectConfig.RetryMultiple < 0 (the only path that sets it, other than the internal default 2.0).","commonSituations":"Negative retryMultiple in the controller config dbReconnectConfig; a config generator emitting a negative float; confusion with the (allowed but clamped) 0..1 range, which the code coerces to 1.0.","solutions":["Set RetryMultiple to a positive value (typically 1.0 or 2.0); values between 0 and 1 are tolerated but clamped to 1.0.","Fix the negative retryMultiple in the dbReconnectConfig config entry.","If parsing from YAML/JSON, verify sign and that the field is a number, not a string coerced oddly.","Omit the field entirely to keep the default 2.0."],"exampleFix":"// before\nretryMultiple: -1.5\n// after\nretryMultiple: 2.0","handlingStrategy":"validation","validationCode":"if cfg.RetryMultiple < 0 {\n    return fmt.Errorf(\"RetryMultiple must be >= 0, got %f\", cfg.RetryMultiple)\n}","typeGuard":null,"tryCatchPattern":"if err := NewSessionProxy(ctx, cfg); err != nil {\n    if strings.Contains(err.Error(), \"retryMultiple cannot be less than 0\") {\n        cfg.DBConfig.DBReconnectConfig.RetryMultiple = 2.0\n        return NewSessionProxy(ctx, cfg)\n    }\n    return err\n}","preventionTips":["Default to omitting retryMultiple (library default is 2.0).","Note values between 0 and 1 are silently clamped to 1.0 — prefer explicit 1.0 or 2.0.","Validate float sign in YAML config pipelines.","Document accepted range (0 < v, typical 1.0–3.0) for operators."],"tags":["validation","database","configuration"],"backgroundTag":"invalid-argument-value","analyzedSha":"35bff19146f5a6ada77468c431f2624bd577e373","analyzedAt":"2026-09-03T19:34:35.908Z","contentChangedAt":"2026-09-03T19:34:35.908Z","schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}