Improve constraint error message when node is being filtered due to Vault connectivity issues
- Dominant language
- Go
- Stars
- 17k
- Forks
- 2.1k
- Avg merge
- 1d 9h
- Merged PRs (30d)
- 105
Description
### Nomad version
Nomad v1.1.4 (acd3d7889328ad1df2895eb714e2cbe3dd9c6d82)
### Operating system and Environment details
root@nomad-1:~# awk -F= '/PRETTY_NAME/ {print $2}' /etc/os-release
"Ubuntu 20.04.3 LTS"
### Issue
When attempting to schedule a job on a client that is unable to communicate with vault, the job shows an error message similar to the one below:
```hcl2
nomad job run prod-ops-hashi-ui.hcl
==> Monitoring evaluation "7f05f8eb"
Evaluation triggered by job "prod-ops-hashi-ui"
Evaluation within deployment: "98d0065c"
Evaluation status changed: "pending" -> "complete"
==> Evaluation "7f05f8eb" finished with status "complete" but failed to place all allocations:
Task Group "web" (failed to place 1 allocation):
* Constraint "computed class ineligible": 1 nodes excluded by filter
Evaluation "768527a5" waiting for additional capacity to place remainder
```
Node: The Example error message above is from issue #8411. Unfortunately(or rather, fortunately), I do not have a job producing this error at the moment due to having resolved the issue last week.
This error was being caused due to the only nomad client in the DC specified by the job having an incorrect Vault Address configured for it. The client in question had debug output enabled and was being actively worked on so the messages about the client being unable to reach vault were getting lost in the shuffle so it wasn't immediately obvious that there was an issue with vault on the client while trying to debug why the job was failing to schedule.
### Reproduction steps
1. Create a nomad server and client
2. Configure the server to properly connect to Vault
3. Configure the client with an incorrect vault address
4. Deploy a nomad job configured to pull secrets from vault
5. Observe the failure to place message similar to the one below
```
[...truncated...]
* Constraint "computed class ineligible": 1 nodes excluded by filter
Evaluation "768527a5" waiting for additional capacity to place remainder
```
#### Expected Result
The failure to place a job should provide more specific information as to why a client failed to meet the jobs constraint. Specifically, if the client is unable to communicate with vault, the constraint message should show something along the lines of:
```
[...truncated...]
* Constraint "Vault capability available": 1 nodes excluded by filter
Evaluation "768527a5" waiting for additional capacity to place remainder
```
#### Actual Result
Job run output similar to
```
[...truncated...]
* Constraint "computed class ineligible": 1 nodes excluded by filter
Evaluation "768527a5" waiting for additional capacity to place remainder
```
### Nomad Server/Client logs
No longer have the logs from the client that was having this issue. Could recreate the scenario in question if needed to obtain new logs.
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.