The rsync fails in error when the -o option is used

Bug #1284309 reported by Matt Bruzek
14
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Juju Charm Tools
New
Undecided
Unassigned

Bug Description

While testing a Vagrant setup I wanted to view the output in a log directory.

We used the -o option on charm test like this:
sudo -u vagrant -H charm test -e local -o vagrant-log -v $test

The actual Amulet tests passed but when the tool went to get the logs rsync encountered a verification problem and the tests "failed" with this error:
juju-test.conductor.10-deploy-test.py WARNING : Failed to fetch logs for bootstrap node
Host key verification failed.
rsync: connection unexpectedly closed (0 bytes received so far) [Receiver]
rsync error: error in rsync protocol data stream (code 12) at io.c(226) [Receiver=3.1.0]
juju-test.conductor.10-deploy-test.py WARNING : Failed to grab logs for lamp/0
Host key verification failed.
rsync: connection unexpectedly closed (0 bytes received so far) [Receiver]

rsync error: error in rsync protocol data stream (code 12) at io.c(226) [Receiver=3.1.0]

juju-test.conductor.10-deploy-test.py WARNING : Failed to grab logs for relation-sentry/0
juju-test INFO : Results: 0 passed, 1 failed, 0 errored

Included is the full stdout of what happened. Notice that the ssh keys are being generated and there is a warning that the keys are already generated:

vagrant provision
[default] Running provisioner: shell...
[default] Running: /tmp/vagrant-shell20140224-490-1yf9lm0
stdin: is not a tty
Installing juju-local provider support
Ign http://us.archive.ubuntu.com trusty InRelease
Ign http://security.ubuntu.com trusty-security InRelease
Hit http://security.ubuntu.com trusty-security Release.gpg
Ign http://us.archive.ubuntu.com trusty-updates InRelease
Hit http://security.ubuntu.com trusty-security Release
Ign http://us.archive.ubuntu.com trusty-backports InRelease
Hit http://security.ubuntu.com trusty-security/main Sources
Ign http://ppa.launchpad.net trusty InRelease
Hit http://us.archive.ubuntu.com trusty-updates Release.gpg
Hit http://security.ubuntu.com trusty-security/restricted Sources
Hit http://us.archive.ubuntu.com trusty-backports Release.gpg
Hit http://security.ubuntu.com trusty-security/universe Sources
Hit http://ppa.launchpad.net trusty Release.gpg
Get:2 http://us.archive.ubuntu.com trusty Release [58.5 kB]
Hit http://security.ubuntu.com trusty-security/multiverse Sources
Hit http://security.ubuntu.com trusty-security/main i386 Packages
Hit http://security.ubuntu.com trusty-security/restricted i386 Packages
Hit http://ppa.launchpad.net trusty Release
Hit http://security.ubuntu.com trusty-security/universe i386 Packages
Hit http://us.archive.ubuntu.com trusty-updates Release
Hit http://security.ubuntu.com trusty-security/multiverse i386 Packages
Hit http://us.archive.ubuntu.com trusty-backports Release
Hit http://ppa.launchpad.net trusty/main i386 Packages
Get:3 http://us.archive.ubuntu.com trusty/main Sources [1,062 kB]
Hit http://security.ubuntu.com trusty-security/main Translation-en
Hit http://security.ubuntu.com trusty-security/multiverse Translation-en
Hit http://security.ubuntu.com trusty-security/restricted Translation-en
Hit http://security.ubuntu.com trusty-security/universe Translation-en
Get:4 http://us.archive.ubuntu.com trusty/restricted Sources [5,380 B]
Get:5 http://us.archive.ubuntu.com trusty/universe Sources [6,402 kB]
Ign http://ppa.launchpad.net trusty/main Translation-en_US
Ign http://security.ubuntu.com trusty-security/main Translation-en_US
Ign http://security.ubuntu.com trusty-security/multiverse Translation-en_US
Ign http://security.ubuntu.com trusty-security/restricted Translation-en_US
Ign http://ppa.launchpad.net trusty/main Translation-en
Ign http://security.ubuntu.com trusty-security/universe Translation-en_US
Get:6 http://us.archive.ubuntu.com trusty/multiverse Sources [176 kB]
Get:7 http://us.archive.ubuntu.com trusty/main i386 Packages [1,345 kB]
Get:8 http://us.archive.ubuntu.com trusty/restricted i386 Packages [12.1 kB]
Get:9 http://us.archive.ubuntu.com trusty/universe i386 Packages [5,881 kB]
Get:10 http://us.archive.ubuntu.com trusty/multiverse i386 Packages [134 kB]
Hit http://us.archive.ubuntu.com trusty/main Translation-en
Hit http://us.archive.ubuntu.com trusty/multiverse Translation-en
Hit http://us.archive.ubuntu.com trusty/restricted Translation-en
Hit http://us.archive.ubuntu.com trusty/universe Translation-en
Hit http://us.archive.ubuntu.com trusty-updates/main Sources
Hit http://us.archive.ubuntu.com trusty-updates/restricted Sources
Hit http://us.archive.ubuntu.com trusty-updates/universe Sources
Hit http://us.archive.ubuntu.com trusty-updates/multiverse Sources
Hit http://us.archive.ubuntu.com trusty-updates/main i386 Packages
Hit http://us.archive.ubuntu.com trusty-updates/restricted i386 Packages
Hit http://us.archive.ubuntu.com trusty-updates/universe i386 Packages
Hit http://us.archive.ubuntu.com trusty-updates/multiverse i386 Packages
Hit http://us.archive.ubuntu.com trusty-updates/main Translation-en
Hit http://us.archive.ubuntu.com trusty-updates/multiverse Translation-en
Hit http://us.archive.ubuntu.com trusty-updates/restricted Translation-en
Hit http://us.archive.ubuntu.com trusty-updates/universe Translation-en
Hit http://us.archive.ubuntu.com trusty-backports/main Sources
Hit http://us.archive.ubuntu.com trusty-backports/restricted Sources
Hit http://us.archive.ubuntu.com trusty-backports/universe Sources
Hit http://us.archive.ubuntu.com trusty-backports/multiverse Sources
Hit http://us.archive.ubuntu.com trusty-backports/main i386 Packages
Hit http://us.archive.ubuntu.com trusty-backports/restricted i386 Packages
Hit http://us.archive.ubuntu.com trusty-backports/universe i386 Packages
Hit http://us.archive.ubuntu.com trusty-backports/multiverse i386 Packages
Hit http://us.archive.ubuntu.com trusty-backports/main Translation-en
Hit http://us.archive.ubuntu.com trusty-backports/multiverse Translation-en
Hit http://us.archive.ubuntu.com trusty-backports/restricted Translation-en
Hit http://us.archive.ubuntu.com trusty-backports/universe Translation-en
Ign http://us.archive.ubuntu.com trusty/main Translation-en_US
Ign http://us.archive.ubuntu.com trusty/multiverse Translation-en_US
Ign http://us.archive.ubuntu.com trusty/restricted Translation-en_US
Ign http://us.archive.ubuntu.com trusty/universe Translation-en_US
Ign http://us.archive.ubuntu.com trusty-updates/main Translation-en_US
Ign http://us.archive.ubuntu.com trusty-updates/multiverse Translation-en_US
Ign http://us.archive.ubuntu.com trusty-updates/restricted Translation-en_US
Ign http://us.archive.ubuntu.com trusty-updates/universe Translation-en_US
Ign http://us.archive.ubuntu.com trusty-backports/main Translation-en_US
Ign http://us.archive.ubuntu.com trusty-backports/multiverse Translation-en_US
Ign http://us.archive.ubuntu.com trusty-backports/restricted Translation-en_US
Ign http://us.archive.ubuntu.com trusty-backports/universe Translation-en_US
Fetched 15.1 MB in 15s (950 kB/s)
Reading package lists...

Reading package lists...

Building dependency tree...

Reading state information...

juju-local is already the newest version.
0 upgraded, 0 newly installed, 0 to remove and 58 not upgraded.
Generating public/private rsa key pair.
id_rsa already exists.
Overwrite (y/n)?
Running test-pre-setup script
+ dpkg -s amulet
Package: amulet
Status: install ok installed
Priority: optional
Section: python
Installed-Size: 117
Maintainer: Marco Ceppi <email address hidden>
Architecture: all
Version: 1.2.1-0ubuntu1~ubuntu14.04.1~ppa1
Provides: python3-amulet
Depends: python3, python3-yaml, python3-urllib3, python3-requests, python3-charmworldlib, python3:any (>= 3.3.2-2~), bzr, juju-deployer
Description: Testing harness for Juju Charms
+ '[' 0 -ne 0 ']'
+ sudo apt-get install -y python3-requests
Reading package lists...

Building dependency tree...

Reading state information...

python3-requests is already the newest version.
0 upgraded, 0 newly installed, 0 to remove and 58 not upgraded.
running tests
juju-test INFO : Starting test run on local using Juju 1.17.3
Logging to /home/vagrant/.juju/local/log/cloud-init-output.log on remote host
Starting MongoDB server (juju-db-vagrant-local)
Bootstrapping Juju machine agent
Starting Juju machine agent (juju-agent-vagrant-local)
2014-02-24 15:26:53 Starting deployment of local
2014-02-24 15:27:10 Deploying services...
2014-02-24 15:27:10 Deploying service lamp using local:precise/lamp
2014-02-24 15:27:11 Deploying service lamp-sentry using local:precise/lamp-sentry
2014-02-24 15:27:12 Deploying service mysql using local:precise/mysql
2014-02-24 15:27:12 Deploying service mysql-sentry using local:precise/mysql-sentry
2014-02-24 15:27:13 Deploying service relation-sentry using local:precise/relation-sentry
2014-02-24 15:27:20 Config specifies num units for subordinate: lamp-sentry
2014-02-24 15:27:20 Config specifies num units for subordinate: mysql-sentry
2014-02-24 15:29:14 Adding relations...
2014-02-24 15:29:14 Adding relation mysql:juju-info <-> mysql-sentry:juju-info
2014-02-24 15:29:14 Adding relation lamp:juju-info <-> lamp-sentry:juju-info
2014-02-24 15:29:14 Adding relation relation-sentry:requires-lamp_shared-db-mysql_shared-db <-> lamp:shared-db
2014-02-24 15:29:14 Adding relation relation-sentry:provides-lamp_shared-db-mysql_shared-db <-> mysql:shared-db
2014-02-24 15:30:14 Exposing service 'lamp'
2014-02-24 15:30:14 Exposing service 'lamp-sentry'
2014-02-24 15:30:14 Exposing service 'mysql-sentry'
2014-02-24 15:30:14 Exposing service 'relation-sentry'
2014-02-24 15:30:14 Deployment complete in 201.24 seconds
juju-test.conductor.10-deploy-test.py RESULT : ✔
juju-test.conductor.10-deploy-test.py WARNING : Failed to fetch logs for bootstrap node
Host key verification failed.
rsync: connection unexpectedly closed (0 bytes received so far) [Receiver]
rsync error: error in rsync protocol data stream (code 12) at io.c(226) [Receiver=3.1.0]
juju-test.conductor.10-deploy-test.py WARNING : Failed to grab logs for lamp/0
Host key verification failed.
rsync: connection unexpectedly closed (0 bytes received so far) [Receiver]

rsync error: error in rsync protocol data stream (code 12) at io.c(226) [Receiver=3.1.0]

juju-test.conductor.10-deploy-test.py WARNING : Failed to grab logs for relation-sentry/0
juju-test INFO : Results: 0 passed, 1 failed, 0 errored

Matt Bruzek (mbruzek)
description: updated
Revision history for this message
Federico Gimenez (fgimenez) wrote :

Hi, on a fresh trusty install I'm getting a 'Permission denied (publickey).' instead of 'Host key verification failed':

    $ juju test -v -o ./log
    ...
    juju-test.conductor.01-deploy.py WARNING : Failed to fetch logs for bootstrap node
    juju-test.conductor DEBUG : Running the following: juju status -e local
    The authenticity of host '10.0.3.60 (10.0.3.60)' can't be established.
    ECDSA key fingerprint is 9c:f3:ed:cc:30:c5:fa:77:62:43:79:4c:60:fe:85:8b.
    Are you sure you want to continue connecting (yes/no)? yes
    Warning: Permanently added '10.0.3.60' (ECDSA) to the list of known hosts.
    Permission denied (publickey).
    rsync: connection unexpectedly closed (0 bytes received so far) [Receiver]
    rsync error: unexplained error (code 255) at io.c(226) [Receiver=3.1.0]

Juju 1.18.3, Amulet 1.5.0

Revision history for this message
Charles Butler (lazypower) wrote :

I'm wondering if Federico's issue isn't stemming from rsync not being told to use the identity key in ~/.juju/ssh/juju_id_rsa*

That would stand to reason why it's denied for public key auth.. I haven't verified this thought however.

Revision history for this message
Federico Gimenez (fgimenez) wrote :

Hi Charles, I can reproduce this with any failing amulet test, actual fail, not because of the rsync error. May it be related specifically to the amulet library?

Thanks, cheers

To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers