{"record":{"id":"b9b0e4e28d9b0386","repo":"vitessio/vitess","slug":"failed-to-convert-server-id-v","errorCode":null,"errorMessage":"failed to convert server-id: %v","messagePattern":"failed to convert server-id: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"go/vt/mysqlctl/mycnf.go","lineNumber":210,"sourceCode":"\t\t}\n\t\tline = bytes.TrimSpace(line)\n\n\t\tparts = bytes.Split(line, []byte(\"=\"))\n\t\tif len(parts) < 2 {\n\t\t\tcontinue\n\t\t}\n\t\tlval = normKey(parts[0])\n\t\trval = string(bytes.TrimSpace(parts[1]))\n\t\tmycnf.mycnfMap[lval] = rval\n\t}\n\n\tserverIDStr, err := mycnf.lookupWithDefault(\"server-id\", \"\")\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tserverID, err := strconv.ParseUint(serverIDStr, 10, 32)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"failed to convert server-id: %v\", err)\n\t}\n\tmycnf.ServerID = uint32(serverID)\n\n\tport, err := mycnf.lookupInt(\"port\")\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tmycnf.MysqlPort = port\n\n\tmapping := map[string]*string{\n\t\t\"datadir\":                   &mycnf.DataDir,\n\t\t\"innodb_data_home_dir\":      &mycnf.InnodbDataHomeDir,\n\t\t\"innodb_log_group_home_dir\": &mycnf.InnodbLogGroupHomeDir,\n\t\t\"socket\":                    &mycnf.SocketFile,\n\t\t\"general_log_file\":          &mycnf.GeneralLogPath,\n\t\t\"log-error\":                 &mycnf.ErrorLogPath,\n\t\t\"slow-query-log-file\":       &mycnf.SlowLogPath,\n\t\t\"relay-log\":                 &mycnf.RelayLogPath,","sourceCodeStart":192,"sourceCodeEnd":228,"githubUrl":"https://github.com/vitessio/vitess/blob/01a25a7d176f94613b8d59d799f438380a8760e4/go/vt/mysqlctl/mycnf.go#L192-L228","documentation":"ReadMycnf requires a server-id in the parsed config; the string is fetched via lookupWithDefault and parsed with strconv.ParseUint(base 10, 32 bits). If parsing fails (missing handled earlier, so this fires on non-numeric or out-of-range values), this error wraps the cause.","triggerScenarios":"ReadMycnf encountering a server-id that is non-numeric or exceeds uint32 (max 4294967295), e.g. a UUID-based server_id from MariaDB configs or a negative value.","commonSituations":"Copying server-id from MySQL 8.0's UUID-derived values; typos like 'server-id = 0x10' (hex not accepted); value larger than 32 bits from automated generators.","solutions":["Set server-id to an integer between 1 and 4294967295 in my.cnf.","Convert any hex or oversized server-id values to a valid 32-bit decimal.","Ensure each replica has a unique server-id in that range before re-running."],"exampleFix":"// before\nserver-id = 0b9f3a1c-... (uuid)\n// after\nserver-id = 623","handlingStrategy":"validation","validationCode":"v := getCnfValue(\"server-id\")\nid, err := strconv.ParseUint(v, 10, 32)\nif err != nil { return fmt.Errorf(\"server-id %q not a uint32: %w\", v, err) }\nif id == 0 { return errors.New(\"server-id must be >= 1\") }","typeGuard":null,"tryCatchPattern":"mycnf, err := mysqlctl.ReadMycnf(path)\nif err != nil {\n\tif strings.Contains(err.Error(), \"server-id\") { /* fix server-id in config */ }\n\treturn err\n}","preventionTips":["Assign server-id in 1..4294967295 range, unique per replica","Never copy MariaDB UUID-style server_id values into vitess-managed my.cnf","Validate server-id during provisioning, not at mysqld start time"],"tags":["mycnf","replication","configuration"],"backgroundTag":"invalid-config-value","analyzedSha":"01a25a7d176f94613b8d59d799f438380a8760e4","analyzedAt":"2026-09-01T17:28:30.605Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}