Bug 1296347

Summary: Error when attaching glusterfs image: unsupported operand type(s) for +=: 'NoneType' and 'str'
Product: [Community] Virtualization Tools Reporter: Slava <volga629>
Component: virt-managerAssignee: Cole Robinson <crobinso>
Status: CLOSED DEFERRED QA Contact:
Severity: urgent Docs Contact:
Priority: unspecified    
Version: unspecifiedCC: berrange, crobinso, gscrivan, rbalakri, volga629, zsirmo
Target Milestone: ---   
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2016-06-09 11:04:03 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
virt-manager debug
none
debugging patch
none
virt-manager 1.2.1 debug log none

Description Slava 2016-01-06 23:45:00 UTC
Hello Everyone,
Getting error when adding glusterfs image disk.

Uncaught error validating install parameters: unsupported operand type(s) for +=: 'NoneType' and 'str'

Traceback (most recent call last):
  File "/usr/share/virt-manager/virtManager/create.py", line 1685, in _validate
    return self._validate_install_page()
  File "/usr/share/virt-manager/virtManager/create.py", line 1864, in _validate_install_page
    if not self._validate_storage_page():
  File "/usr/share/virt-manager/virtManager/create.py", line 1971, in _validate_storage_page
    if disk and self._addstorage.validate_disk_object(disk) is False:
  File "/usr/share/virt-manager/virtManager/addstorage.py", line 297, in validate_disk_object
    names = disk.is_conflict_disk()
  File "/usr/share/virt-manager/virtinst/devicedisk.py", line 918, in is_conflict_disk
    read_only=self.read_only)
  File "/usr/share/virt-manager/virtinst/devicedisk.py", line 350, in path_in_use_by
    if disk.path in vols and vm.name not in ret:
  File "/usr/share/virt-manager/virtinst/devicedisk.py", line 487, in _get_path
    self._set_default_storage_backend()
  File "/usr/share/virt-manager/virtinst/devicedisk.py", line 760, in _set_default_storage_backend
    path = self._build_url_from_network_source()
  File "/usr/share/virt-manager/virtinst/devicedisk.py", line 635, in _build_url_from_network_source
    ret += "://"
TypeError: unsupported operand type(s) for +=: 'NoneType' and 'str'

Reproduce.

1. create new vm
2. select use existing image.
3. in open dialog try select image from glusterfs pool.
4. click "Save" error will show up.

Same error if just add image disk to existing vm.

Comment 1 Cole Robinson 2016-01-06 23:47:36 UTC
Please provide full virt-manager --debug output when reproducing

Comment 2 Slava 2016-01-07 01:02:34 UTC
Created attachment 1112309 [details]
virt-manager debug

Comment 3 Cole Robinson 2016-01-07 16:08:36 UTC
Seems the offending volume XML is:

<volume type="network">
  <name>cawebsrv01_1.qcow2</name>
  <key>gluster://my_server/datapoint02/cawebsrv01_1.qcow2</key>
  <source>
  </source>
  <capacity unit="bytes">42949672960</capacity>
  <allocation unit="bytes">39882784768</allocation>
  <target>
    <path>gluster://my_server/datapoint02/cawebsrv01_1.qcow2</path>
    <format type="qcow2"/>
    <permissions>
      <mode>0755</mode>
      <owner>107</owner>
      <group>107</group>
    </permissions>
    <timestamps>
      <atime>1452099373.212940894</atime>
      <mtime>1448523521.816306775</mtime>
      <ctime>1452099347.935292229</ctime>
    </timestamps>
    <compat>1.1</compat>
    <features/>
  </target>
</volume>

Comment 4 Slava 2016-04-02 16:54:13 UTC
Hello Cole,
Same error is preventing to add flat disk in directory. I consider this as blocker. It make Virtual Manager not operational at all.


ncaught error validating hardware input: unsupported operand type(s) for +=: 'NoneType' and 'str'

Traceback (most recent call last):
  File "/usr/share/virt-manager/virtManager/addhardware.py", line 1373, in _finish
    if self._validate() is False:
  File "/usr/share/virt-manager/virtManager/addhardware.py", line 1404, in _validate
    ret = self._validate_page_storage()
  File "/usr/share/virt-manager/virtManager/addhardware.py", line 1525, in _validate_page_storage
    if self.addstorage.validate_disk_object(disk) is False:
  File "/usr/share/virt-manager/virtManager/addstorage.py", line 297, in validate_disk_object
    names = disk.is_conflict_disk()
  File "/usr/share/virt-manager/virtinst/devicedisk.py", line 918, in is_conflict_disk
    read_only=self.read_only)
  File "/usr/share/virt-manager/virtinst/devicedisk.py", line 350, in path_in_use_by
    if disk.path in vols and vm.name not in ret:
  File "/usr/share/virt-manager/virtinst/devicedisk.py", line 487, in _get_path
    self._set_default_storage_backend()
  File "/usr/share/virt-manager/virtinst/devicedisk.py", line 760, in _set_default_storage_backend
    path = self._build_url_from_network_source()
  File "/usr/share/virt-manager/virtinst/devicedisk.py", line 635, in _build_url_from_network_source
    ret += "://"
TypeError: unsupported operand type(s) for +=: 'NoneType' and 'str'

Comment 5 Cole Robinson 2016-04-08 19:58:37 UTC
Created attachment 1145241 [details]
debugging patch

Sorry this is causing such an issue. I can't really tell what the root problem is and I can't reproduce. Can you do the following bits to get more debug info?

download the attachment to $HOME
git clone git://github.com/virt-manager/virt-manager
cd virt-manager
git am ~/0001-gluster-debug-patch.patch
./virt-manager --debug

Reproduce the issue like that, then provide the full --debug output

Comment 6 Cole Robinson 2016-05-02 14:23:37 UTC
(In reply to Cole Robinson from comment #5)
> Created attachment 1145241 [details]
> debugging patch
> 
> Sorry this is causing such an issue. I can't really tell what the root
> problem is and I can't reproduce. Can you do the following bits to get more
> debug info?
> 
> download the attachment to $HOME
> git clone git://github.com/virt-manager/virt-manager
> cd virt-manager
> git am ~/0001-gluster-debug-patch.patch
> ./virt-manager --debug
> 
> Reproduce the issue like that, then provide the full --debug output



Hi slava, please provide this debugging info so I can understand what's going wrong

Comment 7 Cole Robinson 2016-06-09 11:04:03 UTC
Since no response for a while, closing. Please reopen if you can still reproduce, and provide the info requested in Comment 5

Comment 8 Attila Zsiros 2016-07-07 08:00:31 UTC
I have same problem, patched version log attached.
The patch first line not match!(In reply to Cole Robinson from comment #5)
> Created attachment 1145241 [details]
> debugging patch
> 
> Sorry this is causing such an issue. I can't really tell what the root
> problem is and I can't reproduce. Can you do the following bits to get more
> debug info?
> 
> download the attachment to $HOME
> git clone git://github.com/virt-manager/virt-manager
> cd virt-manager
> git am ~/0001-gluster-debug-patch.patch
> ./virt-manager --debug
> 
> Reproduce the issue like that, then provide the full --debug output

Comment 9 Attila Zsiros 2016-07-07 08:01:48 UTC
Created attachment 1177210 [details]
virt-manager 1.2.1 debug log

virt-manager --version
1.2.1
uname -a
Linux kmooc1.oe-mgmt 3.10.0-327.18.2.el7.x86_64 #1 SMP Thu May 12 11:03:55 UTC 2016 x86_64 x86_64 x86_64 GNU/Linux
cat /etc/redhat-release 
CentOS Linux release 7.2.1511 (Core)

Comment 10 Cole Robinson 2016-07-07 13:55:50 UTC
Can you reproduce with virt-manager 1.4.0 ? It is the latest version