"uvt-kvm wait" fails when the VM is created with --ssh-public-key-file

Bug #1287140 reported by Jean-Baptiste Lallement on 2014-03-03
12
This bug affects 1 person
Affects Status Importance Assigned to Milestone
uvtool
High
Robie Basak
uvtool (Ubuntu)
Medium
Unassigned

Bug Description

uvt-kvm failed while running auto-upgrade-tester from https://code.launchpad.net/~serge-hallyn/auto-upgrade-testing/uvtool/+merge/207350

TEST CASE:
1. $ bzr branch lp:~serge-hallyn/auto-upgrade-testing/uvtool
2. $ cd uvtool
3. Copy the profile ubuntu-precise-trusty-server-amd64/ from http://bazaar.launchpad.net/~auto-upgrade-testing-dev/auto-upgrade-testing/trunk/files/head:/share/profiles/trusty/ubuntu-precise-trusty-server-amd64/ to share/profiles
3. Run:
$ python3 bin/auto-upgrade-tester ubuntu-precise-trusty-server-amd64

ProblemType: Crash
DistroRelease: Ubuntu 14.04
Package: uvtool-libvirt 0~bzr87-0ubuntu1
ProcVersionSignature: Ubuntu 3.13.0-14.34-generic 3.13.5
Uname: Linux 3.13.0-14-generic x86_64
ApportVersion: 2.13.2-0ubuntu5
Architecture: amd64
CrashCounter: 1
CurrentDesktop: Unity
Date: Mon Mar 3 12:32:51 2014
ExecutablePath: /usr/bin/uvt-kvm
InstallationDate: Installed on 2013-09-03 (180 days ago)
InstallationMedia: Ubuntu 13.10 "Saucy Salamander" - Alpha amd64 (20130902)
InterpreterPath: /usr/bin/python2.7
PackageArchitecture: all
ProcCmdline: /usr/bin/python /usr/bin/uvt-kvm wait --insecure auto-upgrade-tester
PythonArgs: ['/usr/bin/uvt-kvm', 'wait', '--insecure', 'auto-upgrade-tester']
SourcePackage: uvtool
Title: uvt-kvm crashed with CalledProcessError in check_call(): Command '[u'ssh', u'-o', u'UserKnownHostsFile=/dev/null', u'-o', u'StrictHostKeyChecking=no', u'-o', u'CheckHostIP=no', u'-l', u'ubuntu', '192.168.122.250', u'env', u'UVTOOL_WAIT_INTERVAL=8.0', u'UVTOOL_WAIT_TIMEOUT=120.0', u'sh', u'-']' returned non-zero exit status 255
UpgradeStatus: No upgrade log present (probably fresh install)
UserGroups: adm autopilot cdrom dip libvirtd lpadmin plugdev sambashare sudo

Jean-Baptiste Lallement (jibel) wrote :
information type: Private → Public
affects: uvtool (Ubuntu) → uvtool
summary: - uvt-kvm crashed with CalledProcessError in check_call(): Command
- '[u'ssh', u'-o', u'UserKnownHostsFile=/dev/null', u'-o',
- u'StrictHostKeyChecking=no', u'-o', u'CheckHostIP=no', u'-l', u'ubuntu',
- '192.168.122.250', u'env', u'UVTOOL_WAIT_INTERVAL=8.0',
- u'UVTOOL_WAIT_TIMEOUT=120.0', u'sh', u'-']' returned non-zero exit
- status 255
+ uvt-kvm crashed with CalledProcessError in check_call()
description: updated

Thanks for reporting this.

I had some difficulty reproducing. To fix, I had to add "--data-dir=share", run with "sudo", and apply the following patch (since base had no trailing slash, the concatenation fails to account for a directory separator). Is this patch a bug that needs fixing in auto-upgrade-tester?

--- bin/auto-upgrade-tester 2014-01-10 09:06:58 +0000
+++ bin/auto-upgrade-tester 2014-03-06 10:02:13 +0000
@@ -370,7 +370,7 @@
             print("Using generated profile: %s" % profile)

         if not "/" in profile:
- profile = base + profile
+ profile = os.path.join(base, profile)
         try:
             if options.login:
                 backend = createBackend(options.backend, profile)

When I did reproduce, I saw "Permission denied (publickey)." printed before the traceback. The wait subcommand now uses ssh to check that cloud-init has finished running inside the VM and that the VM is in runlevel 2. So this requires ssh to work, and thus fails when --ssh-public-key-file is used. This is clearly a bug, but I think the only way to fix this is to add options to the wait subcommand so users using --ssh-public-key-file can also supply a new --ssh-private-key-file for wait, or perhaps a --no-ssh option to disable this aspect of wait's functionality. This would also need standard ssh parameters like "-l" to work in the same way as the ssh subcommand, since authentication details may be different.

Finally, uvt-kvm should have printed a straightforward error message instead of a traceback.

I need to add new options to the wait subcommand, and then we'll need to update Serge's MP to use --ssh-private-key-file (or whatever I end up adding).

Changed in uvtool:
status: New → Triaged
importance: Undecided → High
assignee: nobody → Robie Basak (racb)
summary: - uvt-kvm crashed with CalledProcessError in check_call()
+ "uvt-kvm wait" fails when the VM is created with --ssh-public-key-file
Robie Basak (racb) wrote :

Trivial steps to reproduce:

cd /tmp
ssh-keygen -f ./id_rsa
...
uvt-kvm create --ssh-public-key-file=id_rsa.pub ...
uvt-kvm wait --insecure ...

Robie Basak (racb) wrote :

Fixed in rev 92, by adding --without-ssh and --ssh-private-key-file to the wait subcommand.

Serge, you'll need to call with one of these two in your branch. Probably --ssh-private-key-file with a file to match the --ssh-public-key-file you used.

Changed in uvtool:
status: Triaged → Fix Committed
Changed in uvtool (Ubuntu):
status: New → Triaged
tags: removed: need-duplicate-check
Changed in uvtool (Ubuntu):
importance: Undecided → Medium
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package uvtool - 0~bzr92-0ubuntu1

---------------
uvtool (0~bzr92-0ubuntu1) trusty; urgency=low

  * New upstream snapshot (bugfixes only):
    - Fix manpage to reflect correct "create" default.
    - Correctly handle wait with custom ssh keys (LP: #1287140).
 -- Robie Basak <email address hidden> Tue, 01 Apr 2014 13:07:55 +0100

Changed in uvtool (Ubuntu):
status: Triaged → Fix Released
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers