Win32: The server's host key is not cached in the registry

Asked by Rolly

Hello all,

Windows XP user here. Using PuTTy (and plink.exe) version 0.60. I was running an older version of Bzr (1.3 I believe), and all was well. I upgraded to 1.5 (Python 2.5 installer). Now all bzr+ssh operations fail with the following error:

Using last location: bzr+ssh://<email address hidden>/lighty/
The server's host key is not cached in the registry. You
have no guarantee that the server is the computer you
think it is.
The server's rsa2 key fingerprint is:
ssh-rsa 2048 01:e2:36:2b:17:7f:82:29:59:92:bd:e2:1d:15:28:24
Connection abandoned.
bzr: ERROR: Connection closed: please check connectivity and permissions (and try -Dhpss if further diagnosis is required)

Before I upgraded, managing host keys was as simple as adding a line to C:\Documents and Settings\user\Application Data\bazaar\2.0\ssh_host_keys. But this new version of bzr isn't even accessing ssh_host_keys (checked with FileMon.) And I have no idea where "the registry" is located. I have verified that C:\Documents and Settings\user\Application Data\bazaar\2.0\ssh_host_keys is updated and has the correct information.

Here's the traceback, in case it helps:

0.351 encoding stdout as sys.stdout encoding 'cp437'
0.361 bzr arguments: [u'missing', u'-v']
0.361 looking for plugins in C:/Documents and Settings/user/Application Data/bazaar/2.0/plugins
0.361 looking for plugins in C:\bin\Python25\lib\site-packages\bzrlib\plugins
0.361 Plugin name __init__ already loaded
0.361 Plugin name __init__ already loaded
0.871 encoding stdout as sys.stdout encoding 'cp437'
1.352 ssh implementation is Putty's plink.
2.484 Traceback (most recent call last):
  File "C:\bin\Python25\Lib\site-packages\bzrlib\commands.py", line 846, in run_bzr_catch_errors
    return run_bzr(argv)
  File "C:\bin\Python25\Lib\site-packages\bzrlib\commands.py", line 797, in run_bzr
    ret = run(*run_argv)
  File "C:\bin\Python25\Lib\site-packages\bzrlib\commands.py", line 499, in run_argv_aliases
    return self.run(**all_cmd_args)
  File "C:\bin\Python25\Lib\site-packages\bzrlib\commands.py", line 807, in ignore_pipe
    result = func(*args, **kwargs)
  File "C:\bin\Python25\Lib\site-packages\bzrlib\builtins.py", line 3322, in run
    remote_branch = Branch.open(other_branch)
  File "C:\bin\Python25\Lib\site-packages\bzrlib\branch.py", line 107, in open
    possible_transports=possible_transports)
  File "C:\bin\Python25\Lib\site-packages\bzrlib\bzrdir.py", line 667, in open
    return BzrDir.open_from_transport(t, _unsupported=_unsupported)
  File "C:\bin\Python25\Lib\site-packages\bzrlib\bzrdir.py", line 704, in open_from_transport
    redirected)
  File "C:\bin\Python25\Lib\site-packages\bzrlib\transport\__init__.py", line 1616, in do_catching_redirections
    return action(transport)
  File "C:\bin\Python25\Lib\site-packages\bzrlib\bzrdir.py", line 681, in find_format
    transport, _server_formats=_server_formats)
  File "C:\bin\Python25\Lib\site-packages\bzrlib\bzrdir.py", line 1440, in find_format
    return format.probe_transport(transport)
  File "C:\bin\Python25\Lib\site-packages\bzrlib\bzrdir.py", line 2398, in probe_transport
    server_version = medium.protocol_version()
  File "C:\bin\Python25\Lib\site-packages\bzrlib\smart\medium.py", line 421, in protocol_version
    self._protocol_version = client_protocol.query_version()
  File "C:\bin\Python25\Lib\site-packages\bzrlib\smart\protocol.py", line 621, in query_version
    resp = self.read_response_tuple()
  File "C:\bin\Python25\Lib\site-packages\bzrlib\smart\protocol.py", line 544, in read_response_tuple
    result = self._recv_tuple()
  File "C:\bin\Python25\Lib\site-packages\bzrlib\smart\protocol.py", line 602, in _recv_tuple
    return _decode_tuple(self._recv_line())
  File "C:\bin\Python25\Lib\site-packages\bzrlib\smart\protocol.py", line 614, in _recv_line
    "(and try -Dhpss if further diagnosis is required)")
ConnectionReset: Connection closed: please check connectivity and permissions (and try -Dhpss if further diagnosis is required)

2.484 return code 3

Anyone know what I'm doing wrong? Thanks!

Question information

Language:
English Edit question
Status:
Answered
For:
Bazaar Edit question
Assignee:
No assignee Edit question
Last query:
Last reply:
Revision history for this message
Rolly (hachirota) said :
#1

I figured out the issue: The "The server's host key is not cached in the registry" error is a plink.exe error. Plink.exe must be run previously, so as to add the key to PuTTy's cache:

> plink -v <email address hidden> ls
Looking up host "example.com"
Connecting to 10.10.10.10 port 22
Server version: SSH-2.0-OpenSSH_4.2p1 Debian-7ubuntu3.3
We claim version: SSH-2.0-PuTTY_Release_0.60
Using SSH protocol version 2
Doing Diffie-Hellman group exchange
Doing Diffie-Hellman key exchange with hash SHA-1
The server's host key is not cached in the registry. You
have no guarantee that the server is the computer you
think it is.
The server's rsa2 key fingerprint is:
ssh-rsa 2048 06:e2:36:2b:17:7f:88:29:59:92:bd:e4:1d:15:28:24
If you trust this host, enter "y" to add the key to
PuTTY's cache and carry on connecting.
If you want to carry on connecting just once, without
adding the key to the cache, enter "n".
If you do not trust this host, press Return to abandon the
connection.
Store key in cache? (y/n) y

Revision history for this message
Martin Pool (mbp) said :
#2

I'm glad you worked it out, I'll turn this into a faq.

Revision history for this message
Martin Pool (mbp) said :
#3

a
FAQ #568: “Win32: The server's host key is not cached in the registry”.

Can you help with this problem?

Provide an answer of your own, or ask Rolly for more information if necessary.

To post a message you must log in.