sync metadata fails due to ssh host key

Bug #1803453 reported by Haw Loeung
14
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Ubuntu Repository Cache Charm
Fix Released
High
Haw Loeung

Bug Description

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'?

Related branches

Revision history for this message
Haw Loeung (hloeung) wrote :

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
-rw-r--r-- 1 root root 222 Nov 14 23:13 /root/.ssh/known_hosts

Haw Loeung (hloeung)
Changed in ubuntu-repository-cache:
importance: Undecided → High
status: New → In Progress
assignee: nobody → Haw Loeung (hloeung)
Haw Loeung (hloeung)
Changed in ubuntu-repository-cache:
status: In Progress → Fix Committed
Haw Loeung (hloeung)
Changed in ubuntu-repository-cache:
status: Fix Committed → Fix Released
Revision history for this message
Haw Loeung (hloeung) wrote :

Still an issue, see LP:1915765

Changed in ubuntu-repository-cache:
status: Fix Released → Triaged
status: Triaged → In Progress
Haw Loeung (hloeung)
Changed in ubuntu-repository-cache:
status: In Progress → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.