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 1086554 - Error info is not clear when network install vm with url "ftp://"
Summary: Error info is not clear when network install vm with url "ftp://"
Keywords:
Status: CLOSED UPSTREAM
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: virt-manager
Version: 7.0
Hardware: x86_64
OS: Linux
medium
medium
Target Milestone: rc
: ---
Assignee: Giuseppe Scrivano
QA Contact: Virtualization Bugs
URL:
Whiteboard:
Depends On:
Blocks: 1086561
TreeView+ depends on / blocked
 
Reported: 2014-04-11 06:23 UTC by zhengqin
Modified: 2014-04-15 04:56 UTC (History)
6 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
: 1086561 (view as bug list)
Environment:
Last Closed: 2014-04-14 13:21:50 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

Description zhengqin 2014-04-11 06:23:41 UTC
Description of problem:
For Network Install VM, If you just input install url with "ftp://", the error message shows: "Unable to complete install: NoneType object has no attribute 'sendall'"

Version-Release number of selected component:
virt-manager-0.10.0-20.el7.noarch

How reproducible:
100%

Steps to Reproduce:
1. Start virt-manager.

2. Create a new vm by "Network Install" until "step 2 of 5" on New VM window, just input a install URL with "ftp://"

3. Forward the New VM window util "Step 5 of 5" window, and click "Finish" button



Actual result:
1. Error message shows: "Unable to complete install: NoneType object has no attribute 'sendall'", and this error is not clear.


Expected results:
1. An error will be shown if you input install url with "http://", "Unable to complete install: Invalid install location: Opening URL http:// failed"


Additional info:
1. This issue does not occur with install url "http://" or "nfs:"
2. If set a wrong ftp url eg:ftp://test, the error info is also unclear:Unable to complete install: '[Errno -2] Name or service not known'
3. This issue also occurs on latest rhel6u5.

Comment 1 Giuseppe Scrivano 2014-04-14 13:14:21 UTC
both the cryptic error message and the exception come from the python ftplib.FTP class, where the exception message is not clear.  Reproducer:

>>> ftp = FTP('foo')
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/lib64/python2.7/ftplib.py", line 117, in __init__
    self.connect(host)
  File "/usr/lib64/python2.7/ftplib.py", line 132, in connect
    self.sock = socket.create_connection((self.host, self.port), self.timeout)
  File "/usr/lib64/python2.7/socket.py", line 553, in create_connection
    for res in getaddrinfo(host, port, 0, SOCK_STREAM):
socket.gaierror: [Errno -2] Name or service not known


>>> ftp = FTP('')
>>> ftp.login()
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/lib64/python2.7/ftplib.py", line 387, in login
    resp = self.sendcmd('USER ' + user)
  File "/usr/lib64/python2.7/ftplib.py", line 243, in sendcmd
    self.putcmd(cmd)
  File "/usr/lib64/python2.7/ftplib.py", line 178, in putcmd
    self.putline(line)
  File "/usr/lib64/python2.7/ftplib.py", line 173, in putline
    self.sock.sendall(line)
AttributeError: 'NoneType' object has no attribute 'sendall'


patch proposed upstream:

https://www.redhat.com/archives/virt-tools-list/2014-April/msg00079.html

Comment 2 Giuseppe Scrivano 2014-04-15 04:56:05 UTC
fixed by:

commit 1d312a520e92e89da1b4d958b9de0270eecc6b4b
Author: Giuseppe Scrivano <gscrivan>
Date:   Mon Apr 14 14:49:21 2014 +0200

    virtinst: early detect ftp connection errors
    
    It fixes two problems:
    
    i) "ftp://" was accepted as valid URL but then it causes this
    exception:
    
    Traceback (most recent call last):
      File "<stdin>", line 1, in <module>
      File "/usr/lib64/python2.7/ftplib.py", line 387, in login
        resp = self.sendcmd('USER ' + user)
      File "/usr/lib64/python2.7/ftplib.py", line 243, in sendcmd
        self.putcmd(cmd)
      File "/usr/lib64/python2.7/ftplib.py", line 178, in putcmd
        self.putline(line)
      File "/usr/lib64/python2.7/ftplib.py", line 173, in putline
        self.sock.sendall(line)
    AttributeError: 'NoneType' object has no attribute 'sendall'
    
    ii) only a cryptic error message "Unable to complete install: '[Errno
    -2] Name or service not known'" was showed to users when the DNS
    lookup failed.  The exception is now intercepted and decorated with
    more information.
    
    Closes: https://bugzilla.redhat.com/show_bug.cgi?id=1086554
    
    Signed-off-by: Giuseppe Scrivano <gscrivan>


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