Skip to content

cli: fix job dispatch and periodic force against older servers#28014

Merged
tgross merged 2 commits into
hashicorp:mainfrom
eyupcanakman:fix/jobidbyprefix-old-server-fallback
Jun 1, 2026
Merged

cli: fix job dispatch and periodic force against older servers#28014
tgross merged 2 commits into
hashicorp:mainfrom
eyupcanakman:fix/jobidbyprefix-old-server-fallback

Conversation

@eyupcanakman

Copy link
Copy Markdown
Contributor

Description

nomad job dispatch and nomad job periodic force fail with failed to create result paginator when a newer CLI talks to an older server. #27631 switched the prefix lookup in JobIDByPrefix to a server-side filter that uses the is not nil operator. 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> printed failed to create result paginator. After it, the job dispatches. nomad job periodic force works 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

This contribution was developed with AI assistance (Claude Code), used to trace the regression and draft the fix and test.

@eyupcanakman eyupcanakman requested review from a team as code owners May 20, 2026 12:17
@hashicorp-cla-app

hashicorp-cla-app Bot commented May 20, 2026

Copy link
Copy Markdown

CLA assistant check
All committers have signed the CLA.

@tgross tgross self-requested a review May 22, 2026 19:32
@tgross tgross moved this from Needs Triage to Triaging in Nomad - Community Issues Triage May 22, 2026
@tgross tgross moved this from Triaging to In Progress in Nomad - Community Issues Triage May 22, 2026

@tgross tgross left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 thread command/meta.go
Comment thread api/api.go
Comment thread command/meta_test.go
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.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice!

Comment thread command/meta.go Outdated
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
@eyupcanakman eyupcanakman force-pushed the fix/jobidbyprefix-old-server-fallback branch from 8110a04 to e3b4174 Compare May 25, 2026 19:28
@eyupcanakman

Copy link
Copy Markdown
Contributor Author

Pushed the changes you asked for. One heads up: the failing copywrite check is from version/version.go on main (the 2.0.2 release commit), not this PR, so it will clear once that's fixed upstream and I rebase.

No caller passed a non-empty filter to the exported helpers.
The unexported jobIDByPrefix keeps filter for the old-server fallback.
@tgross tgross self-assigned this Jun 1, 2026

@tgross tgross left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! Thanks @eyupcanakman!

@tgross tgross added the backport/1.11.x backport to 1.11.x release line label Jun 1, 2026
@tgross tgross merged commit de94093 into hashicorp:main Jun 1, 2026
34 of 35 checks passed
@github-project-automation github-project-automation Bot moved this from In Progress to Done in Nomad - Community Issues Triage Jun 1, 2026
@tgross tgross added backport/2.0.x backport to 2.0.x release line and removed backport/1.11.x backport to 1.11.x release line labels Jun 1, 2026
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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport/2.0.x backport to 2.0.x release line theme/cli type/bug

Projects

Development

Successfully merging this pull request may close these issues.

nomad job dispatch gives "failed to create result paginator" with 1.11.3 client against 1.11.2 server

2 participants