{"record":{"id":"6ac617ee8907e280","repo":"hashicorp/nomad","slug":"address-must-be-in-ip-port-format-w","errorCode":null,"errorMessage":"address must be in IP:port format: %w","messagePattern":"address must be in IP:port format: %w","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"nomad/structs/operator.go","lineNumber":106,"sourceCode":"\tif (r.ID == \"\" && r.Address == \"\") || (r.ID != \"\" && r.Address != \"\") {\n\t\treturn errors.New(\"either ID or Address must be set\")\n\t}\n\tif r.ID != \"\" {\n\t\treturn r.validateID()\n\t}\n\treturn r.validateAddress()\n}\n\nfunc (r *RaftPeerRequest) validateID() error {\n\tif _, err := uuid.ParseUUID(string(r.ID)); err != nil {\n\t\treturn fmt.Errorf(\"id must be a uuid: %w\", err)\n\t}\n\treturn nil\n}\n\nfunc (r *RaftPeerRequest) validateAddress() error {\n\tif _, err := netip.ParseAddrPort(string(r.Address)); err != nil {\n\t\treturn fmt.Errorf(\"address must be in IP:port format: %w\", err)\n\t}\n\treturn nil\n}\n\ntype LeadershipTransferResponse struct {\n\tFrom RaftIDAddress // Server yielding leadership\n\tTo   RaftIDAddress // Server obtaining leadership\n\tNoop bool          // Was the transfer a non-operation\n\tErr  error         // Non-nil if there was an error while transferring leadership\n}\n\ntype RaftIDAddress struct {\n\tAddress raft.ServerAddress\n\tID      raft.ServerID\n}\n\n// NewRaftIDAddress takes parameters in the order provided by raft's\n// LeaderWithID func and returns a RaftIDAddress","sourceCodeStart":88,"sourceCodeEnd":124,"githubUrl":"https://github.com/hashicorp/nomad/blob/482b49bf1aec006f089bcfc7e632d8f6ac303e5e/nomad/structs/operator.go#L88-L124","documentation":"RaftPeerRequest.validateAddress could not parse the supplied peer address with netip.ParseAddrPort; the address must be an IP:port pair such as 10.0.0.1:4647.","triggerScenarios":"Thrown at nomad/structs/operator.go:106 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Provide the address in IP:port format (no scheme or hostname)","Use the exact address from `nomad operator raft list-peers`"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"482b49bf1aec006f089bcfc7e632d8f6ac303e5e","analyzedAt":"2026-09-04T07:54:14.808Z","contentChangedAt":"2026-09-04T07:54:14.808Z","schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}