You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@maven.apache.org by "ascheman (via GitHub)" <gi...@apache.org> on 2026/07/18 09:19:07 UTC
[PR] RRF: self-heal from provably broken auto-discovered prefixes files [maven-resolver]
ascheman opened a new pull request, #1976:
URL: https://github.com/apache/maven-resolver/pull/1976
apache/maven#11856 documented the "broken MRM" failure mode: a group/virtual repository leaks a member repository's `.meta/prefixes.txt`, Resolver trusts the well-formed file, and everything the repository actually serves is denied. It was closed with a doc remark (#1820) and a better error message (apache/maven#11888) — but a single wrong file still silently takes down a whole repository.
We found a large public instance: `https://repo.jenkins-ci.org/public/.meta/prefixes.txt` (Artifactory virtual repo) serves a leaked 11-prefix file of a long-gone member repository ("Generated by Sonatype Nexus", `Last-Modified: 12 Jan 2017`). Neither `/org/jenkins-ci` nor `/io/jenkins` is listed, so with Resolver 2.x defaults **every Jenkins-ecosystem build fails** — verified on Maven 4.0.0-rc-5, current 4.0.x snapshots, and Maven 3.10.0-rc-1 — while 3.9.x works. Reported to jenkins-infra: jenkins-infra/helpdesk#5231. Syntactic validation cannot catch this, and the 2.0.14 guards (`useMirroredRepositories`/`useRepositoryManagers`) never fire because nothing marks a POM-declared repository as MRM-backed.
Change: when an auto-discovered prefixes file denies a path, the first denial per repository is verified against the repository itself via `peek()` (transporter sits below the filtering connector — no recursion). Path exists → file is provably wrong: WARN + drop for the session (behaves as `noInputOutcome`). Path absent / transport error → file stays trusted, request stays denied, no further checks. Bounded cost: at most one existence check per repository per session, only on the deny path — the round trips RRF saves are preserved. User-provided prefix files are never second-guessed; skipped offline; opt-out `aether.remoteRepositoryFilter.prefixes.verifyDenied` (repoId suffix supported).
First commit is the UT reproducing the Jenkins failure (red without the fix); second commit is the fix + docs. Note for Maven core: the `PrefixesRemoteRepositoryFilterSource` constructor gained a `TransporterProvider` parameter — Maven's own wiring needs the same one-liner when upgrading resolver.
Refs apache/maven#11856
🤖 Generated with [Claude Code](https://claude.com/claude-code)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@maven.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] RRF: self-heal from provably broken auto-discovered prefixes files [maven-resolver]
Posted by "cstamas (via GitHub)" <gi...@apache.org>.
cstamas commented on code in PR #1976:
URL: https://github.com/apache/maven-resolver/pull/1976#discussion_r3608223294
##########
src/site/markdown/remote-repository-filtering.md:
##########
@@ -218,3 +218,5 @@ This leads to the following "constraints":
Users of certain Maven Repository Managers (MRM) reported issues with filtering, breaking their builds. Usually the issue involves grouped/virtual repositories where MRM leaks random resources from member repositories, like the `prefixes.txt` is. Naturally, as MRM leaks one member prefixes file, and Maven is "tricked" into belief it got proper prefixes file from remote repository, builds will fail with message like **Prefix `$PREFIX` NOT allowed from `$SERVER_ID`** (where `$PREFIX` is some artifact prefix, and `$SERVER_ID` is some remote repository ID).
In this case, user should disable prefix discovery by using `-Daether.remoteRepositoryFilter.prefixes.resolvePrefixFiles=false` user property to prevent Maven attempting to resolve prefixes file from such broken MRMs.
+
+Since 2.0.21, Resolver protects itself against this failure mode: when an auto-discovered prefixes file denies a path, the very first denial per remote repository is verified against the remote repository itself using a lightweight existence check. If the repository actually serves the denied path, the auto-discovered prefixes file is provably wrong; a warning naming the repository is emitted (report it to the repository administrator) and the file is ignored for the rest of the session, so the build proceeds as if no prefixes file was published. If the denied path is indeed absent remotely, the file remains trusted and no further checks are performed, keeping the extra cost bounded at one existence check per remote repository per session. User-provided prefix files are considered deliberate and are never second-guessed. The verification can be disabled with `-Daether.remoteRepositoryFilter.prefixes.verifyDenied=false` (supports repository ID suffix as well).
Review Comment:
or not?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@maven.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] RRF: self-heal from provably broken auto-discovered prefixes files [maven-resolver]
Posted by "ascheman (via GitHub)" <gi...@apache.org>.
ascheman merged PR #1976:
URL: https://github.com/apache/maven-resolver/pull/1976
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@maven.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] RRF: self-heal from provably broken auto-discovered prefixes files [maven-resolver]
Posted by "ascheman (via GitHub)" <gi...@apache.org>.
ascheman commented on code in PR #1976:
URL: https://github.com/apache/maven-resolver/pull/1976#discussion_r3608456500
##########
src/site/markdown/remote-repository-filtering.md:
##########
@@ -218,3 +218,5 @@ This leads to the following "constraints":
Users of certain Maven Repository Managers (MRM) reported issues with filtering, breaking their builds. Usually the issue involves grouped/virtual repositories where MRM leaks random resources from member repositories, like the `prefixes.txt` is. Naturally, as MRM leaks one member prefixes file, and Maven is "tricked" into belief it got proper prefixes file from remote repository, builds will fail with message like **Prefix `$PREFIX` NOT allowed from `$SERVER_ID`** (where `$PREFIX` is some artifact prefix, and `$SERVER_ID` is some remote repository ID).
In this case, user should disable prefix discovery by using `-Daether.remoteRepositoryFilter.prefixes.resolvePrefixFiles=false` user property to prevent Maven attempting to resolve prefixes file from such broken MRMs.
+
+Since 2.0.21, Resolver protects itself against this failure mode: when an auto-discovered prefixes file denies a path, the very first denial per remote repository is verified against the remote repository itself using a lightweight existence check. If the repository actually serves the denied path, the auto-discovered prefixes file is provably wrong; a warning naming the repository is emitted (report it to the repository administrator) and the file is ignored for the rest of the session, so the build proceeds as if no prefixes file was published. If the denied path is indeed absent remotely, the file remains trusted and no further checks are performed, keeping the extra cost bounded at one existence check per remote repository per session. User-provided prefix files are considered deliberate and are never second-guessed. The verification can be disabled with `-Daether.remoteRepositoryFilter.prefixes.verifyDenied=false` (supports repository ID suffix as well).
Review Comment:
Intentional, not a typo: at that point the existence check has just *proven* the file wrong — it denies a path the repository demonstrably serves (that's the whole trigger condition, we never drop on suspicion). Happy to reword to "demonstrably wrong" if that reads less like a typo.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@maven.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] RRF: self-heal from provably broken auto-discovered prefixes files [maven-resolver]
Posted by "ascheman (via GitHub)" <gi...@apache.org>.
ascheman commented on PR #1976:
URL: https://github.com/apache/maven-resolver/pull/1976#issuecomment-5010839495
Thanks for the review! Added the suggested `noInputOutcome=false` interaction test in 07a0c6c — it passes as you predicted: the broken file is still detected and dropped (exactly one peek), but strict filtering keeps the path denied.
Re CI: the matrix failures are unrelated to this PR — master went red at dbaf3098 (#1970) with the same `UrlTransporterTest`/awaitility signature (fixes in flight: #1977/#1978). Will rebase once one of those lands.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@maven.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] RRF: self-heal from provably broken auto-discovered prefixes files [maven-resolver]
Posted by "cstamas (via GitHub)" <gi...@apache.org>.
cstamas commented on code in PR #1976:
URL: https://github.com/apache/maven-resolver/pull/1976#discussion_r3608222671
##########
src/site/markdown/remote-repository-filtering.md:
##########
@@ -218,3 +218,5 @@ This leads to the following "constraints":
Users of certain Maven Repository Managers (MRM) reported issues with filtering, breaking their builds. Usually the issue involves grouped/virtual repositories where MRM leaks random resources from member repositories, like the `prefixes.txt` is. Naturally, as MRM leaks one member prefixes file, and Maven is "tricked" into belief it got proper prefixes file from remote repository, builds will fail with message like **Prefix `$PREFIX` NOT allowed from `$SERVER_ID`** (where `$PREFIX` is some artifact prefix, and `$SERVER_ID` is some remote repository ID).
In this case, user should disable prefix discovery by using `-Daether.remoteRepositoryFilter.prefixes.resolvePrefixFiles=false` user property to prevent Maven attempting to resolve prefixes file from such broken MRMs.
+
+Since 2.0.21, Resolver protects itself against this failure mode: when an auto-discovered prefixes file denies a path, the very first denial per remote repository is verified against the remote repository itself using a lightweight existence check. If the repository actually serves the denied path, the auto-discovered prefixes file is provably wrong; a warning naming the repository is emitted (report it to the repository administrator) and the file is ignored for the rest of the session, so the build proceeds as if no prefixes file was published. If the denied path is indeed absent remotely, the file remains trusted and no further checks are performed, keeping the extra cost bounded at one existence check per remote repository per session. User-provided prefix files are considered deliberate and are never second-guessed. The verification can be disabled with `-Daether.remoteRepositoryFilter.prefixes.verifyDenied=false` (supports repository ID suffix as well).
Review Comment:
provably -> probably
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@maven.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] RRF: self-heal from provably broken auto-discovered prefixes files [maven-resolver]
Posted by "cstamas (via GitHub)" <gi...@apache.org>.
cstamas commented on PR #1976:
URL: https://github.com/apache/maven-resolver/pull/1976#issuecomment-5010967511
LGTM and fixes landed
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@maven.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org