Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

Maven path-index: "Ambiguous or noncanonical artifact path" error does not report the offending path

Open Beginner friendly
#524 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
76/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Active
Tech stack
python
Domain
backend

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

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from pulp/pulp_maven

All issues in pulp/pulp_maven

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.