{"record":{"id":"39aed79f67be65b1","repo":"VictoriaMetrics/VictoriaMetrics","slug":"cannot-parse-timestamp-milliseconds-from-q-w","errorCode":null,"errorMessage":"cannot parse timestamp milliseconds from %q: %w","messagePattern":"cannot parse timestamp milliseconds from %q: %w","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"lib/protoparser/csvimport/column_descriptor.go","lineNumber":156,"sourceCode":"\t\treturn nil, fmt.Errorf(\"unknown format for time parsing: %q; supported formats: unix_s, unix_ms, unix_ns, rfc3339\", format)\n\t}\n}\n\nfunc parseUnixTimestampSeconds(s string) (int64, error) {\n\tn, err := fastfloat.ParseInt64(s)\n\tif err != nil {\n\t\treturn 0, fmt.Errorf(\"cannot parse timestamp seconds from %q: %w\", s, err)\n\t}\n\tif n > int64(1<<63-1)/1e3 {\n\t\treturn 0, fmt.Errorf(\"too big unix timestamp in seconds: %d; must be smaller than %d\", n, int64(1<<63-1)/1e3)\n\t}\n\treturn n * 1e3, nil\n}\n\nfunc parseUnixTimestampMilliseconds(s string) (int64, error) {\n\tn, err := fastfloat.ParseInt64(s)\n\tif err != nil {\n\t\treturn 0, fmt.Errorf(\"cannot parse timestamp milliseconds from %q: %w\", s, err)\n\t}\n\treturn n, nil\n}\n\nfunc parseUnixTimestampNanoseconds(s string) (int64, error) {\n\tn, err := fastfloat.ParseInt64(s)\n\tif err != nil {\n\t\treturn 0, fmt.Errorf(\"cannot parse timestamp nanoseconds from %q: %w\", s, err)\n\t}\n\treturn n / 1e6, nil\n}\n\nfunc parseRFC3339(s string) (int64, error) {\n\tt, err := time.Parse(time.RFC3339, s)\n\tif err != nil {\n\t\treturn 0, fmt.Errorf(\"cannot parse time in RFC3339 from %q: %w\", s, err)\n\t}\n\treturn t.UnixNano() / 1e6, nil","sourceCodeStart":138,"sourceCodeEnd":174,"githubUrl":"https://github.com/VictoriaMetrics/VictoriaMetrics/blob/5079fb58f1e8e62113f90c945ad71586c797d770/lib/protoparser/csvimport/column_descriptor.go#L138-L174","documentation":"Raised in parseUnixTimestampMilliseconds (csvimport time format unix_ms) when fastfloat.ParseInt64 cannot parse the cell as an integer millisecond timestamp. The wrapped error explains the parse failure for the given cell value %q.","triggerScenarios":"A row's time column with spec time:unix_ms contains non-numeric text, an empty string, a float with a fractional part that fails strict int parsing, a formatted date, or a number with thousands separators.","commonSituations":"CSV cells from spreadsheet exports with date formatting; whitespace/BOM; data actually in seconds (which would parse but yield wrong times — this error instead indicates true non-numeric junk like 'N/A' or 'null').","solutions":["Fix the offending cell to a plain integer of milliseconds","Replace sentinel values like 'N/A', 'null', or empty cells with real timestamps or drop those rows","If data is a formatted date, switch the spec to time:rfc3339 or a custom format","Trim whitespace, quotes, and BOM from cells before import"],"exampleFix":"// before (CSV cell)\nN/A\ncds, _ := csvimport.ParseColumnDescriptors(\"time:unix_ms,metric\")\n// after\n1700000000000","handlingStrategy":"try-catch","validationCode":"func isUnixMillis(v string) bool {\n\tn, err := strconv.ParseInt(strings.TrimSpace(v), 10, 64)\n\treturn err == nil && n >= 0\n}","typeGuard":null,"tryCatchPattern":"if err != nil && strings.Contains(err.Error(), \"cannot parse timestamp milliseconds\") {\n\t// log the offending cell from the quoted %q and skip/repair that row\n}","preventionTips":["Trim and normalize cells before Unmarshal","Scan the time column once with strconv.ParseInt to find all bad rows up front","Keep timestamp columns free of locale formatting in the upstream exporter"],"tags":["csvimport","timestamp","parse-error","data-quality"],"backgroundTag":"timestamp-parse-failed","analyzedSha":"5079fb58f1e8e62113f90c945ad71586c797d770","analyzedAt":"2026-09-03T18:10:26.153Z","contentChangedAt":"2026-09-03T18:10:26.153Z","schemaVersion":2},"datasetVersion":"2026-09-08T15:18:49.778Z"}