ome/devspace

authenticity of host 'github.com can't be established

atarkowska opened this issue ยท 16 comments

When startin fresh new devspace there are no ./ssh/known_hosts. This cause push build failure

+ /home/omero/.local/bin/scc merge develop --no-ask --reset -S no-error --push develop/merge/trigger
2016-04-18 17:28:54,440 [   scc.merge] INFO  Merging Pull Request(s) based on develop
2016-04-18 17:28:54,440 [   scc.merge] INFO  Including Pull Request(s) opened by any public member of the organization
2016-04-18 17:28:54,440 [   scc.merge] INFO  Including Pull Request(s) labelled as include
2016-04-18 17:28:54,440 [   scc.merge] INFO  Excluding Pull Request(s) labelled as exclude or breaking
2016-04-18 17:28:54,440 [   scc.merge] INFO  Excluding Pull Request(s) with either error or failure status
2016-04-18 17:30:00,271 [   scc.merge] INFO  Repository: openmicroscopy/bioformats
2016-04-18 17:30:00,271 [   scc.merge] INFO  Excluded PRs:
...
2016-04-18 17:30:00,272 [   scc.merge] INFO  Merged PRs:
...
2016-04-18 17:30:00,273 [   scc.merge] INFO  
Traceback (most recent call last):
  File "/home/omero/.local/lib/python2.7/site-packages/scc/main.py", line 76, in entry_point
    (UpdateSubmodules.NAME, UpdateSubmodules),
  File "/home/omero/.local/lib/python2.7/site-packages/yaclifw/framework.py", line 197, in main
    ns.func(ns)
  File "/home/omero/.local/lib/python2.7/site-packages/scc/git.py", line 2912, in __call__
    self.push(args, self.main_repo)
  File "/home/omero/.local/lib/python2.7/site-packages/scc/git.py", line 1984, in push
    main_repo.rpush(branch_name, remote, force=True)
  File "/home/omero/.local/lib/python2.7/site-packages/scc/git.py", line 1833, in rpush
    self.push_branch(branch_name, remote=full_remote, force=force)
  File "/home/omero/.local/lib/python2.7/site-packages/scc/git.py", line 98, in wrapper
    return func(*args, **kwargs)
  File "/home/omero/.local/lib/python2.7/site-packages/scc/git.py", line 1147, in push_branch
    self.call("git", "push", "-f", remote, name)
  File "/home/omero/.local/lib/python2.7/site-packages/scc/git.py", line 1013, in call
    return self.wrap_call(self.debugWrap, *command, **kwargs)
  File "/home/omero/.local/lib/python2.7/site-packages/scc/git.py", line 1038, in wrap_call
    raise Exception("rc=%s" % rc)
Exception: rc=128
Build step 'Execute shell' marked build as failure
Finished: FAILURE

This is because:

The authenticity of host 'github.com (192.30.252.123)' can't be established.
RSA key fingerprint is 16:27:ac:a5:76:28:2d:36:63:1b:56:4d:eb:df:a6:48.
Are you sure you want to continue connecting (yes/no)? yes

to solve that problem:

$ docker exec -it develop_testice35_1 bash
[root@901eecee7574 linux]# su - omero
-bash-4.2$ cd workspace/BIOFORMATS-push/src/
-bash-4.2$ /home/omero/.local/bin/scc merge develop --no-ask --reset -S no-error --push develop/merge/trigger
...
The authenticity of host 'github.com (192.30.252.123)' can't be established.
RSA key fingerprint is 16:27:ac:a5:76:28:2d:36:63:1b:56:4d:eb:df:a6:48.
Are you sure you want to continue connecting (yes/no)? yes
2016-04-18 17:31:25,958 [   scc.merge] INFO  Merged branch pushed to https://github.com/snoopycrimecop/bioformats/tree/develop/merge/trigger
-bash-4.2$

From https://trello.com/c/z5LrlWMy/275-spaces-work:

ssh-keyscan github.com >> ~/.ssh/known_hosts

thank you that works ;-)

looks like too early enthusiasm. I started fresh devspace deployment and having the same problem now. Running manually

bash-4.1$ /home/slave/.local/bin/scc merge develop --no-ask --reset -S success-only --push develop/merge/trigger

doesn't ask me the above question but still failing

@joshmoore thank u, it work!

xeruf commented

@joshmoore how is this any safer than just answering the prompt with yes?
Either way, we are trusting that there is absolutely no corruption in our connection to github.com, what this security feature is made to address I thought?

Hi @Xerus2000. You're right that ssh-keyscan github.com >> ~/.ssh/known_hosts isn't safer at all. What this issue doesn't make clear though is that @aleksandra-tarkowska was looking for an automated way to start a fresh docker container which hasn't yet been primed with a known_hosts yet, i.e. there is no prompt that we can answer. This is a workaround at best.

Just a note - this error can happen if You forgot to add Your ssh key to the repo You are trying to communicate with :)

I've been having this problem, but it doesn't ask if I want to continue. It just hangs there. I ran the ssh-keyscan command and I see the entry in the known_hosts file, but I still get the authenticity error. Even restarted my computer to no avail.
I also tried the test: ssh -T git@github.com and got this output:

<name>@<machine> ios-sportsbook % ssh -T git@github.com
Warning: Permanently added the RSA host key for IP address '140.82.114.3' to the list of known hosts.
Hi <githubUser>! You've successfully authenticated, but GitHub does not provide shell access.

Tried my git clone, but still got the error: The authenticity of host 'github.com (140.82.114.3)' can't be established. And it never asks if I want to continue

Hi @Aaron-Penn-Interactive,

Hmm.... sounds like there's something else going on here. By my count, you've ok'd the authenticity at last twice but it's still not asking for confirmation which is weird. The only thing I can think of off-hand is if there are different users/machines/contexts by which known_hosts somehow changes.

I will note that GitHub itself has improved there docs around this in case there's anything there that might help you:

https://docs.github.com/en/free-pro-team@latest/github/authenticating-to-github/testing-your-ssh-connection

~Josh

Just typing "yes".

From https://trello.com/c/z5LrlWMy/275-spaces-work:

ssh-keyscan github.com >> ~/.ssh/known_hosts

Your amazing man , you made my day , thanks a lot

ssh-keyscan github.com >> ~/.ssh/known_hosts just leads to another error

npm WARN prepare removing existing node_modules/ before installation
npm ERR! Error while executing:
npm ERR! /usr/bin/git ls-remote -h -t ssh://git@github.com/kleros/dispute-resolver-interface-contract.git
npm ERR! 
npm ERR! Warning: Permanently added the ECDSA host key for IP address '140.82.121.4' to the list of known hosts.
npm ERR! git@github.com: Permission denied (publickey).
npm ERR! fatal: Could not read from remote repository.
npm ERR! 
npm ERR! Please make sure you have the correct access rights
npm ERR! and the repository exists.
npm ERR! 
npm ERR! exited with error code: 128

Just run ssh git@github.com instead

Hi @mpalenov. Sounds like there's more involved in your case. For example, the ssh-keyscan github.com >> ~/.ssh/known_hosts should have prevented npm ERR! Warning: Permanently added the ECDSA host key for IP address '140.82.121.4' to the list of known hosts. Perhaps it was run as a separate user or in a separate context? Also the error npm ERR! git@github.com: Permission denied (publickey). most likely comes from a missing SSH key somewhere. But if you are in an interactive shell, you're right: "Just run ssh git@github.com instead" ๐Ÿ‘

From https://trello.com/c/z5LrlWMy/275-spaces-work:

ssh-keyscan github.com >> ~/.ssh/known_hosts

Thank you so much for this.
I've been haunted by the error for quite some time.

it works thanks bro

Thank you!