Skip to content

Prune controller-protocol.version from -deps bundle - #3225

Merged
edsavage merged 1 commit into
elastic:mainfrom
edsavage:fix/controller-protocol-version-deps-duplicate
Sep 28, 2026
Merged

edsavage merged 1 commit into
elastic:mainfrom
edsavage:fix/controller-protocol-version-deps-duplicate

Conversation

@edsavage

Copy link
Copy Markdown
Contributor

Summary

Follow-up fix to #3224. That PR added the controller-protocol.version marker to the -nodeps bundle's include list in create_dra.sh, but did not add it to the -deps bundle's prune list. Because the -deps zip is built as "everything not pruned", the marker leaked into both the -deps and -nodeps bundles.

Elasticsearch's ml plugin resolves both bundles and unzips them together into a single plugin bundle:

nativeBundle("org.elasticsearch.ml:ml-cpp:${mlCppVersion()}:deps@zip")   { changing = true }
nativeBundle("org.elasticsearch.ml:ml-cpp:${mlCppVersion()}:nodeps@zip") { changing = true }
// ...
esplugin.bundleSpec.from { configurations.nativeBundle.files.collect { zipTree(it) } }

With the marker now present at the root of both zips, Gradle's Copy task hits a duplicate path and fails (there is no duplicatesStrategy set):

> Task :x-pack:plugin:ml:explodedBundlePlugin FAILED
Caused by: org.gradle.api.InvalidUserCodeException: Entry controller-protocol.version is a duplicate
but no duplicate handling strategy has been set.

This breaks Elasticsearch's :x-pack:plugin:ml:explodedBundlePlugin / bundlePlugin (and every downstream task that depends on them — bundle, release-tests, bwc-snapshots) on main and all open PRs once they resolve the post-#3224 snapshot.

Change

Add -path "**/controller-protocol.version" to the -deps bundle's -prune list so the marker ships only in -nodeps (where verifyControllerProtocolVersion expects it), and not in -deps. The marker is not a 3rd-party dependency, so it does not belong in the deps bundle regardless.

Testing

  • -nodeps bundle still contains controller-protocol.version (unchanged include list).
  • -deps bundle no longer contains it (now pruned), so the Elasticsearch bundle merge sees a single entry.

The marker was added to the -nodeps include list but not the -deps
prune list, so it leaked into both bundles. Elasticsearch's ml plugin
unzips -deps and -nodeps together, so Gradle's Copy fails with a
duplicate controller-protocol.version entry. Prune it from -deps so it
ships only in -nodeps, where the verifyControllerProtocolVersion gate
expects it.
@elasticsearchmachine

Copy link
Copy Markdown

Pinging @elastic/ml-core (Team:ML)

@edsavage
edsavage merged commit b0c52aa into elastic:main Sep 28, 2026
11 of 31 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants