You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm trying to federate two consul clusters, a primary one with three server nodes and a secondary one with three server nodes.
When starting the replication, i get a panic: runtime error: invalid memory address or nil pointer dereference on the secondary cluster
Reproduction Steps
Steps to reproduce this issue:
Create a cluster with 3 server nodes and a second one with 1 server node, the cluster are running on docker with host network and setup with ansible; i use the initial manangement tokens, different for the two clusters
Create with terraform consul provider a replication token, an agent token and dns token with relative roles (i use the builtin one for dns), a jwt auth method and relative bindings to certain roles
Set the agent and replication token on all server nodes for both clusters in a different config file
Can confirm the issue. Federated two DCs, once replication got up the servers in the secondary DC are crashing continuously.
Unfortunately removing builtin/dns didn't fix the issue for me.
The only other templated policies I use are builtin/service and builtin/api-gateway. Unfortunately, I use them a lot, so removing them is quite a lot of work. @SilverXXX Do you use any other templated policies besides builtin/dns?
Overview of the Issue
I'm trying to federate two consul clusters, a primary one with three server nodes and a secondary one with three server nodes.
When starting the replication, i get a panic: runtime error: invalid memory address or nil pointer dereference on the secondary cluster
Reproduction Steps
Steps to reproduce this issue:
Consul info for both Client and Server
Server first cluster info
Server second cluster info
Common token config file
Flatcar linux on vmware VM, running official consul container images version 1.19.1
Log Fragments
2024-09-03T10:22:23.213Z [INFO] agent: Joining cluster...: cluster=WAN
2024-09-03T10:22:23.213Z [INFO] agent: (WAN) joining: wan_addresses=["10.100.4.225", "10.100.4.224", "10.100.4.223"]
2024-09-03T10:22:23.221Z [INFO] agent: (WAN) joined: number_of_nodes=3
2024-09-03T10:22:23.223Z [INFO] agent: Join cluster completed. Synced with initial agents: cluster=WAN num_agents=3
2024-09-03T10:22:31.217Z [WARN] agent.server.raft: heartbeat timeout reached, starting election: last-leader-addr= last-leader-id=
2024-09-03T10:22:31.217Z [INFO] agent.server.raft: entering candidate state: node="Node at 10.100.4.227:8300 [Candidate]" term=11
2024-09-03T10:22:31.222Z [INFO] agent.server.raft: election won: term=11 tally=1
2024-09-03T10:22:31.223Z [INFO] agent.server.raft: entering leader state: leader="Node at 10.100.4.227:8300 [Leader]"
2024-09-03T10:22:31.223Z [INFO] agent.server: cluster leadership acquired
2024-09-03T10:22:31.223Z [INFO] agent.server: New leader elected: payload=GSVCSRTST04
2024-09-03T10:22:31.229Z [INFO] agent.leader: started routine: routine="ACL policy replication"
2024-09-03T10:22:31.229Z [INFO] agent.leader: started routine: routine="ACL role replication"
2024-09-03T10:22:31.229Z [INFO] agent.leader: started routine: routine="ACL token replication"
2024-09-03T10:22:31.229Z [INFO] agent.server.replication.acl.policy: started ACL Policy replication
2024-09-03T10:22:31.229Z [INFO] agent.server.replication.acl.role: started ACL Role replication
2024-09-03T10:22:31.229Z [INFO] agent.server.replication.acl.token: started ACL Token replication
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x8 pc=0x102bd6a]
goroutine 154 [running]:
github.com/hashicorp/consul/agent/structs.(*ACLTemplatedPolicyVariables).EstimateSize(...)
github.com/hashicorp/consul/agent/structs/acl_templated_policy.go:229
github.com/hashicorp/consul/agent/structs.(*ACLTemplatedPolicy).EstimateSize(...)
github.com/hashicorp/consul/agent/structs/acl_templated_policy.go:220
github.com/hashicorp/consul/agent/structs.(*ACLToken).EstimateSize(0xc001485b80?)
github.com/hashicorp/consul/agent/structs/acl.go:569 +0xea
github.com/hashicorp/consul/agent/consul.(*aclTokenReplicator).PendingUpdateEstimatedSize(0x989680?, 0x7f6108b8ad08?)
github.com/hashicorp/consul/agent/consul/acl_replication_types.go:103 +0x25
github.com/hashicorp/consul/agent/consul.(*Server).updateLocalACLType(0xc000cd9808, {0x54c3b98, 0xc0005c8280}, {0x54e4ca8, 0xc000b99d10}, {0x54dc5e0, 0xc001484fa0})
github.com/hashicorp/consul/agent/consul/acl_replication.go:290 +0x388
github.com/hashicorp/consul/agent/consul.(*Server).replicateACLType(0xc000cd9808, {0x54c3b98, 0xc0005c8280}, {0x54e4ca8, 0xc000b99d10}, {0x54dc5e0, 0xc001484fa0}, 0x0)
github.com/hashicorp/consul/agent/consul/acl_replication.go:468 +0xd5c
github.com/hashicorp/consul/agent/consul.(*Server).replicateACLTokens(0xc000cd9808, {0x54c3b98, 0xc0005c8280}, {0x54e4ca8, 0xc000b99d10}, 0x0)
github.com/hashicorp/consul/agent/consul/acl_replication.go:361 +0x65
github.com/hashicorp/consul/agent/consul.(*Server).runACLReplicator(0xc000cd9808, {0x54c3b98, 0xc0005c8280}, {0x54e4ca8, 0xc000b99d10}, {0x43f5f79, 0x6}, 0xc000b93ed0, {0x43ff33d, 0xa})
github.com/hashicorp/consul/agent/consul/leader.go:772 +0x144
github.com/hashicorp/consul/agent/consul.(*Server).runACLTokenReplicator(0xc000cd9808, {0x54c3b98, 0xc0005c8280})
github.com/hashicorp/consul/agent/consul/leader.go:747 +0xe6
github.com/hashicorp/consul/lib/routine.(*Manager).execute(0xc00112dec0, {0x54c3b98?, 0xc0005c8280?}, {0x442df2a, 0x15}, 0x0?, 0x0?)
github.com/hashicorp/consul/lib/routine/routine.go:104 +0x7b
created by github.com/hashicorp/consul/lib/routine.(*Manager).Start in goroutine 214
github.com/hashicorp/consul/lib/routine/routine.go:91 +0x2bf
The text was updated successfully, but these errors were encountered: