Skip to content

How to make sam hold my SSH keys so sam build can download dependencies from my private repository? #390

@MinsungKim-BlockCrafters

Description

Hello.

I am trying to use my private repository's module as lambda dependency with Python 3.9 + pip + zip package.

This is my requirements.txt in lambda app folder;

git+ssh://git@github.com:my_organization/my_package.git

This is error message when I try sam build;

Build Failed
Error: PythonPipBuilder:ResolveDependencies - WARNING: pip is being invoked by an old script wrapper. This will fail in a future version of pip.
Please see https://github.com/pypa/pip/issues/5599 for advice on fixing the underlying issue.
To avoid this problem you can invoke Python with '-m pip' instead of running pip directly.
  Running command git clone --filter=blob:none --quiet 'ssh://****@github.com:(my-organization)/(my-repository).git' /private/var/folders/9n/rcblw37n1xz34qp23kttwz_h0000gn/T/pip-req-build-yj69jbr3
  ssh: Could not resolve hostname github.com:(my-organization): nodename nor servname provided, or not known
  fatal: Could not read from remote repository.

  Please make sure you have the correct access rights
  and the repository exists.
  error: subprocess-exited-with-error
  
  × git clone --filter=blob:none --quiet 'ssh://****@github.com:(my-organization)/(my-repository).git' /private/var/folders/9n/rcblw37n1xz34qp23kttwz_h0000gn/T/pip-req-build-yj69jbr3 did not run successfully.
  │ exit code: 128
  ╰─> See above for output.
  
  note: This error originates from a subprocess, and is likely not a problem with pip.
error: subprocess-exited-with-error

× git clone --filter=blob:none --quiet 'ssh://****@github.com:(my-organization)/(my-repository).git' /private/var/folders/9n/rcblw37n1xz34qp23kttwz_h0000gn/T/pip-req-build-yj69jbr3 did not run successfully.
│ exit code: 128
╰─> See above for output.

note: This error originates from a subprocess, and is likely not a problem with pip.

I hold my SSH keys in ~/.ssh, but it seems SAM CLI does not hold such SSH keys.

I found some several relevant issues;

How to resolve this issue?

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions