hashicorp / hashicorp/nomad

job with service.connect can run without any defined tasks

Open
#17,517 0 comments 0 reactions 0 assignees View on GitHub
hcc/jira stage/accepted theme/jobspec theme/service-discovery type/bug
Dominant language
Go
Stars
17k
Forks
2.1k
Avg merge
1d 9h
Merged PRs (30d)
105

Description

### Nomad version
Nomad v1.5.6
BuildDate 2023-05-19T18:26:13Z
Revision 8af70885c02ab921dedbdf6bc406a1e886866f80

### Operating system and Environment details
Ubuntu
### Issue
By mistake I have deployed the default example job with connect (`nomad job init --short --connect`) with commented task stanza of task `web`. Nomad was trying to deploy the task group api in a loop.

There is check for Missing tasks for task group but having `connect stanza` maybe is enough to pass it.

### Reproduction steps
Run the provided job
#### Expected Result
Fail to run it
#### Actual Result
Loop trying to deploy the job, see attachment
### Job file

```
job "countdash" {

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

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

connect {
sidecar_service {}
}
}

// task "web" {
// driver = "docker"

// config {
// image = "hashicorpdev/counter-api:v3"
// auth_soft_fail = true
// }
// }
}

group "dashboard" {
network {
mode = "bridge"

port "http" {
static = 9002
to = 9002
}
}

service {
name = "count-dashboard"
port = "9002"

connect {
sidecar_service {
proxy {
upstreams {
destination_name = "count-api"
local_bind_port = 8080
}
}
}
}
}

task "dashboard" {
driver = "docker"

env {
COUNTING_SERVICE_URL = "http://${NOMAD_UPSTREAM_ADDR_count_api}"
}

config {
image = "hashicorpdev/counter-dashboard:v3"
auth_soft_fail = true
}
}
}
}

```

### Nomad logs (if appropriate)
![image (10)](https://github.com/hashicorp/nomad/assets/43340595/78c96f5b-9621-4d57-9658-dde0b64f8ed0)

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.