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
The tutorial's sample job file generated by nomad job init has a stanza that requires Consul; however, the tutorial has no mention of Consul.
The job fails to place allocations because Constraint "${attr.consul.version} semver >= 1.7.0": 1 nodes excluded by filter.
I found two methods to resolve this:
Comment out part of the generated example.nomad file. Interestingly, generating the file with nomad job init -short does not include the stanza below, so the job runs fine if the shortened version is used.
# comment this outservice {
name="redis-cache"tags=["global", "cache"]
port="db"
}
Run Consul on the side (consul agent -dev) and restart the Nomad agent and job.
Reproduction steps
Follow the tutorial (without running on a VM generated by the provided Vagrantfile because the VM does not work on M1 Macs).
# start the agent
sudo nomad agent -dev -bind 0.0.0.0 -log-level INFO
# generate the sample job
nomad job init
# run the job
nomad job run example.nomad
Expected Result
==> 2022-05-31T11:12:50-07:00: Monitoring evaluation "0890a4fe"
2022-05-31T11:12:50-07:00: Evaluation triggered by job "example"
2022-05-31T11:12:50-07:00: Evaluation within deployment: "6eadb641"
2022-05-31T11:12:50-07:00: Allocation "218ee9a1" created: node "212cb895", group "cache"
2022-05-31T11:12:50-07:00: Evaluation status changed: "pending" ->"complete"
==> 2022-05-31T11:12:50-07:00: Evaluation "0890a4fe" finished with status "complete"
==> 2022-05-31T11:12:50-07:00: Monitoring deployment "6eadb641"
Actual Result
==> 2022-05-31T11:03:44-07:00: Monitoring evaluation "9f103bd6"
2022-05-31T11:03:44-07:00: Evaluation triggered by job "example"
2022-05-31T11:03:44-07:00: Evaluation within deployment: "0b39702a"
2022-05-31T11:03:44-07:00: Evaluation status changed: "pending" ->"complete"
==> 2022-05-31T11:03:44-07:00: Evaluation "9f103bd6" finished with status "complete" but failed to place all allocations:
2022-05-31T11:03:44-07:00: Task Group "cache" (failed to place 1 allocation):
* Constraint "${attr.consul.version} semver >= 1.7.0": 1 nodes excluded by filter
2022-05-31T11:03:44-07:00: Evaluation "5a3da30c" waiting for additional capacity to place remainder
==> 2022-05-31T11:03:44-07:00: Monitoring deployment "0b39702a"
Job file (if appropriate)
Nomad Server logs (if appropriate)
Nomad Client logs (if appropriate)
The text was updated successfully, but these errors were encountered:
This is a known issue that was fixed in #13044. The root cause is an additional validation that was added in Nomad 1.3.0 for Consul-based service discovery where Consul is not actually present. We unfortunately missed updating the long example.nomad job then.
For now you have a few options:
as you noticed, you can remove the service block if that doesn't impact your work
start a Consul dev agent (consul agent -dev)
use Nomad native service discovery by adding this line to the job:
service {
# ...provider="nomad"
}
I'm going to close this issue since we already have a fix, but let me know if you have any other concerns 🙂
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
Nomad v1.3.1
Operating system and Environment details
macOS 12.4 arm64 (MacBookPro18)
Issue
The tutorial's sample job file generated by
nomad job init
has a stanza that requires Consul; however, the tutorial has no mention of Consul.The job fails to place allocations because
Constraint "${attr.consul.version} semver >= 1.7.0": 1 nodes excluded by filter
.I found two methods to resolve this:
example.nomad
file. Interestingly, generating the file withnomad job init -short
does not include the stanza below, so the job runs fine if the shortened version is used.consul agent -dev
) and restart the Nomad agent and job.Reproduction steps
Follow the tutorial (without running on a VM generated by the provided Vagrantfile because the VM does not work on M1 Macs).
# start the agent sudo nomad agent -dev -bind 0.0.0.0 -log-level INFO
Expected Result
Actual Result
Job file (if appropriate)
Nomad Server logs (if appropriate)
Nomad Client logs (if appropriate)
The text was updated successfully, but these errors were encountered: