2018-11-14 23:05:19 INFO juju-log cluster:2: Cleaning metadata directory
2018-11-14 23:05:20 DEBUG cluster-relation-joined Host key verification failed.
2018-11-14 23:05:20 DEBUG cluster-relation-joined Traceback (most recent call last):
2018-11-14 23:05:20 DEBUG cluster-relation-joined File "/var/lib/juju/agents/unit-ubuntu-repository-cache-7/charm/hooks/cluster-relation-joined", line 265, in <module>
2018-11-14 23:05:20 DEBUG cluster-relation-joined HOOKS.execute(sys.argv)
2018-11-14 23:05:20 DEBUG cluster-relation-joined File "/var/lib/juju/agents/unit-ubuntu-repository-cache-7/charm/lib/charmhelpers/core/hookenv.py", line 715, in execute
2018-11-14 23:05:20 DEBUG cluster-relation-joined self._hooks[hook_name]()
2018-11-14 23:05:20 DEBUG cluster-relation-joined File "/var/lib/juju/agents/unit-ubuntu-repository-cache-7/charm/hooks/cluster-relation-joined", line 185, in cluster_relation_joined
2018-11-14 23:05:20 DEBUG cluster-relation-joined mirror.peer_update_metadata()
2018-11-14 23:05:20 DEBUG cluster-relation-joined File "/var/lib/juju/agents/unit-ubuntu-repository-cache-7/charm/lib/ubuntu_repository_cache/mirror.py", line 312, in peer_update_metadata
2018-11-14 23:05:20 DEBUG cluster-relation-joined _nonleader_update_metadata()
2018-11-14 23:05:20 DEBUG cluster-relation-joined File "/var/lib/juju/agents/unit-ubuntu-repository-cache-7/charm/lib/ubuntu_repository_cache/mirror.py", line 265, in _nonleader_update_metadata
2018-11-14 23:05:20 DEBUG cluster-relation-joined if util.remote_path_exists('www-sync', leader_ip, canary):
2018-11-14 23:05:20 DEBUG cluster-relation-joined File "/var/lib/juju/agents/unit-ubuntu-repository-cache-7/charm/lib/ubuntu_repository_cache/util.py", line 246, in remote_path_exists
2018-11-14 23:05:20 DEBUG cluster-relation-joined subprocess.check_call(cmd)
2018-11-14 23:05:20 DEBUG cluster-relation-joined File "/usr/lib/python3.5/subprocess.py", line 581, in check_call
2018-11-14 23:05:20 DEBUG cluster-relation-joined raise CalledProcessError(retcode, cmd)
2018-11-14 23:05:20 DEBUG cluster-relation-joined subprocess.CalledProcessError: Command '('sudo', '-u', 'www-sync', 'ssh', 'www-sync@10.240.0.42', 'stat /srv/ubuntu-repository-cache/apache/data/ubuntu_2018-11-14_22:40:01_u2_good')' returned non-zero exit status 255
2018-11-14 23:05:20 ERROR juju.worker.uniter.operation runhook.go:129 hook "cluster-relation-joined" failed: exit status 1
Perhaps SSH should run with '-o StrictHostKeyChecking=no'?
Also, sudo should be run with '-i'.
The current workaround is as root:
sudo -u www-sync ssh www-sync@ 10.240. 0.42
which then creates:
root@juju- d5655c- 16:~# ls -la /root/. ssh/known_ hosts ssh/known_ hosts
-rw-r--r-- 1 root root 222 Nov 14 23:13 /root/.