-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
panic: runtime error: invalid memory address or nil pointer dereference #7989
Description
Observed behavior
[2866] 2026/03/26 21:19:18.892686 [INF] [IP Redacted] - lid:206 - Leafnode connection created
[2866] 2026/03/26 21:19:18.933261 [INF] [IP Redacted] - lid:204 - Leafnode connection closed: Authentication Timeout
[2866] 2026/03/26 21:19:18.958736 [ERR] [IP Redacted] - lid:204 - Problem registering with account "RMT": connection closed
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x0 pc=0x7d0f0d]
goroutine 100415 [running]:
github.com/nats-io/nats-server/v2/server.(*Account).registerLeafNodeCluster(0x0, {0xc0090185e0, 0x8})
github.com/nats-io/nats-server/v2/server/accounts.go:993 +0x2d
github.com/nats-io/nats-server/v2/server.(*client).processLeafNodeConnect(0xc006d2e208, 0xc000212008, {0xc006546208, 0x121, 0x1f8}, {0x0?, 0xc006d2f62c?})
github.com/nats-io/nats-server/v2/server/leafnode.go:2159 +0x595
github.com/nats-io/nats-server/v2/server.(*client).processConnect(0xc006d2e208, {0xc006546208, 0x121, 0x1f8})
github.com/nats-io/nats-server/v2/server/client.go:2374 +0x1076
github.com/nats-io/nats-server/v2/server.(*client).parse(0xc006d2e208, {0xc006546200, 0x12b, 0x200})
github.com/nats-io/nats-server/v2/server/parser.go:946 +0xbc5
github.com/nats-io/nats-server/v2/server.(*client).readLoop(0xc006d2e208, {0x0, 0x0, 0x0})
github.com/nats-io/nats-server/v2/server/client.go:1482 +0x14ad
github.com/nats-io/nats-server/v2/server.(*Server).createLeafNode.func2()
github.com/nats-io/nats-server/v2/server/leafnode.go:1384 +0x25
github.com/nats-io/nats-server/v2/server.(*Server).startGoRoutine.func1()
github.com/nats-io/nats-server/v2/server/server.go:4078 +0x32
created by github.com/nats-io/nats-server/v2/server.(*Server).startGoRoutine in goroutine 100604
github.com/nats-io/nats-server/v2/server/server.go:4076 +0x129
Expected behavior
some guard against nil in registerLeafNodeCluster
Server and client version
nats-server 2.12.6
Host environment
No response
Steps to reproduce
No response