Failed to pull GitHub private repo

I know this has been asked before - but I absolutely don't get how to solve it from the responds. I got the SSH key from SSH keys settings, pasted it to my SSH keys on GitHub. I use the Devcontainer template, with my own repository URL. I keep getting an error:
envbuilder v1.1.0+a3a6a83 - Build development environments from repositories in a container
#1: ๐Ÿ“ฆ Cloning [email protected]:MyUsername/my-repository.git to /workspaces/my-repository...
#1: ๐Ÿ”‘ Using SSH authentication!
#1: ๐Ÿ”‘ No SSH key found, falling back to agent!
#1: โŒ Failed to connect to SSH agent: error creating SSH agent: "SSH agent requested but SSH_AUTH_SOCK not-specified"
#1: Parsed Git URL as "ssh://[email protected]/MyUsername/my-repository.git"
Failed to clone repository: clone "[email protected]:MyUsername/my-repository.git": error creating SSH agent: "SSH agent requested but SSH_AUTH_SOCK not-specified"
Falling back to the default image...
envbuilder v1.1.0+a3a6a83 - Build development environments from repositories in a container
#1: ๐Ÿ“ฆ Cloning [email protected]:MyUsername/my-repository.git to /workspaces/my-repository...
#1: ๐Ÿ”‘ Using SSH authentication!
#1: ๐Ÿ”‘ No SSH key found, falling back to agent!
#1: โŒ Failed to connect to SSH agent: error creating SSH agent: "SSH agent requested but SSH_AUTH_SOCK not-specified"
#1: Parsed Git URL as "ssh://[email protected]/MyUsername/my-repository.git"
Failed to clone repository: clone "[email protected]:MyUsername/my-repository.git": error creating SSH agent: "SSH agent requested but SSH_AUTH_SOCK not-specified"
Falling back to the default image...
14 Replies
Codercord
Codercordโ€ข20h ago
<#1320899955531059220>
Category
Help needed
Product
Coder (v2)
Platform
Linux
Logs
Please post any relevant logs/error messages.
Some Dinosaur
Some DinosaurOPโ€ข20h ago
I also ran $GIT_SSH_COMMAND from the container terminal, and it tells me:
usage: ssh [-46AaCfGgKkMNnqsTtVvXxYy] [-B bind_interface] [-b bind_address]
[-c cipher_spec] [-D [bind_address:]port] [-E log_file]
[-e escape_char] [-F configfile] [-I pkcs11] [-i identity_file]
[-J destination] [-L address] [-l login_name] [-m mac_spec]
[-O ctl_cmd] [-o option] [-P tag] [-p port] [-R address]
[-S ctl_path] [-W host:port] [-w local_tun[:remote_tun]]
destination [command [argument ...]]
ssh [-Q query_option]

Coder authenticates with git using the public
key below. All clones with SSH are authenticated automatically ๐Ÿช„.

ssh-ed25519 AAAAC3NzaC1lZXXXXXXXXXHIDINGXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

Add to GitHub and GitLab:
https://github.com/settings/ssh/new

https://gitlab.com/-/profile/keys

Encountered an error running "coder gitssh", see "coder gitssh --help" for more information
error: exit status 255
usage: ssh [-46AaCfGgKkMNnqsTtVvXxYy] [-B bind_interface] [-b bind_address]
[-c cipher_spec] [-D [bind_address:]port] [-E log_file]
[-e escape_char] [-F configfile] [-I pkcs11] [-i identity_file]
[-J destination] [-L address] [-l login_name] [-m mac_spec]
[-O ctl_cmd] [-o option] [-P tag] [-p port] [-R address]
[-S ctl_path] [-W host:port] [-w local_tun[:remote_tun]]
destination [command [argument ...]]
ssh [-Q query_option]

Coder authenticates with git using the public
key below. All clones with SSH are authenticated automatically ๐Ÿช„.

ssh-ed25519 AAAAC3NzaC1lZXXXXXXXXXHIDINGXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

Add to GitHub and GitLab:
https://github.com/settings/ssh/new

https://gitlab.com/-/profile/keys

Encountered an error running "coder gitssh", see "coder gitssh --help" for more information
error: exit status 255
running clone from the terminal also fails even though GIT_SSH_COMMAND is set - I think I'm missing something basic here:
/$ sudo git clone [email protected]:MyUsername/my-repository.git
Cloning into 'my-repository'...
[email protected]: Permission denied (publickey).
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.
/$ sudo git clone [email protected]:MyUsername/my-repository.git
Cloning into 'my-repository'...
[email protected]: Permission denied (publickey).
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.
Phorcys
Phorcysโ€ข10h ago
whoops sorry, I didn't see you're using envbuilder
Phorcys
Phorcysโ€ข10h ago
I am away right now but see https://github.com/coder/envbuilder/issues/333 for more info
GitHub
Allow passing Git SSH key as an environment variable ยท Issue #333 ยท...
Following up to a discord conversation where an user tries to clone a Git repository via SSH and is met with the following error: envbuilder v1.0.0-rc.6+23d086e - Build development environments fro...
Some Dinosaur
Some DinosaurOPโ€ข9h ago
If I do that can I still use the template through?
Phorcys
Phorcysโ€ข7h ago
yes
Some Dinosaur
Some DinosaurOPโ€ข7h ago
I should mention I'm not very smart. But from my perspective I put in a name, github URL (ssh), my github account has Coder SSH set. I click green button and it starts working. So my decision points are literally - SSH key and URL. Next part where I can change anything is .devcontainer folder with Dockerfile and everything else - but I can't get this far :c since I cannot clone the repository. I see the workaround description to just download the key to the environment - I just have no idea where in this user-scenario I can achieve it.
Luna Lovegood
Luna Lovegoodโ€ข5h ago
use external Auth
data "coder_external_auth" "github" {
id = "primary-auth"
}
data "coder_external_auth" "github" {
id = "primary-auth"
}
And set token for envbuilder
"ENVBUILDER_GIT_USERNAME" : data.coder_external_auth.github.access_token,
"ENVBUILDER_GIT_USERNAME" : data.coder_external_auth.github.access_token,
you should setup external Auth for Coder agent first
Some Dinosaur
Some DinosaurOPโ€ข5h ago
you mean in the .tf file of my template? I can't change anything there. Publish is grayed out and nothing I do here's saved
Luna Lovegood
Luna Lovegoodโ€ข5h ago
build it before publish
Some Dinosaur
Some DinosaurOPโ€ข5h ago
ok so I guess i'd do this here - but how?
No description
Some Dinosaur
Some DinosaurOPโ€ข4h ago
This Build works like every 10th time I click it, and keeps spitting 500 error to my browser console without any other feedback on what's wrong
Luna Lovegood
Luna Lovegoodโ€ข4h ago
there is a link to document on that page what is message of 500 error?
Some Dinosaur
Some DinosaurOPโ€ข3h ago
It stopped with 500 - now it just keeps saying it cannot connect for logs and the thing keeps spinning and build never stops Running
No description

Did you find this page helpful?