Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Python Error on virt-inst with Ubuntu 20.04 #171

Closed
REHICode opened this issue Oct 19, 2020 · 9 comments
Closed

Python Error on virt-inst with Ubuntu 20.04 #171

REHICode opened this issue Oct 19, 2020 · 9 comments

Comments

@REHICode
Copy link

REHICode commented Oct 19, 2020

DISTRIB_DESCRIPTION="Ubuntu 20.04.1 LTS"
virtinst                             1:2.2.1-3ubuntu2
python3                              3.8.2-0ubuntu2
python-is-python3                    3.8.2-4
python3-distutils                    3.8.2-1ubuntu1
python3-libvirt                      6.1.0-1
libvirt-daemon-system                6.0.0-0ubuntu8.4
qemu-kvm                             1:4.2-3ubuntu6.6

root@machine20:~# which python
/usr/bin/python 
root@machine20:~# ls -l /usr/bin/python
lrwxrwxrwx 1 root root 7 Apr 15 12:45 /usr/bin/python -> python3



root@machine20:~# /usr/bin/virt-install --name mvmubu18 --vcpus 2 --memory 4096 --network network=virbrapp,trustGuestRxFilters=yes,model=virtio --mac ae:20:18:10:08:0a --noautoconsole --wait -1 --location http://install/installer-ubuntu1804-amd64/ --disk path=/srv/images/18.04/ubu18_root.img,size=20,format=raw '--extra-args=locale=en_US auto=true priority=critical s390-netdevice/choose_networktype=virtio netcfg/use_autoconfig=true netcfg/disable_dhcp=false network-console/start=true url=http://install/preseeds/mustervm-bionic.seed'
ERROR    '>=' not supported between instances of 'NoneType' and 'str'

This command is working perfectly on all my Ubuntu 18.04.4 LTS Hosts.

It seems that the error message is caused by the --location http://... parameter. If I use --boot cdrom,hd for example, the command works as expected.

Thank you

@crobinso
Copy link
Member

Thanks for the report. Please provide full virt-install --debug ... output when reproducing

@REHICode
Copy link
Author

root@machine20:~# /usr/bin/virt-install --name mvmubu18 --vcpus 2 --memory 4096 --network network=virbrapp,trustGuestRxFilters=yes,model=virtio --mac ae:20:18:10:08:0a --noautoconsole --wait -1 --location http://install/installer-ubuntu1804-amd64/ --disk path=/srv/images/18.04/ubu18_root.img,size=20,format=raw '--extra-args=locale=en_US auto=true priority=critical s390-netdevice/choose_networktype=virtio netcfg/use_autoconfig=true netcfg/disable_dhcp=false network-console/start=true url=http://install/preseeds/mustervm-bionic.seed' --debug
[Mon, 19 Oct 2020 13:55:55 virt-install 3429488] DEBUG (cli:208) Launched with command line: /usr/share/virt-manager/virt-install --name mvmubu18 --vcpus 2 --memory 4096 --network network=virbrapp,trustGuestRxFilters=yes,model=virtio --mac ae:20:18:10:08:0a --noautoconsole --wait -1 --location http://install/installer-ubuntu1804-amd64/ --disk path=/srv/images/18.04/ubu18_root.img,size=20,format=raw --extra-args=locale=en_US auto=true priority=critical s390-netdevice/choose_networktype=virtio netcfg/use_autoconfig=true netcfg/disable_dhcp=false network-console/start=true url=http://install/preseeds/mustervm-bionic.seed --debug
[Mon, 19 Oct 2020 13:55:55 virt-install 3429488] DEBUG (virt-install:207) Distilled --network options: ['network=virbrapp,trustGuestRxFilters=yes,model=virtio,mac=ae:20:18:10:08:0a']
[Mon, 19 Oct 2020 13:55:55 virt-install 3429488] DEBUG (virt-install:139) Distilled --disk options: ['path=/srv/images/18.04/ubu18_root.img,size=20,format=raw']
[Mon, 19 Oct 2020 13:55:55 virt-install 3429488] DEBUG (cli:224) Requesting libvirt URI default
[Mon, 19 Oct 2020 13:55:55 virt-install 3429488] DEBUG (cli:227) Received libvirt URI qemu:///system
[Mon, 19 Oct 2020 13:55:55 virt-install 3429488] DEBUG (guest:463) Setting Guest osinfo name <_OsVariant name=generic>
[Mon, 19 Oct 2020 13:55:55 virt-install 3429488] DEBUG (urlfetcher:104) Using scratchdir=/var/lib/libvirt/boot
[Mon, 19 Oct 2020 13:55:55 virt-install 3429488] DEBUG (urldetect:280) Finding distro store for location=http://install/installer-ubuntu1804-amd64/
[Mon, 19 Oct 2020 13:55:56 virt-install 3429488] DEBUG (osdict:259) Error creating libosinfo tree object for location=http://install/installer-ubuntu1804-amd64/ : osinfo-tree-error: Failed to load .treeinfo|treeinfo file: Not Found (0)
[Mon, 19 Oct 2020 13:55:56 virt-install 3429488] DEBUG (urldetect:42) Failed to acquire file=.treeinfo
[Mon, 19 Oct 2020 13:55:56 virt-install 3429488] DEBUG (urldetect:42) Failed to acquire file=treeinfo
[Mon, 19 Oct 2020 13:55:56 virt-install 3429488] DEBUG (urldetect:42) Failed to acquire file=content
[Mon, 19 Oct 2020 13:55:56 virt-install 3429488] DEBUG (urlfetcher:139) Fetching URI: http://install/installer-ubuntu1804-amd64/current/images/MANIFEST
[Mon, 19 Oct 2020 13:55:56 virt-install 3429488] DEBUG (urldetect:42) Failed to acquire file=current/legacy-images/MANIFEST
[Mon, 19 Oct 2020 13:55:56 virt-install 3429488] DEBUG (urldetect:42) Failed to acquire file=daily/MANIFEST
[Mon, 19 Oct 2020 13:55:56 virt-install 3429488] DEBUG (urldetect:42) Failed to acquire file=.disk/info
[Mon, 19 Oct 2020 13:55:56 virt-install 3429488] DEBUG (cli:263)   File "/usr/share/virt-manager/virt-install", line 1012, in <module>
    fail(main_e)
  File "/usr/share/virt-manager/virtinst/cli.py", line 263, in fail
    log.debug("".join(traceback.format_stack()))

[Mon, 19 Oct 2020 13:55:56 virt-install 3429488] ERROR (cli:264) '>=' not supported between instances of 'NoneType' and 'str'
[Mon, 19 Oct 2020 13:55:56 virt-install 3429488] DEBUG (cli:266) 
Traceback (most recent call last):
  File "/usr/share/virt-manager/virt-install", line 1005, in <module>
    sys.exit(main())
  File "/usr/share/virt-manager/virt-install", line 993, in main
    guest, installer = build_guest_instance(conn, options)
  File "/usr/share/virt-manager/virt-install", line 557, in build_guest_instance
    installer_detect_distro(guest, installer, osdata)
  File "/usr/share/virt-manager/virt-install", line 525, in installer_detect_distro
    autodistro = installer.detect_distro(guest)
  File "/usr/share/virt-manager/virtinst/install/installer.py", line 386, in detect_distro
    ret = self._treemedia.detect_distro(guest)
  File "/usr/share/virt-manager/virtinst/install/installertreemedia.py", line 300, in detect_distro
    cache = self._get_cached_data(guest, fetcher)
  File "/usr/share/virt-manager/virtinst/install/installertreemedia.py", line 185, in _get_cached_data
    store = urldetect.getDistroStore(guest, fetcher,
  File "/usr/share/virt-manager/virtinst/install/urldetect.py", line 292, in getDistroStore
    store = sclass(fetcher.location, arch, _type, cache)
  File "/usr/share/virt-manager/virtinst/install/urldetect.py", line 349, in __init__
    self._set_manual_kernel_paths()
  File "/usr/share/virt-manager/virtinst/install/urldetect.py", line 669, in _set_manual_kernel_paths
    self._set_url_paths()
  File "/usr/share/virt-manager/virtinst/install/urldetect.py", line 698, in _set_url_paths
    if self._debname == "ubuntu" and self._os_variant >= 'ubuntu20.04':
TypeError: '>=' not supported between instances of 'NoneType' and 'str'

@crobinso
Copy link
Member

Thanks. You are using a URL http://install/installer-ubuntu1804-amd64/ , is that something you changed for confidentiality reasons or something you prepared on your local network? To figure out what's going on it will help if there's a public URL I can access to reproduce. So maybe you can find a public URL that causes the same issue, or describe how the content on the other end of that URL was populated

@REHICode
Copy link
Author

Hi crobinso, i am working in a dedicated server environment. The servers don't have an internet connection. Therefore i am using a mirror server http://install/installer-ubuntu1804-amd64/ for the environment.
If i apply the above command on an 18.04 host, it works just fine. Also with the self created mirror location.
Since i updated the host to 20.04 it doesn't anymore.

@REHICode
Copy link
Author

root@install:/var/www/install/installer-ubuntu1804-amd64# tree
.
└── current
    └── images
        ├── MANIFEST
        └── netboot
            └── ubuntu-installer
                └── amd64
                    ├── initrd.gz -> /var/lib/tftpboot/ubuntu-installer/18.04.1/initrd.gz
                    └── linux -> /var/lib/tftpboot/ubuntu-installer/18.04.1/linux

5 directories, 3 files

@crobinso
Copy link
Member

Thanks, I will try to figure it out

@REHICode
Copy link
Author

Thank you, if you need more files / contents or package versions, please let me know.

@crobinso
Copy link
Member

This appears to be a bug in a patch that ubuntu is carrying in their distro, so it does not affect upstream. The patch was added as part of https://bugs.launchpad.net/ubuntu-z-systems/+bug/1872941

Can you confirm that your usecase works with upstream virt-manager?

git clone https://github.com/virt-manager/virt-manager
cd virt-manager
./virt-install YOUR COMMAND LINE OPTIONS

And then please file a bug with ubuntu and mention this report, and that the patch for that launchpad issue is faulty

@REHICode
Copy link
Author

Hi Crobinso, thank you for your efforts. The upstream version works perfectly fine. I will report this to ubuntu and also link to this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants