cli: fix job dispatch and periodic force against older servers#28014
Merged
tgross merged 2 commits intoJun 1, 2026
Conversation
tgross
reviewed
May 22, 2026
tgross
left a comment
Member
There was a problem hiding this comment.
This looks great @eyupcanakman. I've left a few minor comments. I think if your rebase on main the copyright header check failure will go away as well.
Comment on lines
+260
to
+262
| // Simulate a server older than 1.11.3: it cannot parse the "is not nil" | ||
| // filter operator and rejects the filtered query while building the result | ||
| // paginator, but still serves an unfiltered prefix list. |
job dispatch and job periodic force fail with "failed to create result paginator" when a newer CLI talks to an older server. hashicorp#27631 switched JobIDByPrefix to a server-side filter using the "is not nil" operator, which older servers (go-bexpr v0.1.15, pre-1.11.3) cannot parse. The CLI now keeps that filter as the fast path and falls back to an unfiltered prefix list plus a client-side match when an old server rejects it. Fixes hashicorp#27680
8110a04 to
e3b4174
Compare
Contributor
Author
|
Pushed the changes you asked for. One heads up: the failing copywrite check is from |
No caller passed a non-empty filter to the exported helpers. The unexported jobIDByPrefix keeps filter for the old-server fallback.
tgross
pushed a commit
that referenced
this pull request
Jun 1, 2026
job dispatch and job periodic force fail with "failed to create result paginator" when a newer CLI talks to an older server. #27631 switched JobIDByPrefix to a server-side filter using the "is not nil" operator, which older servers (go-bexpr v0.1.15, pre-1.11.3) cannot parse. The CLI now keeps that filter as the fast path and falls back to an unfiltered prefix list plus a client-side match when an old server rejects it. Fixes #27680
tgross
pushed a commit
that referenced
this pull request
Jun 1, 2026
…rvers (#28014) (#28070) job dispatch and job periodic force fail with "failed to create result paginator" when a newer CLI talks to an older server. #27631 switched JobIDByPrefix to a server-side filter using the "is not nil" operator, which older servers (go-bexpr v0.1.15, pre-1.11.3) cannot parse. The CLI now keeps that filter as the fast path and falls back to an unfiltered prefix list plus a client-side match when an old server rejects it. Fixes #27680 Co-authored-by: Eyüp Can Akman <eyupcanakman@gmail.com>
tehut
pushed a commit
that referenced
this pull request
Jun 12, 2026
job dispatch and job periodic force fail with "failed to create result paginator" when a newer CLI talks to an older server. #27631 switched JobIDByPrefix to a server-side filter using the "is not nil" operator, which older servers (go-bexpr v0.1.15, pre-1.11.3) cannot parse. The CLI now keeps that filter as the fast path and falls back to an unfiltered prefix list plus a client-side match when an old server rejects it. Fixes #27680
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
nomad job dispatchandnomad job periodic forcefail withfailed to create result paginatorwhen a newer CLI talks to an older server. #27631 switched the prefix lookup inJobIDByPrefixto a server-side filter that uses theis not niloperator. That operator landed in go-bexpr v0.1.16, which ships in Nomad 1.11.3, so a 1.11.2 server rejects the filter while building the paginator.The fix keeps the server-side filter as the fast path. When an older server rejects it, the CLI falls back to an unfiltered prefix list and applies the same match on the client, which is what the code did before #27631. Other prefix lookups are unchanged.
Testing & Reproduction steps
Reproduced with a 1.11.2 server and a 1.11.3 CLI. Before the fix,
nomad job dispatch <parameterized-job>printedfailed to create result paginator. After it, the job dispatches.nomad job periodic forceworks too.Added
TestMeta_JobIDByPrefix_OldServerFallback, which stubs an old server that rejects the filter and checks the fallback narrows to the parameterized job.go test ./command/passes.Links
Fixes #27680
Per @tgross's diagnosis in the issue: the regression comes from #27631, and the agreed approach is to keep the server-side filter and fall back to the old client-side path for older servers.
Contributor Checklist
.changelog/27680.txt.TestMeta_JobIDByPrefix_OldServerFallbackfor the fallback path.This contribution was developed with AI assistance (Claude Code), used to trace the regression and draft the fix and test.