Use ssh to clone repos does not work
See original GitHub issueContext
If I don’t specify git user and git pass in the config, it should automatically use SSH.
Problem
- It is not clear which ssh key is used
- When running the following commands during startup in trains-agent machine:
eval "$(ssh-agent -s)"
ssh-add /home/h4dr1en/.ssh/id_rsa
I can see in the logs that it was well added (at startup user is root)
May 11 10:01:00 GCEMetadataScripts[711]: 2020/05/11 10:01:00 GCEMetadataScripts: startup-script: Agent pid 1373
May 11 10:01:00 GCEMetadataScripts[711]: 2020/05/11 10:01:00 GCEMetadataScripts: startup-script: Identity added: /home/h4dr1en/.ssh/id_rsa (/home/h4dr1en/.ssh/id_rsa)
If I connect to the trains-agent, I can also test the connection to github:
$ ssh -T git@github.com
Warning: Permanently added the RSA host key for IP address '140.82.118.3' to the list of known hosts.
Hi H4dr1en! You've successfully authenticated, but GitHub does not provide shell access.
But for some reason trains-agent does not succeed to clone the repo of the experiment (from the logs):
cloning: https://github.com/h4dr1en/training-repo
fatal: could not read Username for 'https://github.com': terminal prompts disabled
Repository cloning failed: Command '['clone', 'https://github.com/h4dr1en/training-repo', '/root/.trains/vcs-cache/training-repo.pytorch.65c96545aef218c67580e8307b6d0267/training-repo', '--quiet', '--recursive']' returned non-zero exit status 128
trains_agent: ERROR: Failed cloning repository.
1) Make sure you pushed the requested commit:
(branch='master', tag='', repository='https://github.com/h4dr1en/training-repo', commit_id='', entry_point='src/cli.py', working_dir='.')
2) Check if remote-worker has valid credentials [see worker configuration file]
It looks like trains-agent still tries to clone using HTTP and fails because I did not specify creds in trains.conf file
Note: I could solve the problem by adding (from here):
git config --global --add url."git@github.com:".insteadOf "https://github.com/"
at startup, but I think this should be handled by trains-agent, right?
EDIT:
git config --system --add url."git@github.com:".insteadOf "https://github.com/"
Issue Analytics
- State:
- Created 3 years ago
- Comments:9 (7 by maintainers)
Top Results From Across the Web
ssh clone not working with github - Stack Overflow
I created a new repository and tried to clone on my local machine. It worked for https and git-readonly URLs. That is, the...
Read more >Git clone fails when cloning via SSH - Atlassian Documentation
Problem. Git clones fail when using ssh even if an Access key has been added to the repository or an SSH key has...
Read more >How to Fix SSH “Permission Denied” with Git Clone - Medium
Solution 1: Use HTTPS. This is the most effortless solution at hand. Simply switch to cloning from the HTTPS path for your Git...
Read more >Use ssh to clone repos does not work · Issue #16 - GitHub
So I can only use ssh for cloning the repo from the company git repository. However, that requires a combination of adding public...
Read more >How to set up SSH and Clone Repository using SSH in Git?
Open Git Bash and navigate to the directory in which you want to clone the repository. Check the contents of the repository through...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
@212792736 I believe the issue your are facing is not related to the original issue I described. Could you please open a separate issue or get help on the trains Slack channel? I will close this issue because as of trains version 0.16 the original issue has been fixed 👍
This is not blocking, I did on my machine and I can still pull any public repository.