Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error when executing git command. ssh_askpass: exec(/usr/bin/ssh-askpass): No such file or directory Host key verification failed. #174

Closed
uchar opened this issue Mar 27, 2023 · 4 comments

Comments

@uchar
Copy link

uchar commented Mar 27, 2023

Recently when I use your plugin with GameCi

name: Accessing private repos
runs-on: ubuntu-latest
steps:
  - uses: actions/checkout@v2
  - uses: webfactory/ssh-agent@v0.8.0
    with:
      ssh-private-key: ${{ secrets.SSH_PRIVATE_KEY }}
  - uses: game-ci/unity-builder@v2
    with:
      sshAgent: ${{ env.SSH_AUTH_SOCK }}

I get this error :

Error when executing git command. ssh_askpass: exec(/usr/bin/ssh-askpass): No such file or directory
    Host key verification failed.
    fatal: Could not read from remote repository.

    Please make sure you have the correct access rights
    and the repository exists.

I know GitHub recently changed its public key, but even after updating your action I'm still getting errors, How can I fix this?
related to game-ci/unity-builder#525

@uchar uchar changed the title Error when executing git command. ssh_askpass: exec(/usr/bin/ssh-askpass): No such file or directory Host key verification failed. fatal: Could not read from remote repository. Please make sure you have the correct access rights and the repository exists. Error when executing git command. ssh_askpass: exec(/usr/bin/ssh-askpass): No such file or directory Host key verification failed. Mar 27, 2023
@sebastiankugler
Copy link
Member

@uchar maybe the information in #171 (comment) helps?

@uchar
Copy link
Author

uchar commented Mar 27, 2023

@uchar maybe the information in #171 (comment) helps?

I'm a little lost here , since game-ci/unity-builder is a docker image, do they have to add it inside their docker image? I can't find a way to do it manually

@mpdude
Copy link
Member

mpdude commented Mar 27, 2023

I haven't used Docker-based build images so far, I don't know...

The only explanation would be when this action webfactory/ssh-agent is run inside the Docker container. Is that the case?

If it is run outside (on the runner), then the known_hosts entry should already be present.

@uchar
Copy link
Author

uchar commented Mar 28, 2023

@mpdude Yes I think it is running inside the docker
I fixed the problem by adding the GitHub to known hosts manually :

- name: "Add GitHub to the SSH known hosts file"
  run: |
    mkdir -p -m 0700 /home/runner/.ssh
    curl --silent https://api.github.com/meta  | jq --raw-output '"github.com "+.ssh_keys[]' >> /home/runner/.ssh/known_hosts
    chmod 600 /home/runner/.ssh/known_hosts

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants