Skip to content

[BUG] Ignores ssh://, tries https (Bitbucket Datacenter) #661

@maartentamboer

Description

@maartentamboer

Describe the bug
apm will not clone over ssh even though my apm.yml states an ssh:// url. Git is configured correctly because I can clone within powershell using the same SSH URL.

Since we have a portnumber in our SSH string, maybe apm get's confused by it?

To Reproduce
Steps to reproduce the behavior:

dependencies:
  apm:
    - ssh://git@bitbucket.domain.ext:7999/project/repo.git
  1. Run command 'apm install --update --verbose'
  2. See error
apm install --update --verbose
[>] Installing dependencies from apm.yml...
Parsed apm.yml: 1 APM deps, 0 MCP deps
  Failed to download dependency project/repo: Failed to clone repository
project/repo using all available methods. For private repositories on bitbucket.domain.ext,
configure SSH keys or a git credential helper. APM delegates authentication to git for non-GitHub/ADO hosts. Last error:
Cmd('git') failed due to: exit code(128)
  cmdline: git clone -v --depth=1 -- https://bitbucket.domain.ext/project/repo
C:\Users\username\AppData\Local\Temp\tmp2z888u15
  stderr: 'Cloning into 'C:\Users\username\AppData\Local\Temp\tmp2z888u15'...
fatal: repository 'https://bitbucket.domain.ext/project/repo/' not found
'
Resolved 1 direct dependencies (no transitive)
Active project targets: copilot

  Skipping project/repo (already failed during resolution)

No MCP dependencies found in apm.yml

-- Diagnostics --
  [x] 1 package failed:
    +- project/repo -- Failed to download dependency project/repo: Failed to
clone repository project/repo using all available methods. For private repositories on
bitbucket.domain.ext, configure SSH keys or a git credential helper. APM delegates authentication to git for
non-GitHub/ADO hosts. Last error: Cmd('git') failed due to: exit code(128)
  cmdline: git clone -v --depth=1 -- https://bitbucket.domain.ext/project/repo
C:\Users\username\AppData\Local\Temp\tmp2z888u15
  stderr: 'Cloning into 'C:\Users\username\AppData\Local\Temp\tmp2z888u15'...
fatal: repository 'https://bitbucket.domain.ext/project/repo/' not found
'

[x] Installation failed with 1 error(s).

Cloning in Powershell via git clone ssh://git@bitbucket.domain.ext:7999/project/repo.git works.

Changing to https in apm works as a workaround. But all colleagues clone over SSH and don't have HTTPS setup.

dependencies:
  apm:
    - https://bitbucket.domain.ext/scm/project/repo.git

Expected behavior
I expect apm to only clone via ssh when I specify a specific ssh:// url.

Environment (please complete the following information):

  • OS: Windows
  • Python Version: Installed via irm https://aka.ms/apm-windows | iex
  • APM Version: Agent Package Manager (APM) CLI version 0.8.11
  • VSCode Version (if relevant): N/A

Logs
If applicable, add any error logs or screenshots.

Additional context
Add any other context about the problem here.

Metadata

Metadata

Assignees

No one assigned

    Labels

    acceptedDirection approved, safe to start workbugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions