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

Forcing a periodic job with a name similar to other periodic jobs fails to find the job #14116

Closed
jamesooo opened this issue Aug 15, 2022 · 2 comments · Fixed by #14333
Closed
Labels
good first issue help-wanted We encourage community PRs for these issues! stage/accepted Confirmed, and intend to work on. No timeline committment though. theme/cli type/bug
Milestone

Comments

@jamesooo
Copy link

Nomad version

Nomad v1.1.6 (b83d623)

Operating system and Environment details

PRETTY_NAME="Debian GNU/Linux 10 (buster)"

Issue

When a periodic job's name is prepended to other jobs nomad job periodic force is unable to find the job

$ nomad job periodic force cluster-rebalance
Prefix matched multiple periodic jobs

ID                                    Type            Priority  Status   Submit Date
cluster-rebalance                     batch/periodic  50        running  2022-08-15T16:51:47Z
cluster-rebalance-testing-drain       batch/periodic  50        running  2022-08-15T17:38:25Z
cluster-rebalance-testing-validation  batch/periodic  50        running  2022-08-15T17:38:25Z

Reproduction steps

  1. create batch/periodic jobs named x, x-testing
  2. attempt nomad job periodic force x will now fail with the message Prefix matched multiple periodic jobs

Expected Result

Execution of x should be forced

Actual Result

Command fails to force placement of job and exits with message Prefix matched multiple periodic jobs

Job file (if appropriate)

Nomad Server logs (if appropriate)

Nomad Client logs (if appropriate)

@jrasell
Copy link
Member

jrasell commented Aug 16, 2022

Hi @jamesooo and thanks for raising this issue which I can also reproduce locally using the steps you provided. The bug is because the CLI performs a prefix search only; whereas we should attempt a direct lookup first before falling back to a prefix lookup.

@jrasell jrasell added theme/cli stage/accepted Confirmed, and intend to work on. No timeline committment though. labels Aug 16, 2022
@jrasell jrasell added this to Needs Triage in Nomad - Community Issues Triage via automation Aug 16, 2022
@jrasell jrasell moved this from Needs Triage to Needs Roadmapping in Nomad - Community Issues Triage Aug 16, 2022
@jrasell jrasell added good first issue help-wanted We encourage community PRs for these issues! labels Aug 18, 2022
@tgross tgross moved this from Needs Roadmapping to In Progress in Nomad - Community Issues Triage Aug 26, 2022
@tgross tgross added this to the 1.3.x milestone Aug 26, 2022
Nomad - Community Issues Triage automation moved this from In Progress to Done Aug 26, 2022
hc-github-team-nomad-core added a commit that referenced this issue Aug 26, 2022
…14116) into release/1.1.x (#14345)

This pull request was automerged via backport-assistant
hc-github-team-nomad-core added a commit that referenced this issue Aug 26, 2022
…14116) into release/1.2.x (#14346)

This pull request was automerged via backport-assistant
hc-github-team-nomad-core added a commit that referenced this issue Aug 26, 2022
…14116) into release/1.3.x (#14347)

This pull request was automerged via backport-assistant
@github-actions
Copy link

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 Dec 25, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
good first issue help-wanted We encourage community PRs for these issues! stage/accepted Confirmed, and intend to work on. No timeline committment though. theme/cli type/bug
Projects
Development

Successfully merging a pull request may close this issue.

3 participants