{"record":{"id":"d219eaa11334d6a7","repo":"goharbor/harbor","slug":"invalid-int64-string-s","errorCode":null,"errorMessage":"invalid int64 string: %s","messagePattern":"invalid int64 string: (.+?)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/lib/config/metadata/type.go","lineNumber":264,"sourceCode":"\nfunc (t *DurationType) get(str string) (any, error) {\n\t// should not parse the duration to avoid duplicate parse.\n\treturn str, nil\n}\n\n// parseInt64 returns int64 from string which support scientific notation\nfunc parseInt64(str string) (int64, error) {\n\tval, err := strconv.ParseInt(str, 10, 64)\n\tif err == nil {\n\t\treturn val, nil\n\t}\n\n\tfval, err := strconv.ParseFloat(str, 64)\n\tif err == nil && fval == math.Trunc(fval) {\n\t\treturn int64(fval), nil\n\t}\n\n\treturn 0, fmt.Errorf(\"invalid int64 string: %s\", str)\n}\n\nfunc parseInt(str string) (int, error) {\n\tval, err := strconv.ParseInt(str, 10, 32)\n\tif err == nil {\n\t\treturn int(val), nil\n\t}\n\n\tfval, err := strconv.ParseFloat(str, 32)\n\tif err == nil && fval == math.Trunc(fval) {\n\t\treturn int(fval), nil\n\t}\n\n\treturn 0, fmt.Errorf(\"invalid int string: %s\", str)\n}\n\nfunc parseFloat64(str string) (float64, error) {\n\tval, err := strconv.ParseFloat(str, 64)","sourceCodeStart":246,"sourceCodeEnd":282,"githubUrl":"https://github.com/goharbor/harbor/blob/7b2fd08cc568955cca339afeefab27372840d936/src/lib/config/metadata/type.go#L246-L282","documentation":"parseInt64 could not interpret the input string as an int64: strict base-10 parsing failed and the scientific-notation fallback either failed to parse as a float or produced a non-integral value; the offending string is echoed. It surfaces from QuotaType/Int64Type validate and get calls.","triggerScenarios":"Thrown at src/lib/config/metadata/type.go:264 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Provide a decimal integer string such as '1024' or a scientific form with an integral result like '1e3'","Trim whitespace and remove units/suffixes before passing the value","Validate user input as numeric before it reaches the config layer"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"7b2fd08cc568955cca339afeefab27372840d936","analyzedAt":"2026-08-16T00:00:10.961Z","contentChangedAt":"2026-08-16T00:00:10.961Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}