MAAS doesn't shutdown gracefully

Bug #1961269 reported by Diego Mascialino
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
MAAS
Triaged
Low
Unassigned
3.3
Triaged
Low
Unassigned

Bug Description

Running the snap version:
3.1.0-10902-g.8049d20f4 2022-01-13 (18186) 143MB -

executed: `sudo snap restart maas`

and there are multiple Tracebacks in regiond.log

i.e:

2022-02-17 14:23:48 twisted.internet.defer: [critical] Unhandled error in Deferred:
2022-02-17 14:23:48 twisted.internet.defer: [critical]
 Traceback (most recent call last):
   File "/snap/maas/18547/usr/lib/python3/dist-packages/twisted/internet/defer.py", line 460, in callback
     self._startRunCallbacks(result)
   File "/snap/maas/18547/usr/lib/python3/dist-packages/twisted/internet/defer.py", line 568, in _startRunCallbacks
     self._runCallbacks()
   File "/snap/maas/18547/usr/lib/python3/dist-packages/twisted/internet/defer.py", line 654, in _runCallbacks
     current.result = callback(current.result, *args, **kw)
   File "/snap/maas/18547/usr/lib/python3/dist-packages/twisted/internet/defer.py", line 1475, in gotResult
     _inlineCallbacks(r, g, status)
 --- <exception caught here> ---
   File "/snap/maas/18547/usr/lib/python3/dist-packages/twisted/internet/defer.py", line 1418, in _inlineCallbacks
     result = g.send(result)
   File "/snap/maas/18547/lib/python3.8/site-packages/maasserver/listener.py", line 382, in registerChannels
     self.registeredChannels.remove(channel)
 builtins.KeyError: 'sys_core_645'

2022-02-17 14:23:48 twisted.scripts: [info] Server Shut Down.
2022-02-17 14:23:48 twisted.internet.defer: [critical] Unhandled error in Deferred:
2022-02-17 14:23:48 twisted.internet.defer: [critical]
 Traceback (most recent call last):
   File "/usr/lib/python3.8/threading.py", line 870, in run
     self._target(*self._args, **self._kwargs)
   File "/snap/maas/18547/lib/python3.8/site-packages/provisioningserver/utils/twisted.py", line 821, in worker
     return target()
   File "/snap/maas/18547/usr/lib/python3/dist-packages/twisted/_threads/_threadworker.py", line 46, in work
     task()
   File "/snap/maas/18547/usr/lib/python3/dist-packages/twisted/_threads/_team.py", line 190, in doWork
     task()
 --- <exception caught here> ---
   File "/snap/maas/18547/usr/lib/python3/dist-packages/twisted/python/threadpool.py", line 250, in inContext
     result = inContext.theWork()
   File "/snap/maas/18547/usr/lib/python3/dist-packages/twisted/python/threadpool.py", line 266, in <lambda>
     inContext.theWork = lambda: context.call(ctx, func, *args, **kw)
   File "/snap/maas/18547/usr/lib/python3/dist-packages/twisted/python/context.py", line 122, in callWithContext
     return self.currentContext().callWithContext(ctx, func, *args, **kw)
   File "/snap/maas/18547/usr/lib/python3/dist-packages/twisted/python/context.py", line 85, in callWithContext
     return func(*args,**kw)
   File "/snap/maas/18547/lib/python3.8/site-packages/provisioningserver/utils/twisted.py", line 856, in callInContext
     return func(*args, **kwargs)
   File "/snap/maas/18547/lib/python3.8/site-packages/provisioningserver/utils/twisted.py", line 202, in wrapper
     result = func(*args, **kwargs)
   File "/snap/maas/18547/lib/python3.8/site-packages/maasserver/listener.py", line 244, in stopConnection
     connection_wrapper.commit()
   File "/snap/maas/18547/usr/lib/python3/dist-packages/django/db/backends/base/base.py", line 260, in commit
     self.validate_thread_sharing()
   File "/snap/maas/18547/usr/lib/python3/dist-packages/django/db/backends/base/base.py", line 542, in validate_thread_sharing
     raise DatabaseError(
 django.db.utils.DatabaseError: DatabaseWrapper objects created in a thread can only be used in that same thread. The object with alias 'default' was created in thread id 140265292998400 and this is thread id 140265264637696.

Revision history for this message
Diego Mascialino (dmascialino) wrote :
summary: - Maas doesn't shutdown gracefully
+ MAAS doesn't shutdown gracefully
description: updated
Revision history for this message
Jerzy Husakowski (jhusakowski) wrote :

Shutdown should not produce error messages during normal shutdown sequence

Changed in maas:
importance: Undecided → Low
milestone: none → 3.3.0
Changed in maas:
milestone: 3.3.0 → 3.4.0
Alberto Donato (ack)
Changed in maas:
milestone: 3.4.0 → 3.4.x
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

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