{"record":{"id":"d42bf6a82e01ac58","repo":"vitessio/vitess","slug":"invalid-filepos-gtid-v-expecting-file-pos","errorCode":null,"errorMessage":"invalid FilePos GTID (%v): expecting file:pos","messagePattern":"invalid FilePos GTID \\((.+?)\\): expecting file:pos","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"go/mysql/replication/filepos_gtid.go","lineNumber":33,"sourceCode":"*/\n\npackage replication\n\nimport (\n\t\"fmt\"\n\t\"strconv\"\n\t\"strings\"\n)\n\n// FilePosFlavorID is the string identifier for the filePos flavor.\nconst FilePosFlavorID = \"FilePos\"\n\n// parsefilePosGTID is registered as a GTID parser.\nfunc parseFilePosGTID(s string) (GTID, error) {\n\t// Split into parts.\n\tparts := strings.Split(s, \":\")\n\tif len(parts) != 2 {\n\t\treturn nil, fmt.Errorf(\"invalid FilePos GTID (%v): expecting file:pos\", s)\n\t}\n\n\tpos, err := strconv.ParseUint(parts[1], 0, 64)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"invalid FilePos GTID (%v): expecting pos to be an integer\", s)\n\t}\n\n\treturn FilePosGTID{\n\t\tFile: parts[0],\n\t\tPos:  pos,\n\t}, nil\n}\n\n// ParseFilePosGTIDSet is registered as a GTIDSet parser.\nfunc ParseFilePosGTIDSet(s string) (GTIDSet, error) {\n\tgtid, err := parseFilePosGTID(s)\n\tif err != nil {\n\t\treturn nil, err","sourceCodeStart":15,"sourceCodeEnd":51,"githubUrl":"https://github.com/vitessio/vitess/blob/01a25a7d176f94613b8d59d799f438380a8760e4/go/mysql/replication/filepos_gtid.go#L15-L51","documentation":"parseFilePosGTID parses a file-position GTID string of the form 'file:pos' and is registered as a GTID parser. If the string does not split into exactly two colon-separated parts, it is not a valid FilePos GTID and this error names the expected format.","triggerScenarios":"Calling mysql.ParseFilePosGTIDSet (or GTID set parsing that dispatches to this parser) with a string like `mysql-bin.000001` (missing :pos), `a:b:c` (too many parts), or an empty string.","commonSituations":"Misconfigured replication positions (e.g. passing just a binlog filename instead of file:pos); mixing up GTID formats — pasting a MySQL/MariaDB GTID like `3E11...:1-5` where a file:pos value is expected; users copying values from SHOW BINARY LOG STATUS incorrectly.","solutions":["Supply the position in file:pos form, e.g. mysql-bin.000001:4521","Check the source of the GTID string — if it is a real GTID (uuid:sequences), use the matching GTID flavor, not FilePos","Escape/verify no extra colons exist in the file name portion"],"exampleFix":"// before\ngtid, err := mysql.ParseFilePosGTIDSet(\"mysql-bin.000001\")\n// after\ngtid, err := mysql.ParseFilePosGTIDSet(\"mysql-bin.000001:4521\")","handlingStrategy":"validation","validationCode":"func looksLikeFilePos(s string) bool {\n\tparts := strings.Split(s, \":\")\n\tif len(parts) != 2 {\n\t\treturn false\n\t}\n\t_, err := strconv.ParseUint(parts[1], 0, 64)\n\treturn err == nil\n}","typeGuard":null,"tryCatchPattern":"gtid, err := mysql.ParseFilePosGTIDSet(input)\nif err != nil {\n\tif strings.Contains(err.Error(), \"expecting file:pos\") {\n\t\t// not a FilePos GTID; detect flavor or fix the input format\n\t}\n\treturn err\n}","preventionTips":["Store positions strictly as file:pos, never a bare binlog filename","Do not paste MySQL/MariaDB UUID-style GTIDs where file:pos is expected — use the right flavor","Trim whitespace and verify no extra ':' segments before parsing"],"tags":["replication","gtid","parsing"],"backgroundTag":"invalid-gtid-format","analyzedSha":"01a25a7d176f94613b8d59d799f438380a8760e4","analyzedAt":"2026-09-01T17:28:30.605Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}