Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Qt Creator and other tools
  4. Qt Creator: "Host key verification failed" for remote git operations that work from the command line

Qt Creator: "Host key verification failed" for remote git operations that work from the command line

Scheduled Pinned Locked Moved Solved Qt Creator and other tools
6 Posts 2 Posters 725 Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • T Offline
    T Offline
    toralf
    wrote on 8 Oct 2024, 13:32 last edited by toralf 10 Aug 2024, 14:04
    #1

    I have this weird issue with one of my Git repositories: Attempts to push to or pull from the remote through Qt Creator, fail with a message like:

    ssh_askpass: exec(win-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.
    The command "C:\Program Files\Git\cmd\git.exe push" terminated with exit code 128.

    If I enter "git push" or "git pull" in a terminal window, I don't get this however; the commands just work, and I'm not asked for a password - which is the way I expect it because I've set up for authentication using tokens.

    I have other repos cloned from the same server, and I don't get the same problem there.

    This is with the Windows version of Qt Creator (as you may have gathered from the error messages.) Currently using version 14.0.2, but I also had this with past releases.

    Any ideas what may be going on?

    1 Reply Last reply
    0
    • A Offline
      A Offline
      aha_1980
      Lifetime Qt Champion
      wrote on 9 Oct 2024, 06:15 last edited by aha_1980 10 Sept 2024, 06:16
      #2

      @toralf

      Do you by chance have multiple git and/or ssh binaries? Your description just sounds like as if Creator uses a git with a different SSH configuration.

      What happens if you open git bash (In Creator: Tools > Git > Git Tools > Git Bash) and repeat the pull/push from there?

      Qt has to stay free or it will die.

      1 Reply Last reply
      1
      • T Offline
        T Offline
        toralf
        wrote on 9 Oct 2024, 07:00 last edited by
        #3

        From Git bash, the git operations work...

        Yes, it turns out that I have two ssh binaries.

        $ where ssh
        C:\Program Files\Git\usr\bin\ssh.exe
        C:\Windows\System32\OpenSSH\ssh.exe
        

        But if Qt Creator uses the wrong ssh, why does everything work with all my other repos?

        1 Reply Last reply
        0
        • A Offline
          A Offline
          aha_1980
          Lifetime Qt Champion
          wrote on 9 Oct 2024, 07:29 last edited by aha_1980 10 Sept 2024, 07:31
          #4

          @toralf Probably some setting within the repo? Environment variables? That's what I could think of.

          Edit: Most likely the PATH variable is different, so the other SSH exe is picked up?

          Qt has to stay free or it will die.

          1 Reply Last reply
          0
          • T Offline
            T Offline
            toralf
            wrote on 9 Oct 2024, 12:59 last edited by toralf 10 Oct 2024, 06:47
            #5

            I believe I have found it: What actually happens, is that for some reason, a different home directory is assumed when git is executed from Qt Creator. That triggers a host key verification error because the location in question doesn't have an .ssh/known_hosts file with a key for the git host, and unlike when the command is started from a shell, the information isn't downloaded automatically.

            SSH config does exist on the location in question, though, as it was used as home in the past. That's how git operations work for other repos; it turns out that there is a subtle difference in their .git/config, in that another alias is listed for the remote host, and the name in question appears in the "alternative" known_hosts.

            T 1 Reply Last reply 9 Oct 2024, 13:43
            1
            • T toralf
              9 Oct 2024, 12:59

              I believe I have found it: What actually happens, is that for some reason, a different home directory is assumed when git is executed from Qt Creator. That triggers a host key verification error because the location in question doesn't have an .ssh/known_hosts file with a key for the git host, and unlike when the command is started from a shell, the information isn't downloaded automatically.

              SSH config does exist on the location in question, though, as it was used as home in the past. That's how git operations work for other repos; it turns out that there is a subtle difference in their .git/config, in that another alias is listed for the remote host, and the name in question appears in the "alternative" known_hosts.

              T Offline
              T Offline
              toralf
              wrote on 9 Oct 2024, 13:43 last edited by
              #6

              The problem is the Set "HOME" option here: Screenshot 2024-10-09 153342.png (from Version Control in Preferences dialog.)

              The tooltip for this option suggests that it will set HOME to the location I want, but it seems like it doesn't really. Instead it changes HOME from the desired location to something else. If I uncheck, everything works a lot better.

              Perhaps part of the issue is that I didn't update everything fully when I tried to change my home directory earlier. Not sure what to do, there, really...

              1 Reply Last reply
              1
              • A aha_1980 has marked this topic as solved on 9 Oct 2024, 13:51

              3/6

              9 Oct 2024, 07:00

              • Login

              • Login or register to search.
              3 out of 6
              • First post
                3/6
                Last post
              0
              • Categories
              • Recent
              • Tags
              • Popular
              • Users
              • Groups
              • Search
              • Get Qt Extensions
              • Unsolved