Juju scp reports "Host key verification failed. lost connection" when transferring files between machines, although is happy to connect to them individually

I’m having difficulty troubleshooting an error I’m receiving from the juju scp command when transferring files between machines on the same model.

$ juju scp 0:hello.txt 1:hello-txt
ERROR exit status 1 (Host key verification failed.
lost connection)

Using the --proxy option to proxy traffic via the controller doesn’t seem to help:

$ juju scp --proxy 0:hello.txt 1:hello-txt
ERROR exit status 1 (Host key verification failed.
lost connection)

I am able to conduct the transfer by injecting options directly to scp:

$ juju scp -- -3 0:hello.txt 1:hello-txt
$ echo $?
0

Any advice for diagnosing the underlying issue(s)?

Hey @timClicks, I am having a similar issue with the Windows client, version 2.8.1. When I try to bootstrap a new controller, the process fails with Host Key verification failure until the bootstrap operation times out. While it is retrying the connection, I am able to connect to the controller machine manually.

I think this might be a bug. I think my problem lies somewhere around here, but I doubt your process is running into this code. I have a feeling this might be some sort of regression issue. Would be nice if a DEV could chime in.

I reverted to running the “jujubox” container for now which is running the Ubuntu client, version 2.7.6. That worked without issue. I created another topic to understand why the stable PPA is only up to 2.7.6. That is what the"jujubox" container is tied to.