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

Submission of connect enabled task with no sidecar_service stanza causes panic #7679

Closed
shoenig opened this issue Apr 9, 2020 · 1 comment · Fixed by #7683
Closed

Submission of connect enabled task with no sidecar_service stanza causes panic #7679

shoenig opened this issue Apr 9, 2020 · 1 comment · Fixed by #7683
Assignees
Labels
theme/consul/connect Consul Connect integration type/bug

Comments

@shoenig
Copy link
Member

shoenig commented Apr 9, 2020

Luckily Nomad agent continues operating, this is purely cosmetic.

$ cat foo.nomad
job "foo" {
  datacenters = ["dc1"]

  group "api" {
    network {
      mode = "bridge"
    }

    service {
      name = "count-api"
      connect {
	# sidecar_service {}
      }
    }
  }

  task "web" {
    driver = "docker"
    config {
      image = "hashicorpnomad/counter-api:v1"
    }
  }
}    

Logs

2020/04/09 14:26:33.621409 http: panic serving 127.0.0.1:40170: runtime error: invalid memory address or nil pointer dereference
goroutine 2404 [running]:
net/http.(*conn).serve.func1(0xc00003a6e0)
	/opt/google/go/src/net/http/server.go:1772 +0x139
panic(0x2784420, 0x4fc66f0)
	/opt/google/go/src/runtime/panic.go:973 +0x3e3
github.com/hashicorp/nomad/nomad/structs.(*ConsulSidecarService).Copy(0x0, 0x2c9ae40)
	/home/hoenig/go/src/github.com/hashicorp/nomad/nomad/structs/services.go:705 +0x26
github.com/hashicorp/nomad/nomad/structs.(*ConsulConnect).Copy(0xc00128a9a0, 0x0)
	/home/hoenig/go/src/github.com/hashicorp/nomad/nomad/structs/services.go:642 +0x3c
github.com/hashicorp/nomad/nomad/structs.(*Service).Copy(0xc00003a780, 0x1)
	/home/hoenig/go/src/github.com/hashicorp/nomad/nomad/structs/services.go:397 +0x203
github.com/hashicorp/nomad/nomad/structs.(*TaskGroup).Copy(0xc0003425a0, 0xc000342870)
	/home/hoenig/go/src/github.com/hashicorp/nomad/nomad/structs/structs.go:5251 +0x387
github.com/hashicorp/nomad/nomad/structs.(*Job).Copy(0xc0009cc5a0, 0x27cf9e0)
	/home/hoenig/go/src/github.com/hashicorp/nomad/nomad/structs/structs.go:3701 +0x221
github.com/hashicorp/nomad/nomad.(*Job).admissionValidators(0xc000126410, 0xc0009cc5a0, 0xc0009cc5a0, 0x0, 0x0, 0x0, 0x0)
	/home/hoenig/go/src/github.com/hashicorp/nomad/nomad/job_endpoint_hooks.go:75 +0x40
github.com/hashicorp/nomad/nomad.(*Job).admissionControllers(0xc000126410, 0xc0009cc5a0, 0x7, 0x34e7701, 0xc000c02660, 0x29e3920, 0xc000c02660, 0x2469cc0)
	/home/hoenig/go/src/github.com/hashicorp/nomad/nomad/job_endpoint_hooks.go:48 +0xa9
github.com/hashicorp/nomad/nomad.(*Job).Register(0xc000126410, 0xc000c02660, 0xc0000ad270, 0x0, 0x0)
	/home/hoenig/go/src/github.com/hashicorp/nomad/nomad/job_endpoint.go:93 +0x3b8
reflect.Value.call(0xc00087f440, 0xc00099c678, 0x13, 0x2dcd772, 0x4, 0xc0019df5d0, 0x3, 0x3, 0xc0000ad270, 0xc0019df628, ...)
	/opt/google/go/src/reflect/value.go:460 +0x8ab
reflect.Value.Call(0xc00087f440, 0xc00099c678, 0x13, 0xc0019df5d0, 0x3, 0x3, 0x8, 0x16, 0x16)
	/opt/google/go/src/reflect/value.go:321 +0xb4
net/rpc.(*service).call(0xc000a84e00, 0xc000126280, 0xc001ae25e0, 0x0, 0xc00011e600, 0xc000454c00, 0x29e3920, 0xc000c02660, 0x16, 0x2469cc0, ...)
	/opt/google/go/src/net/rpc/server.go:377 +0x17f
net/rpc.(*Server).ServeRequest(0xc000126280, 0x34e0e40, 0xc000a36740, 0xc000bfef30, 0xc00007ea80)
	/opt/google/go/src/net/rpc/server.go:498 +0x23e
github.com/hashicorp/nomad/nomad.(*Server).RPC(0xc000165200, 0x2ddbf29, 0xc, 0x29e3920, 0xc000c02600, 0x2469cc0, 0xc0000ad1d0, 0xc0006e8001, 0xc0000ad1d0)
	/home/hoenig/go/src/github.com/hashicorp/nomad/nomad/server.go:1517 +0xb9
github.com/hashicorp/nomad/command/agent.(*Agent).RPC(0xc0008421a0, 0x2ddbf29, 0xc, 0x29e3920, 0xc000c02600, 0x2469cc0, 0xc0000ad1d0, 0x0, 0x8)
	/home/hoenig/go/src/github.com/hashicorp/nomad/command/agent/agent.go:929 +0x7d
github.com/hashicorp/nomad/command/agent.(*HTTPServer).jobUpdate(0xc00099b630, 0x34c8700, 0xc000c025a0, 0xc0006e8000, 0x0, 0x0, 0x0, 0xc000b05970, 0x8, 0xc000b05930)
	/home/hoenig/go/src/github.com/hashicorp/nomad/command/agent/job_endpoint.go:426 +0x383
github.com/hashicorp/nomad/command/agent.(*HTTPServer).JobsRequest(0xc00099b630, 0x34c8700, 0xc000c025a0, 0xc0006e8000, 0x4d7fb6, 0x5e8f84f9, 0x25049324, 0x43298ff7d451)
	/home/hoenig/go/src/github.com/hashicorp/nomad/command/agent/job_endpoint.go:22 +0x84
github.com/hashicorp/nomad/command/agent.(*HTTPServer).wrap.func1(0x34c8700, 0xc000c025a0, 0xc0006e8000)
	/home/hoenig/go/src/github.com/hashicorp/nomad/command/agent/http.go:444 +0x176
net/http.HandlerFunc.ServeHTTP(0xc0003fcda0, 0x34c8700, 0xc000c025a0, 0xc0006e8000)
	/opt/google/go/src/net/http/server.go:2012 +0x44
net/http.(*ServeMux).ServeHTTP(0xc000745680, 0x34c8700, 0xc000c025a0, 0xc0006e8000)
	/opt/google/go/src/net/http/server.go:2387 +0x1a5
github.com/hashicorp/nomad/vendor/github.com/NYTimes/gziphandler.GzipHandlerWithOpts.func1.1(0x34cc780, 0xc0018aa620, 0xc0006e8000)
	/home/hoenig/go/src/github.com/hashicorp/nomad/vendor/github.com/NYTimes/gziphandler/gzip.go:269 +0x1e6
net/http.HandlerFunc.ServeHTTP(0xc000b96db0, 0x34cc780, 0xc0018aa620, 0xc0006e8000)
	/opt/google/go/src/net/http/server.go:2012 +0x44
net/http.serverHandler.ServeHTTP(0xc000ba8000, 0x34cc780, 0xc0018aa620, 0xc0006e8000)
	/opt/google/go/src/net/http/server.go:2807 +0xa3
net/http.(*conn).serve(0xc00003a6e0, 0x34e0b80, 0xc000a36380)
	/opt/google/go/src/net/http/server.go:1895 +0x86c
created by net/http.(*Server).Serve
	/opt/google/go/src/net/http/server.go:2933 +0x35c
    2020-04-09T14:26:34.530-0600 [DEBUG] http: request complete: method=GET path=/v1/agent/health?type=server duration=476.2µs
    2020-04-09T14:26:38.974-0600 [DEBUG] http: request complete: method=GET path=/v1/agent/health?type=client duration=284.607µs
@github-actions
Copy link

github-actions bot commented Nov 9, 2022

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 9, 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