Skip to content

[BUG] Authentication fails for apm install --update with private Git-Repository, SSH based authentication and SSH-Agent #1293

@Alpha200

Description

@Alpha200

Describe the bug

Since apm 0.11 we can not use private Git Repositories as a dependency target in combination with SSH based authentication and a locally running SSH-Agent as the authentication fails for apm install --update. This is a regression as it worked in apm <= 0.10.0 . This only happens with --update as the preflight request fails. Without --update it works.

To Reproduce
Steps to reproduce the behavior:

apm.yml:

version: 1.0.0
description: APM project for example
author: Example
dependencies:
  apm:
  - git: ssh://git@example.com/927eb5ab/ai/agentic-components.git
    ref: v1.0
  mcp: []
scripts: {}
  1. Run apm install --force --verbose --update --target opencode --no-policy
Parsed apm.yml: 1 APM deps, 0 MCP deps
Loaded apm.lock.yaml for SHA comparison (2 dependencies)
    927eb5ab/ai/agentic-components: locked at 515cfb72
Resolved 1 direct dependencies (no transitive)
Phase: resolve -> 0.010s
[!] Policy enforcement disabled by --no-policy for this invocation. This does NOT bypass apm audit --ci. CI will still fail the PR for the same policy violation.
Phase: policy_gate -> 0.000s
[i] Targets: opencode  (source: --target flag)
Phase: targets -> 0.034s
Phase: policy_target_check -> 0.000s
Preflight: gitlab.example.com/927eb5ab -- auth rejected
Authentication failed for gitlab.example.com
Authentication failed for install --update on gitlab.example.com.
No token available.
APM does not apply GitHub PAT environment variables to generic git hosts; configure git credential fill for gitlab.example.com or use a public repository if available.
Run with --verbose for detailed auth diagnostics.

    No files were modified.
    apm.yml, apm.lock.yaml, and apm_modules/ are unchanged.
[!] Install interrupted after 0.5s.

Expected behavior

SSH-based authentication should work with a locally configured ssh-agent. apm should automatically use the SSH-Agent for authentication as it did before.

Environment:

  • OS: macOS
  • Python Version: 3.14.4
  • APM Version: 0.11+

Metadata

Metadata

Assignees

No one assigned

    Labels

    priority/highShips in current or next milestonestatus/needs-triageNew, awaiting maintainer review.type/bugSomething does not work as documented.

    Type

    No type

    Projects

    Status

    In Progress

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions