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

Connect stanza panics if network mode is not set to bridge #6571

Closed
nii236 opened this issue Oct 26, 2019 · 1 comment · Fixed by #6575
Closed

Connect stanza panics if network mode is not set to bridge #6571

nii236 opened this issue Oct 26, 2019 · 1 comment · Fixed by #6575
Assignees
Labels
theme/consul/connect Consul Connect integration type/bug
Milestone

Comments

@nii236
Copy link

nii236 commented Oct 26, 2019

Nomad version

Nomad v0.10.0 (25ee121d951939504376c70bf8d7950c1ddb6a82)

Operating system and Environment details

Ubuntu 18.04

Issue

Server panics so the returned error message is not clear.

Example below is from the nomad/consul integration guide.

I understand the error message and what the problem is, I just wanted to report it as a panic is not desirable.

Reproduction steps

Working:

job "countdash" {
	datacenters = ["dc1"]
	group "api" {
		network {
			mode = "bridge"
		}

		service {
			name = "count-api"
			port = "9001"

			connect {
				sidecar_service {}
			}
		}
        ...
    }
}

Not working:

job "countdash" {
	datacenters = ["dc1"]
	group "api" {
		// network {
		// 	mode = "bridge"
		// }

		service {
			name = "count-api"
			port = "9001"

			connect {
				sidecar_service {}
			}
		}
        ...
    }
}

Job file (if appropriate)

Nomad Client logs (if appropriate)

$ nomad run count.nomad
Error submitting job: Put http://127.0.0.1:4646/v1/jobs: EOF

Nomad Server logs (if appropriate)

    2019/10/26 21:58:13.546974 http: panic serving 127.0.0.1:50794: runtime error: index out of range
goroutine 6408 [running]:
net/http.(*conn).serve.func1(0xc000de6500)
        /usr/local/go/src/net/http/server.go:1769 +0x139
panic(0x21e3d40, 0x42f6110)
        /usr/local/go/src/runtime/panic.go:522 +0x1b5
github.com/hashicorp/nomad/nomad.groupConnectHook(0xc000728ee0, 0x204c180, 0x48b48f)
        /opt/gopath/src/github.com/hashicorp/nomad/nomad/job_endpoint_hook_connect.go:127 +0x558
github.com/hashicorp/nomad/nomad.jobConnectHook.Mutate(0xc0009361e0, 0x16, 0xc000f62d70, 0xc000f62dd0, 0x200a7e0, 0xf80914, 0xf80745)
        /opt/gopath/src/github.com/hashicorp/nomad/nomad/job_endpoint_hook_connect.go:53 +0x71
github.com/hashicorp/nomad/nomad.(*Job).admissionMutators(0xc000502d70, 0xc0009361e0, 0xc000bc9ec0, 0x0, 0xc0005fe000, 0x7f67264ed6d0, 0x0, 0x451f38)
        /opt/gopath/src/github.com/hashicorp/nomad/nomad/job_endpoint_hooks.go:44 +0xd3
github.com/hashicorp/nomad/nomad.(*Job).admissionControllers(0xc000502d70, 0xc0009361e0, 0x7, 0x1, 0x3, 0xbf65321d609928bd, 0x2d2361d679, 0x4440640)
        /opt/gopath/src/github.com/hashicorp/nomad/nomad/job_endpoint_hooks.go:26 +0x4d
github.com/hashicorp/nomad/nomad.(*Job).Register(0xc000502d70, 0xc0014002a0, 0xc0004f54a0, 0x0, 0x0)
        /opt/gopath/src/github.com/hashicorp/nomad/nomad/job_endpoint.go:97 +0x3d4
reflect.Value.call(0xc0006b0780, 0xc000010c88, 0x13, 0x25ed51e, 0x4, 0xc000f63728, 0x3, 0x3, 0xc0004f54a0, 0x16, ...)
        /usr/local/go/src/reflect/value.go:447 +0x461
reflect.Value.Call(0xc0006b0780, 0xc000010c88, 0x13, 0xc000f63728, 0x3, 0x3, 0x16, 0x0, 0x241d980)
        /usr/local/go/src/reflect/value.go:308 +0xa4
net/rpc.(*service).call(0xc0003fa3c0, 0xc000502c30, 0xc001110e98, 0x0, 0xc00016e800, 0xc0004ccd00, 0x241d980, 0xc0014002a0, 0x16, 0x2299820, ...)
        /usr/local/go/src/net/rpc/server.go:384 +0x14e
net/rpc.(*Server).ServeRequest(0xc000502c30, 0x2a89ae0, 0xc0006bdcc0, 0xc000684000, 0xc0005fe000)
        /usr/local/go/src/net/rpc/server.go:505 +0x23e
github.com/hashicorp/nomad/nomad.(*Server).RPC(0xc000193340, 0x25fb9f0, 0xc, 0x241d980, 0xc001400240, 0x2299820, 0xc0004f5450, 0xc000e7e901, 0xc0004f5450)
        /opt/gopath/src/github.com/hashicorp/nomad/nomad/server.go:1441 +0xb9
github.com/hashicorp/nomad/command/agent.(*Agent).RPC(0xc00035c420, 0x25fb9f0, 0xc, 0x241d980, 0xc001400240, 0x2299820, 0xc0004f5450, 0x0, 0x8)
        /opt/gopath/src/github.com/hashicorp/nomad/command/agent/agent.go:919 +0x7a
github.com/hashicorp/nomad/command/agent.(*HTTPServer).jobUpdate(0xc000987310, 0x2a74c20, 0xc0014001e0, 0xc000e7e900, 0x0, 0x0, 0xc000773700, 0xc0013bf424, 0x8, 0x8)
        /opt/gopath/src/github.com/hashicorp/nomad/command/agent/job_endpoint.go:422 +0x386
github.com/hashicorp/nomad/command/agent.(*HTTPServer).JobsRequest(0xc000987310, 0x2a74c20, 0xc0014001e0, 0xc000e7e900, 0xc0004bb610, 0xc001608ac0, 0x38, 0xc001608ab8)
        /opt/gopath/src/github.com/hashicorp/nomad/command/agent/job_endpoint.go:21 +0x8a
github.com/hashicorp/nomad/command/agent.(*HTTPServer).wrap.func1(0x2a74c20, 0xc0014001e0, 0xc000e7e900)
        /opt/gopath/src/github.com/hashicorp/nomad/command/agent/http.go:294 +0x149
net/http.HandlerFunc.ServeHTTP(0xc000443d80, 0x2a74c20, 0xc0014001e0, 0xc000e7e900)
        /usr/local/go/src/net/http/server.go:1995 +0x44
net/http.(*ServeMux).ServeHTTP(0xc000773700, 0x2a74c20, 0xc0014001e0, 0xc000e7e900)
        /usr/local/go/src/net/http/server.go:2375 +0x1d6
github.com/hashicorp/nomad/vendor/github.com/NYTimes/gziphandler.GzipHandlerWithOpts.func1.1(0x2a77e20, 0xc000728b60, 0xc000e7e900)
        /opt/gopath/src/github.com/hashicorp/nomad/vendor/github.com/NYTimes/gziphandler/gzip.go:269 +0x1db
net/http.HandlerFunc.ServeHTTP(0xc000820180, 0x2a77e20, 0xc000728b60, 0xc000e7e900)
        /usr/local/go/src/net/http/server.go:1995 +0x44
net/http.serverHandler.ServeHTTP(0xc0006d8000, 0x2a77e20, 0xc000728b60, 0xc000e7e900)
        /usr/local/go/src/net/http/server.go:2774 +0xa8
net/http.(*conn).serve(0xc000de6500, 0x2a89820, 0xc0006bd780)
        /usr/local/go/src/net/http/server.go:1878 +0x851
created by net/http.(*Server).Serve
        /usr/local/go/src/net/http/server.go:2884 +0x2f4

@preetapan preetapan added this to the 0.10.1 milestone Oct 27, 2019
@notnoop notnoop self-assigned this Oct 28, 2019
@notnoop notnoop added the theme/consul/connect Consul Connect integration label Oct 28, 2019
@notnoop notnoop added this to Needs Triage in Nomad - Community Issues Triage via automation Oct 28, 2019
@notnoop notnoop moved this from Needs Triage to Triaged in Nomad - Community Issues Triage Oct 28, 2019
Nomad - Community Issues Triage automation moved this from Triaged to Done Oct 28, 2019
@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 Nov 17, 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.

3 participants