Topic "Incremental failing after 1-2 days with "The server's host key was not found in the cache""

Author Message


Hi all,

Hitting into an issue that I have never encountered before, and is starting to drive me insane... We have a script that runs every hour to incrementally pull new files in a remote location to a local working folder. The fetch script itself is working perfectly.

However, when run by Windows Task Scheduler, the script runs for a day or two, and then starts failing with: "The server's host key was not found in the cache."

Unlike other threads I can find on this matter, here's the weird bit:
1) We are already specifying the hostkey in the open command.
2) The script runs clean 100% of the time, if run manually from the command line or by double-clicking in Windows.
3) After running manually, the script will run automatically for some random amount of time between 1-2 days, before starting to fail with this error again.

The host key that it reports is not changing (or incorrect), and matches what we've set into the script.

Our script's 'open' command is set as:
  open -hostkey="ssh-rsa 2048 xx:yy:xx:yy:xx:yy:xx:yy:xx:yy:xx:yy:xx:yy:xx:yy"

... and the error that starts arriving in the logfile is:
The server's host key was not found in the cache. You have no guarantee that the server is the computer you think it is.
The server's rsa2 key fingerprint is:
ssh-rsa 2048 xx:yy:xx:yy:xx:yy:xx:yy:xx:yy:xx:yy:xx:yy:xx:yy

And the reported key exactly matches the hostkey of our system, as well as the one manually specified.

This is running from Windows Server 2012 R2 Task Scheduler, and at this point we've even given the script the highest privileges, thinking that it was some kind of user profile issue, with the profile being reaped periodically. Have never had this issue before. Any thoughts would be appreciated!

Running WinSCP as v5.7.6 on Win2k12R2.
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 27059
Location: Prague, Czechia
Please attach a full log file both from successful and failing session (using the latest version of WinSCP).

To generate log file, use /log=path_to_log_file command-line argument. Submit the log with your post as an attachment. Note that passwords and passphrases not stored in the log. You may want to remove other data you consider sensitive though, such as host names, IP addresses, account names or file names (unless they are relevant to the problem). If you do not want to post the log publicly, you can mark the attachment as private.


We experience the same issue. Is there a way to ignore or skip these warnings?

You can post new topics in this forum


What is WinSCP?

It is award-winning SFTP client, SCP client, FTPS client and FTP client integrated into one software program for file transfer to FTP server or secure SFTP server. [More]

And it's free!


About donations

$9   $19   $49   $99

About donations


WinSCP Privacy Policy

WinSCP License