RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 1167916 - P2V: invalid conversion server prints unexpected end of file waiting for password prompt.
Summary: P2V: invalid conversion server prints unexpected end of file waiting for pass...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: libguestfs
Version: 7.2
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: rc
: ---
Assignee: John Eckersberg
QA Contact: Virtualization Bugs
URL:
Whiteboard: P2V
Depends On:
Blocks: TRACKER-virt-p2v 1288337
TreeView+ depends on / blocked
 
Reported: 2014-11-25 15:59 UTC by Richard W.M. Jones
Modified: 2016-11-03 17:47 UTC (History)
8 users (show)

Fixed In Version: libguestfs-1.32.5-4.el7
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2016-11-03 17:47:43 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Bugzilla 1227599 0 medium CLOSED P2V invalid password prints unexpected end of file waiting for command prompt. 2021-02-22 00:41:40 UTC
Red Hat Product Errata RHSA-2016:2576 0 normal SHIPPED_LIVE Moderate: libguestfs and virt-p2v security, bug fix, and enhancement update 2016-11-03 12:06:51 UTC

Internal Links: 1227599

Description Richard W.M. Jones 2014-11-25 15:59:54 UTC
Description of problem:

In https://bugzilla.redhat.com/show_bug.cgi?id=1165564#c4
tzheng commented:

Tested the new iso,when I launch to virt-p2v boot GUI and input the Conversion server and password,error shows:
P2V error:unexpected end of file waiting for password prompt.

We didn't work out why that happened.

Version-Release number of selected component (if applicable):

virt-v2v 1.28.1 (el7)

How reproducible:

Unknown.

Additional info:

See my additional comments:
https://bugzilla.redhat.com/show_bug.cgi?id=1165564#c5
https://bugzilla.redhat.com/show_bug.cgi?id=1165564#c6

The bug "fixed itself" somehow, but I don't believe it.

Comment 2 Richard W.M. Jones 2014-11-25 16:32:54 UTC
Background:

I believe Tingting was referring to a failure in the
libguestfs.git/p2v/ssh.c function 'test_connection', which
opens an ssh connection to a host which is supposed to have
virt-v2v installed.  Somehow she triggered the error
"unexpected end of file waiting for password prompt" in
ssh.c:start_ssh.

You can exercise this path by pushing the "Test connection"
button the first dialog.

Comment 3 tingting zheng 2014-12-18 09:29:08 UTC
(In reply to Richard W.M. Jones from comment #2)
> Background:
> 
> I believe Tingting was referring to a failure in the
> libguestfs.git/p2v/ssh.c function 'test_connection', which
> opens an ssh connection to a host which is supposed to have
> virt-v2v installed.  Somehow she triggered the error
> "unexpected end of file waiting for password prompt" in
> ssh.c:start_ssh.
> 
> You can exercise this path by pushing the "Test connection"
> button the first dialog.

I found that if the remote virt-v2v server can not be connected from virt-p2v client,such error info will show.

Comment 4 John Eckersberg 2014-12-18 16:35:04 UTC
(In reply to tingting zheng from comment #3)
> (In reply to Richard W.M. Jones from comment #2)
> > Background:
> > 
> > I believe Tingting was referring to a failure in the
> > libguestfs.git/p2v/ssh.c function 'test_connection', which
> > opens an ssh connection to a host which is supposed to have
> > virt-v2v installed.  Somehow she triggered the error
> > "unexpected end of file waiting for password prompt" in
> > ssh.c:start_ssh.
> > 
> > You can exercise this path by pushing the "Test connection"
> > button the first dialog.
> 
> I found that if the remote virt-v2v server can not be connected from
> virt-p2v client,such error info will show.

Confirmed I can reproduce by giving it a bogus v2v server.  It would be preferable to expose the actual error message that ssh reports, but it's not obvious to me how to achieve that with miniexpect.  Here's the output from miniexpect if I turn on DEBUG:

DEBUG: poll returned 1
DEBUG: read returned 63
DEBUG: read 63 bytes from pty
DEBUG: buffer content: ssh: connect to host 192.168.123.45 port 22: No route to host

DEBUG: poll returned 1
DEBUG: read returned -1

miniexpect clears the buffer in the handle before returning back to the user if none of the regular expressions match, so we end up losing the "real" error.

Comment 5 Richard W.M. Jones 2014-12-18 16:47:34 UTC
So the problem is likely to be in start_ssh(), probably in the
first call to mexp_expect.

I think the problem is the obvious solution -- adding a second catch-all
regexp -- won't work, for reasons explained here:

http://git.annexia.org/?p=miniexpect.git;a=blob;f=miniexpect.pod;h=b4f0edc3ec82772100934c4c1c3cc2bbb27924cf;hb=HEAD#l260

What would be nice would be to extend miniexpect so that some
kind of callback can be used by clients to collect up all of
the output from the command being run.  ie. That every time
miniexpect calls read (h->fd, ...) there is an opportunity to
pass that to a user-defined callback function.

Or perhaps it should be possible to override the read() function.

Either approach will allow virt-p2v to suck up all the output from
ssh and print it out in the case of an error.  (Probably virt-p2v
should stop doing that once the password has been sent)

Comment 7 Chengappa 2015-10-08 10:59:08 UTC
We need one simple deployment of converting a given server with some OS converted to a Virtual Machine.

i.e.
-> take a simple Linux/fedora machine and install apache or any web server for testing or any application for that matter – the purpose here is to see if this application works after the conversion to a virtual machine

-> Convert P2V using the tools.

-> Start virtual machine and see if works.

We have our conversion server in place, but we would like to know how could we initiate virt-p2v GUI from my physical server, we have difficulties understanding this -> When you start virt-p2v, you'll see a graphical configuration dialog that walks you through connection to the conversion server, asks for the password, which local hard disks you want to convert, and other things like the name of the guest to create and the number of virtual CPUs to give it.

How do we start virt-p2v on a fedora 21

Further, we see this:
[root@localhost ~]# yum install virt-p2v
Loaded plugins: langpacks
updates/21/x86_64/metalink                                                                                                                                                    |  14 kB  00:00:00
updates                                                                                                                                                                       | 4.7 kB  00:00:00
No package virt-p2v available.
Error: Nothing to do
[root@localhost ~]# virt-p2v --help
bash: virt-p2v: command not found...

Could you please help us with the steps in getting up the GUI

Sorry if this is very basic and if it seems to be a stupid question, apologize upfront... Awaiting for response patiently....

Comment 8 Chengappa 2015-10-08 11:02:38 UTC
We need one simple deployment of converting a given server with some OS converted to a Virtual Machine.

i.e.
-> take a simple Linux/fedora machine and install apache or any web server for testing or any application for that matter – the purpose here is to see if this application works after the conversion to a virtual machine

-> Convert P2V using the tools.

-> Start virtual machine and see if works.

We have our conversion server in place, but we would like to know how could we initiate virt-p2v GUI from my physical server, we have difficulties understanding this -> When you start virt-p2v, you'll see a graphical configuration dialog that walks you through connection to the conversion server, asks for the password, which local hard disks you want to convert, and other things like the name of the guest to create and the number of virtual CPUs to give it.

How do we start virt-p2v on a fedora 21

Further, we see this:
[root@localhost ~]# yum install virt-p2v
Loaded plugins: langpacks
updates/21/x86_64/metalink                                                                                                                                                    |  14 kB  00:00:00
updates                                                                                                                                                                       | 4.7 kB  00:00:00
No package virt-p2v available.
Error: Nothing to do
[root@localhost ~]# virt-p2v --help
bash: virt-p2v: command not found...

Could you please help us with the steps in getting up the GUI

Sorry if this is very basic and if it seems to be a stupid question, apologize upfront as we are taking a stab @ it for the first time... Awaiting for response patiently....

Comment 9 Richard W.M. Jones 2015-10-08 11:27:45 UTC
Posting comments on random bugs won't help.  Please send your
request to the libguestfs mailing list: libguestfs

Comment 11 Richard W.M. Jones 2016-06-16 20:25:40 UTC
Upstream fix 8717a110120f84973f1148adf48e59222cf45e73

Comment 14 mxie@redhat.com 2016-06-22 10:38:56 UTC
Sorry, pls ignore comment 13's verify result, correct the verify result as below:

I can reproduce the bug with build:
virt-p2v-livecd-1.28.1-1.49.1.el7.iso

Reproduce steps:
1. Boot the machine into p2v client via iso file
2. At the inputting conversion info interface,input correct conversion server info but change ssh port from 22 to 21, then click test connection, the error shows: unexpected end of file waiting for password prompt


Try to verify the bug with build:
virt-p2v-1.28.1-1.51.3.el7

Verify result:
After inputting correct conversion server info and changing ssh port from 22 to 21, then click test connection, the error shows: ssh:connect to host 10.66.4.137 port21:No route to host, the error info shows correct

According to verify result, the bug has been fixed

So move the bug from ON_QA to VERIFIED

Comment 16 errata-xmlrpc 2016-11-03 17:47:43 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://rhn.redhat.com/errata/RHSA-2016-2576.html


Note You need to log in before you can comment on or make changes to this bug.