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/connect: ingress gateway w/ host networking and absent proxy will NPE client #9669

Closed
shoenig opened this issue Dec 17, 2020 · 1 comment · Fixed by #9727
Closed
Assignees
Labels
theme/consul/connect Consul Connect integration type/bug

Comments

@shoenig
Copy link
Member

shoenig commented Dec 17, 2020

When submitting a job with an ingress gateway in host networking mode and no proxy block, the client will NPE.

With bridge networking we inject a proxy block avoiding the condition.

Immediate workaround: add an empty proxy { } block.

# network.mode = "host"

connect {
  gateway {

    # without this block, client will NPE
    # on ingress gateways using host networking
    # proxy {}

    ingress {}
  }
}
==> Newer Nomad version available: 1.0.1 (currently running: 1.0.0-dev)
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x10 pc=0x1551b8e]

goroutine 854 [running]:
github.com/hashicorp/nomad/command/agent/consul.newConnectGateway(0xc000f06220, 0x12, 0xc000866260, 0xc0005ee228)
	/home/shoenig/go/src/github.com/hashicorp/nomad/command/agent/consul/connect.go:52 +0x6e
github.com/hashicorp/nomad/command/agent/consul.(*ServiceClient).serviceRegs(0xc000490000, 0xc000f4a0c0, 0xc000e3a000, 0xc000e3a160, 0x3099d20, 0xc000866220, 0xbabcd8)

The broken line

Best fix is probably to just Canonicalize in a default empty proxy - it gets tweaked by Nomad down the line regardless.

@shoenig shoenig self-assigned this Dec 17, 2020
@shoenig shoenig added type/bug theme/consul/connect Consul Connect integration labels Dec 17, 2020
shoenig added a commit that referenced this issue Jan 5, 2021
Submitting a job with an ingress gateway in host networking mode
with an absent gateway.proxy block would cause the Nomad client
to panic on NPE.

The consul registration bits would assume the proxy stanza was
not nil, but it could be if the user does not supply any manually
configured envoy proxy settings.

Check the proxy field is not nil before using it.

Fixes #9669
backspace pushed a commit that referenced this issue Jan 22, 2021
Submitting a job with an ingress gateway in host networking mode
with an absent gateway.proxy block would cause the Nomad client
to panic on NPE.

The consul registration bits would assume the proxy stanza was
not nil, but it could be if the user does not supply any manually
configured envoy proxy settings.

Check the proxy field is not nil before using it.

Fixes #9669
@github-actions
Copy link

I'm going to lock this issue because it has been closed for 120 days ⏳. This helps our maintainers find and focus on the active issues.
If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Oct 26, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
theme/consul/connect Consul Connect integration type/bug
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant