Failed talking to pod: int() argument must be a string, a bytes-like object or a number, not 'NoneType'

Bug #1690144 reported by Björn Tillenius
22
This bug affects 4 people
Affects Status Importance Assigned to Milestone
MAAS
Fix Released
Critical
Blake Rouse

Bug Description

I got the above error when trying to add a virsh pod. This is the
traceback from rackd.log:

2017-05-11 12:53:12 provisioningserver.rpc.pods: [critical] Failed to discover p
od.

Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/twisted/internet/defer.py", line 434, in
errback
    self._startRunCallbacks(fail)
  File "/usr/lib/python3/dist-packages/twisted/internet/defer.py", line 501, in
_startRunCallbacks
    self._runCallbacks()
  File "/usr/lib/python3/dist-packages/twisted/internet/defer.py", line 588, in
_runCallbacks
    current.result = callback(current.result, *args, **kw)
  File "/usr/lib/python3/dist-packages/twisted/internet/defer.py", line 1184, in
 gotResult
    _inlineCallbacks(r, g, deferred)
--- <exception caught here> ---
  File "/usr/lib/python3/dist-packages/twisted/internet/defer.py", line 1126, in
 _inlineCallbacks
    result = result.throwExceptionIntoGenerator(g)
  File "/usr/lib/python3/dist-packages/twisted/python/failure.py", line 389, in
throwExceptionIntoGenerator
    return g.throw(self.type, self.value, self.tb)
  File "/usr/lib/python3/dist-packages/provisioningserver/drivers/pod/virsh.py",
 line 865, in discover
    conn.get_discovered_machine, vm)
  File "/usr/lib/python3/dist-packages/twisted/python/threadpool.py", line 246,
in inContext
    result = inContext.theWork()
  File "/usr/lib/python3/dist-packages/twisted/python/threadpool.py", line 262,
in <lambda>
    inContext.theWork = lambda: context.call(ctx, func, *args, **kw)
  File "/usr/lib/python3/dist-packages/twisted/python/context.py", line 118, in
callWithContext
    return self.currentContext().callWithContext(ctx, func, *args, **kw)
  File "/usr/lib/python3/dist-packages/twisted/python/context.py", line 81, in c
allWithContext
    return func(*args,**kw)
  File "/usr/lib/python3/dist-packages/provisioningserver/utils/twisted.py", lin
e 232, in wrapper
    result = func(*args, **kwargs)
  File "/usr/lib/python3/dist-packages/provisioningserver/drivers/pod/virsh.py",
 line 493, in get_discovered_machine
    size=self.get_machine_local_storage(machine, device),
  File "/usr/lib/python3/dist-packages/provisioningserver/drivers/pod/virsh.py",
 line 405, in get_machine_local_storage
    return int(self.get_key_value(output, "Capacity"))
builtins.TypeError: int() argument must be a string, a bytes-like object or a number, not 'NoneType'

Related branches

Changed in maas:
status: New → Triaged
importance: Undecided → Critical
milestone: none → 2.2.0rc4
Revision history for this message
Björn Tillenius (bjornt) wrote :

Looks like I have a VM with a non-existing storage path:

lilium:~> virsh domblklist --details ubuntu16.04
Type Device Target Source
------------------------------------------------
block disk vda /dev/ubuntu-vg/ubuntu16.04

lilium:~> virsh domblkinfo ubuntu16.04 /dev/ubuntu-vg/ubuntu16.04
error: cannot stat file '/dev/ubuntu-vg/ubuntu16.04': Bad file descriptor

I used to have /dev/ubuntu-vg, but it doesn't exist anymore and I didn't
delete the VM.

Changed in maas:
status: Triaged → In Progress
assignee: nobody → Blake Rouse (blake-rouse)
Changed in maas:
milestone: 2.2.0rc4 → 2.2.0rc5
Changed in maas:
status: In Progress → Fix Committed
Changed in maas:
status: Fix Committed → Fix Released
milestone: 2.2.0rc5 → 2.2.0
Revision history for this message
Luca Cervigni (cervigni) wrote :

I think this bug is again present in MAAS latest version

when adding a pod:
"int() argument must be a string, a bytes-like object or a number, not 'NoneType'"

rackd logs

2017-09-06 10:46:57 provisioningserver.rpc.pods: [critical] Failed to discover pod.

Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/twisted/internet/defer.py", line 434, in errback
    self._startRunCallbacks(fail)
  File "/usr/lib/python3/dist-packages/twisted/internet/defer.py", line 501, in _startRunCallbacks
    self._runCallbacks()
  File "/usr/lib/python3/dist-packages/twisted/internet/defer.py", line 588, in _runCallbacks
    current.result = callback(current.result, *args, **kw)
  File "/usr/lib/python3/dist-packages/twisted/internet/defer.py", line 1184, in gotResult
    _inlineCallbacks(r, g, deferred)
--- <exception caught here> ---
  File "/usr/lib/python3/dist-packages/twisted/internet/defer.py", line 1126, in _inlineCallbacks
    result = result.throwExceptionIntoGenerator(g)
  File "/usr/lib/python3/dist-packages/twisted/python/failure.py", line 389, in throwExceptionIntoGenerator
    return g.throw(self.type, self.value, self.tb)
  File "/usr/lib/python3/dist-packages/provisioningserver/drivers/pod/virsh.py", line 880, in discover
    conn = yield self.get_virsh_connection(context)
  File "/usr/lib/python3/dist-packages/twisted/internet/defer.py", line 1128, in _inlineCallbacks
    result = g.send(result)
  File "/usr/lib/python3/dist-packages/provisioningserver/drivers/pod/virsh.py", line 871, in get_virsh_connection
    raise VirshError('Failed to login to virsh console.')
provisioningserver.drivers.pod.virsh.VirshError: Failed to login to virsh console.

If running manually:
sudo -u maas virsh -c qemu+ssh://ubuntu@146.118.53.254/system list --all
 Id Name State
----------------------------------------------------

It works

Revision history for this message
Luca Cervigni (cervigni) wrote :
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.