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
Forum Updated to NodeBB v4.3 + New Features

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 759 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 last edited by toralf
    #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
    • aha_1980A Offline
      aha_1980A Offline
      aha_1980
      Lifetime Qt Champion
      wrote on last edited by aha_1980
      #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 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
        • aha_1980A Offline
          aha_1980A Offline
          aha_1980
          Lifetime Qt Champion
          wrote on last edited by aha_1980
          #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 last edited by toralf
            #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
            1
            • T toralf

              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 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
              • aha_1980A aha_1980 has marked this topic as solved on

              • Login

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