You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In 0.8.6 we were able to define multiple service blocks with the same name but different tags. We rely on this to map service tags to distinct ports. In 0.9.2 only tags defined in the last service block end up attached to the Consul service and the tags from the other service blocks are silently dropped. This can lead to subtle failures during the upgrade process because the service checks don't enter a failed state, they just disappear completely.
Reproduction steps
Run a job in 0.8.6 with a task that contains two or more service blocks with the same name but different tags and query Consul to see that all service tags are registered. Repeat in 0.9.2 to see that only tags from the last service block are registered.
Job file
job "dummy" {
region = "us-east-1"
datacenters = ["us-east-1a"]
constraint {
attribute = "${attr.nomad.version}"
value = "0.9.2"
}
group "dummy" {
count = 1
task "dummy" {
driver = "docker"
config {
image = "ubuntu:bionic"
command = "/bin/sh"
args = ["-c", "/usr/bin/tail -f /dev/null"]
}
service {
name = "dummy"
port = "foo"
tags = ["foo"]
check {
name = "foo check"
type = "script"
command = "/bin/true"
interval = "10s"
timeout = "2s"
}
}
service {
name = "dummy"
port = "bar"
tags = ["bar"]
check {
name = "bar check"
type = "script"
command = "/bin/true"
interval = "10s"
timeout = "2s"
}
}
service {
name = "dummy"
port = "baz"
tags = ["baz"]
check {
name = "baz check"
type = "script"
command = "/bin/true"
interval = "10s"
timeout = "2s"
}
}
resources {
cpu = 100
memory = 32
network {
mbits = 10
port "foo" {}
port "bar" {}
port "baz" {}
}
}
}
}
}
Logs
I have not found any relevant log entries for this issue.
Nomad 0.8.6 Results
All three checks are created:
root@node01:/var/lib/consul/checks# grep dummy /var/lib/consul/checks/*
/var/lib/consul/checks/5f2d537f72b7f814eaef480666ad22ec:{"Check":{"Node":"node01","CheckID":"b535926bb7450ada076eb00d753c6f87c772edb0","Name":"baz check","Status":"critical","Notes":"","Output":"","ServiceID":"_nomad-task-mlixuvo3phniqlz4pykppgd2ci4ktums","ServiceName":"dummy","ServiceTags":["baz"],"Definition":{},"CreateIndex":0,"ModifyIndex":0},"ChkType":{"CheckID":"b535926bb7450ada076eb00d753c6f87c772edb0","Name":"baz check","Status":"","Notes":"","ScriptArgs":null,"HTTP":"","Header":null,"Method":"","TCP":"","Interval":0,"AliasNode":"","AliasService":"","DockerContainerID":"","Shell":"","GRPC":"","GRPCUseTLS":false,"TLSSkipVerify":false,"Timeout":2000000000,"TTL":41000000000,"DeregisterCriticalServiceAfter":0},"Token":""}
/var/lib/consul/checks/a6282c84c6f73dd52fe49778164743ff:{"Check":{"Node":"node01","CheckID":"5860e3aab0aca098d47f53da65f07552e74a8de2","Name":"bar check","Status":"critical","Notes":"","Output":"","ServiceID":"_nomad-task-ntvpzts5fcetv7kdygrr4kkjktizpfmt","ServiceName":"dummy","ServiceTags":["bar"],"Definition":{},"CreateIndex":0,"ModifyIndex":0},"ChkType":{"CheckID":"5860e3aab0aca098d47f53da65f07552e74a8de2","Name":"bar check","Status":"","Notes":"","ScriptArgs":null,"HTTP":"","Header":null,"Method":"","TCP":"","Interval":0,"AliasNode":"","AliasService":"","DockerContainerID":"","Shell":"","GRPC":"","GRPCUseTLS":false,"TLSSkipVerify":false,"Timeout":2000000000,"TTL":41000000000,"DeregisterCriticalServiceAfter":0},"Token":""}
/var/lib/consul/checks/bf70985be258d37c1d911b511648ff54:{"Check":{"Node":"node01","CheckID":"94da0eec43ed59200e59885194babecfc5792e35","Name":"foo check","Status":"critical","Notes":"","Output":"","ServiceID":"_nomad-task-v5qp7gpz4pcfpjanderga7snvgfc63sq","ServiceName":"dummy","ServiceTags":["foo"],"Definition":{},"CreateIndex":0,"ModifyIndex":0},"ChkType":{"CheckID":"94da0eec43ed59200e59885194babecfc5792e35","Name":"foo check","Status":"","Notes":"","ScriptArgs":null,"HTTP":"","Header":null,"Method":"","TCP":"","Interval":0,"AliasNode":"","AliasService":"","DockerContainerID":"","Shell":"","GRPC":"","GRPCUseTLS":false,"TLSSkipVerify":false,"Timeout":2000000000,"TTL":41000000000,"DeregisterCriticalServiceAfter":0},"Token":""}
grep: /var/lib/consul/checks/state: Is a directory
All checks are registered in Consul with the appropriate tags:
Whoops, yeah. Same issue. I searched for it yesterday and didn't find anything but neglected to refresh my search today before filing. Closing in favor of #5819
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.
Nomad version
Operating system and Environment details
Issue
In
0.8.6
we were able to define multiple service blocks with the same name but different tags. We rely on this to map service tags to distinct ports. In0.9.2
only tags defined in the last service block end up attached to the Consul service and the tags from the other service blocks are silently dropped. This can lead to subtle failures during the upgrade process because the service checks don't enter a failed state, they just disappear completely.Reproduction steps
Run a job in
0.8.6
with a task that contains two or more service blocks with the same name but different tags and query Consul to see that all service tags are registered. Repeat in0.9.2
to see that only tags from the last service block are registered.Job file
Logs
I have not found any relevant log entries for this issue.
Nomad 0.8.6 Results
All three checks are created:
All checks are registered in Consul with the appropriate tags:
And there is a unique
ServiceID
for each tag:Nomad 0.9.2 Results
All three checks are created but they all have the same tag:
Which leads to the following Consul service registration:
The text was updated successfully, but these errors were encountered: