Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Consul-ESM crashes if there is no Consul Namespaces #175

Open
timotheencl opened this issue Oct 31, 2022 · 1 comment
Open

Consul-ESM crashes if there is no Consul Namespaces #175

timotheencl opened this issue Oct 31, 2022 · 1 comment

Comments

@timotheencl
Copy link

With Consul Enterprise, if there is no Consul Namespace created, Consul ESM will crash when starting up.

Reproduction Steps

  1. Remove all Consul namespaces
  2. Run Consul-ESM

Environment

Consul-ESM: v0.6.2
Consul: v1.13.0+ent

Output of consul Namespaces

$ consul namespace list -format json
[]

Actual result

2022-10-31T19:02:40.883+0100 [INFO]  consul-esm: Trying to obtain leadership...
2022-10-31T19:02:40.892+0100 [INFO]  consul-esm: Obtained leadership
2022-10-31T19:02:40.893+0100 [INFO]  consul-esm: Updating external node list: items=8
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x0 pc=0xbe15e9]

goroutine 39 [running]:
main.(*Agent).getServiceInstances(0xc00010ef80, 0xc0005c9ee8)
        /home/runner/work/consul-esm/consul-esm/leader.go:303 +0x289
main.(*Agent).watchServiceInstances(0xc00010ef80, 0x0?, 0xc00055c180)
        /home/runner/work/consul-esm/consul-esm/leader.go:266 +0x179
created by main.(*Agent).computeWatchedNodes
        /home/runner/work/consul-esm/consul-esm/leader.go:125 +0x165

Workaround

Just by adding a Namespace in Consul:

consul namespace create -name foobar
@eikenb eikenb added this to the v0.7.0 milestone Oct 31, 2022
@eikenb
Copy link
Contributor

eikenb commented Nov 15, 2022

Hey @timotheencl, thanks for the report!

Quick question... how did you delete the default namespace? That shouldn't be possible...

$ consul-ent namespace list -format json
[
   {
      "Name": "default",
      "Description": "Builtin Default Namespace",
      "CreateIndex": 7,
      "ModifyIndex": 7
   }
]
$ consul-ent namespace delete default
Error deleting namespace "default": Unexpected response code: 500 (The "default" namespace is not allowed to be deleted.)

@eikenb eikenb added the unreproducible Cannot reproduce label Dec 8, 2022
@eikenb eikenb removed this from the v0.7.0 milestone Dec 9, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants