Maven path-index: "Ambiguous or noncanonical artifact path" error does not report the offending path
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 76/100
Research direction
Start with checked_rows() in pulp_maven/app/path_index/extract.py, where the reported validation errors are raised. Read the existing path checks and nearby tests, then add the offending relative_path and distinguish validation failures as appropriate. Done when tests verify useful error messages for rejected paths; the issue does not name a specific test file.
Written by the indexing model from the issue text.
Description
Problem
When a path-index-enabled Maven repository finalizes a new version, checked_rows() in
pulp_maven/app/path_index/extract.py validates every artifact relative_path. If any path
is rejected, it raises:
pulp_maven.app.path_index.format.InvalidIndex: Ambiguous or noncanonical artifact path
The message does not include the offending relative_path (nor the content_id), and it
does not say which of the several conditions was violated. This makes the failure very hard to
diagnose: the task simply fails during finalize_new_version, and the operator has no way to tell
which artifact caused it or why.
Where
def checked_rows(rows, domain):
previous = None
for row in rows:
path = row["relative_path"]
if (
path == previous
or not path
or path.startswith("/")
or any(part in {"", ".", ".."} for part in path.split("/"))
):
raise InvalidIndex("Ambiguous or noncanonical artifact path")
...
A single message covers four distinct failure modes:
- duplicate
relative_path(two content units share a path → "ambiguous"), - empty path,
- absolute path (leading
/), - a path containing an empty /
./..segment (//, trailing/,.,..→ "noncanonical").
Observed in production
A pulpcore.app.tasks.repository.add_and_remove task against a path_index: "true" Maven
repository failed with this error. Because the message omits the path, there was no way to
identify the problematic artifact from the task record alone.
Traceback tail:
File ".../pulp_maven/app/path_index/extract.py", line 73, in checked_rows
raise InvalidIndex("Ambiguous or noncanonical artifact path")
pulp_maven.app.path_index.format.InvalidIndex: Ambiguous or noncanonical artifact path
Requested change
Include the offending relative_path in the error message, and ideally distinguish which rule
was violated (duplicate vs. empty vs. absolute vs. non-canonical segment). For the duplicate case,
reporting both colliding content_ids would help. For example:
raise InvalidIndex(f"Ambiguous artifact path (duplicate relative_path): {path!r}")
# or
raise InvalidIndex(f"Noncanonical artifact path: {path!r}")
The sibling checks in the same function ("unresolved on-demand content", "Artifact domain
mismatch", "Artifact storage does not use the supported digest layout") have the same gap and
would benefit from including the relative_path / content_id too.
- Dominant language
- Python
- Stars
- 5
- Forks
- 26
- Avg merge
- 20h 14m
- Merged PRs (30d)
- 43
Getting set up
- No Dockerfile or Docker Compose file
- Has a pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from pulp/pulp_maven
-
Feature Triage-Needed
Difficulty 4/5 3-5 days Newbie friendliness 53/100
pulp/pulp_maven#522 · 3 reactions ·
Maintainers usually reply within 1 day
-
Configurable cache TTL for `maven-metadata.xml` in pull-through cachingPossibly taken @am9zZWY claimed this 1 day ago. OpenFeature Triage-Needed
Difficulty 3/5 1-2 days Newbie friendliness 72/100
pulp/pulp_maven#517 · 2 reactions ·
Maintainers usually reply within 1 day
-
Difficulty 4/5 3-5 days Newbie friendliness 68/100
pulp/pulp_maven#508 ·
Maintainers usually reply within 1 day
-
Feature Triage-Needed
Difficulty 3/5 1-2 days Newbie friendliness 65/100
pulp/pulp_maven#507 ·
Maintainers usually reply within 1 day
-
Difficulty 4/5 3-5 days Newbie friendliness 55/100
pulp/pulp_maven#506 ·
Maintainers usually reply within 1 day
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
UKGovernmentBEIS/inspect_ai#5781 ·
Maintainers usually reply within 2 days
-
Bump .cicd to wamp-cicd 4c2f9ac: `just land` refuses open A18 decisions, `just where` lists themOpen
Difficulty 1/5 Under an hour Newbie friendliness 82/100
crossbario/cfxdb#139 ·
-
Bump .cicd to wamp-cicd 4c2f9ac: `just land` refuses open A18 decisions, `just where` lists themOpen
Difficulty 1/5 Under an hour Newbie friendliness 84/100
crossbario/txaio#241 ·
-
UX
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
mediajunkie/piper-morgan-product#1963 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 64/100