Error 500 on some machines: instance:get_bootorder() gets confused with network disks (ceph/rbd volumes)

Open
#663 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
50/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Stale
Tech stack
python
Domain
backend

Research direction

Start in vrtManager/instance.py at get_bootorder(), where the traceback shows dev.find("mac").get("address") failing for a network disk in the machine XML. Review how the disk devices are handled, then verify that pages no longer return Error 500 when the XML contains type='network' RBD volumes.

Written by the indexing model from the issue text.

Description

Hi there,

some pages return Error 500 with the following trace in webvirtcloud.log:

    value = self._resolve_lookup(context)
  File "/srv/webvirtcloud/venv/lib/python3.9/site-packages/django/template/base.py", line 890, in _resolve_lookup
    current = getattr(current, bit)
  File "/srv/webvirtcloud/venv/lib/python3.9/site-packages/django/utils/functional.py", line 57, in __get__
    res = instance.__dict__[self.name] = self.func(instance)
  File "/srv/webvirtcloud/instances/models.py", line 74, in boot_order
    return self.proxy.get_bootorder()
  File "/srv/webvirtcloud/vrtManager/instance.py", line 638, in get_bootorder
    dev_mac = dev.find("mac").get("address")
AttributeError: 'NoneType' object has no attribute 'get'

Here is an excerpt of the XML definition of the machine:

 <devices>
    ...
    <disk type='network' device='disk'>
      ...
      <source protocol='rbd' name='libvirt-pool/xxxxx'>
        <host name='1.2.3.4' port='6789'/>
        <host name='1.2.3.5' port='6789'/>
        <host name='1.2.3.6' port='6789'/>
      </source>
      <target dev='vda' bus='virtio'/>
      <boot order='1'/>
      ...
    </disk>
    ...
  </devices>

The problem comes from the type='network' attribute.

Dominant language
JavaScript
Stars
1.9k
Forks
398
PR merge metrics
No merged PRs in 30d

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from retspen/webvirtcloud

All issues in retspen/webvirtcloud

Similar issues

More JavaScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.