Cannot add device: device key expected before created

Bug #1227820 reported by Kyle Nitzsche
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
qtcreator-plugin-ubuntu
Fix Released
Critical
Juhapekka Piiroinen
qtcreator-plugin-ubuntu (Ubuntu)
Fix Released
Critical
Zoltan Balogh

Bug Description

In the Ubuntu SDK, I cannot add a device (unless I had successfully added one previously somehow).

Reason: the openssh_version script expects the ssh key for the device to exist before it actually does.

That script is delivered by qtcreator-plugin-ubuntu; I have version 2.8.1-0ubuntu1~saucy1~test4

When you add a device with: Devices, then Detect in the SDK, this script is called:
/usr/share/qtcreator/ubuntu/scripts/openssh_version

BEFORE this script script is called:
/usr/share/qtcreator/ubuntu/scripts/openssh_publickey

The second script creates the key if it does not exist.

But openssh_version assumes the device key is in place with this code:
 ssh-add ~/.ssh/ubuntudevice*id_rsa &> /dev/null

If there is no such key, the Devices Detect sequence hangs on openssh_version stage (with no helpful data in the Log panel).

A simple workaround (although perhaps not the right one given other factors), is to test for the key and generate it in openssh_version like this:

if [ ! -f ~/.ssh/ubuntudevice*id_rsa ]; then
  ssh-keygen -t rsa -N '' -f $SSHIDENTITY -b 768
fi
ssh-add ~/.ssh/ubuntudevice*id_rsa &> /dev/null

description: updated
Revision history for this message
Pat McGowan (pat-mcgowan) wrote :

This seems to be working using 2.7.2bzr31saucy0

Note that 2.8 is not production yet.

Detecting device..
01acb3051a9f6b24 device usb:2-1.2 product:occam model:Nexus_4 device:mako
* found 1 devices.
Check device image version..
..device version detected.
Check if the device is connected to a network..
1
Detecting if openssh-server is installed..
1:6.2p2-6
..openssh-server (1:6.2p2-6) is installed.
Enabling port forward..
..ports forwarded.
Setting up public key authentication..
Checking for keys..
Host key is:
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAAAYQDWO5C5lPp06Sa3p5+J5Jx5Z0QxLp2JN0A/EP+pR6r+Visyp/i2ifYwfq/HUMiZ7JFPfrZ635WAyvQ6PiNpdAVmG2xuQK5Rjsr0jVMsM4uoQ5B/TTzNBpSkvFJ6z4hGIUk= pat@pat-samsung

We have following keys on the device:

*no keys*

Deploy the host key to the device..
..key folder created
..key deployed!
..public key authentication is now set.

Zoltan Balogh (bzoltan)
Changed in qtcreator-plugin-ubuntu:
assignee: nobody → Juhapekka Piiroinen (juhapekka-piiroinen)
Revision history for this message
Kyle Nitzsche (knitzsche) wrote :

I have just tested using 2-7 packages from saucy (no ppas) and and when the SSH key [1] does not already exist, one cannot add a device. Manually copy the key into place, and the device may be added. I think this is critical for 2.7 saucy.

package: qtctrator-plugin-ubuntu 2.7.2-0ubuntu4

[1] ~/.ssh/ubuntudevice_015d21d9370bf818_id_rsa

Changed in qtcreator-plugin-ubuntu:
status: New → Confirmed
Changed in qtcreator-plugin-ubuntu:
importance: Undecided → Critical
Revision history for this message
Pat McGowan (pat-mcgowan) wrote :

confirmed per last comment

Changed in qtcreator-plugin-ubuntu (Ubuntu):
importance: Undecided → Critical
status: New → Confirmed
assignee: nobody → Juhapekka Piiroinen (juhapekka-piiroinen)
Changed in qtcreator-plugin-ubuntu:
status: Confirmed → Fix Committed
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package qtcreator-plugin-ubuntu - 2.7.2-0ubuntu5

---------------
qtcreator-plugin-ubuntu (2.7.2-0ubuntu5) saucy; urgency=low

  * Cannot add device: device key expected before created (LP: #1227820)
 -- Juhapekka Piiroinen <email address hidden> Fri, 20 Sep 2013 11:04:13 +0300

Changed in qtcreator-plugin-ubuntu (Ubuntu):
status: Confirmed → Fix Released
Changed in qtcreator-plugin-ubuntu:
status: Fix Committed → Fix Released
Revision history for this message
Pat McGowan (pat-mcgowan) wrote :

I cannot detect the device at all in qtcreator-plugin-ubuntu - 2.7.2-0ubuntu5
The output just hangs at openssh_version

Changed in qtcreator-plugin-ubuntu (Ubuntu):
assignee: Juhapekka Piiroinen (juhapekka-piiroinen) → Zoltan Balogh (bzoltan)
status: Fix Released → New
Revision history for this message
Pat McGowan (pat-mcgowan) wrote :

The fix in the branch attached to the bug is not in the script installed with 2.7.2-0ubuntu5 on my system.
I manually modified the file and it works.

Revision history for this message
Pat McGowan (pat-mcgowan) wrote :

Mystery solved I must have had a version of qtcreator-plugin-ubuntu-common fromt he PPA without the fix but blocking the update.

The fix is in fact present.

Changed in qtcreator-plugin-ubuntu (Ubuntu):
status: New → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

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