I was testing a bad patch when I came across this issue. This patch was in src/maasserver/rpc/boot.py:
What happened is that:
1. tried to commission the machine
2. the machine booted, error out when getting the kernel to boot so it fall'd back to boot enlistment
3. enlistment booted, I noticed i stopped the buuild.
4. fixed the patch
5. This error now shows every time I try to commission
What's even more interesting, is that I left without retrying commissioning and after a while, it actually allowed me to commission the machine.
This means that there's something going bad and then it doens't anymore...
2018-02-07 17:38:58 regiond: [info] 192.168.122.1 GET /MAAS/rpc/ HTTP/1.1 --> 200 OK (referrer: -; agent: provisioningserver.rpc.clusterservice.ClusterClientService)
2018-02-07 17:39:12 maasserver.websockets.protocol: [critical] Error on request (421) machine.action: ScriptSet matching query does not exist.
Traceback (most recent call last):
File "/usr/lib/python3.6/threading.py", line 864, in run
self._target(*self._args, **self._kwargs)
File "/usr/lib/python3/dist-packages/provisioningserver/utils/twisted.py", line 842, in worker
return target()
File "/usr/lib/python3/dist-packages/twisted/_threads/_threadworker.py", line 46, in work
task()
File "/usr/lib/python3/dist-packages/twisted/_threads/_team.py", line 190, in doWork
task()
--- <exception caught here> ---
File "/usr/lib/python3/dist-packages/twisted/python/threadpool.py", line 250, in inContext
result = inContext.theWork()
File "/usr/lib/python3/dist-packages/twisted/python/threadpool.py", line 266, in <lambda>
inContext.theWork = lambda: context.call(ctx, func, *args, **kw)
File "/usr/lib/python3/dist-packages/twisted/python/context.py", line 122, in callWithContext
return self.currentContext().callWithContext(ctx, func, *args, **kw)
File "/usr/lib/python3/dist-packages/twisted/python/context.py", line 85, in callWithContext
return func(*args,**kw)
File "/usr/lib/python3/dist-packages/provisioningserver/utils/twisted.py", line 875, in callInContext
return func(*args, **kwargs)
File "/usr/lib/python3/dist-packages/provisioningserver/utils/twisted.py", line 232, in wrapper
result = func(*args, **kwargs)
File "/usr/lib/python3/dist-packages/maasserver/utils/orm.py", line 754, in call_within_transaction
return func_outside_txn(*args, **kwargs)
File "/usr/lib/python3/dist-packages/maasserver/utils/orm.py", line 561, in retrier
return func(*args, **kwargs)
File "/usr/lib/python3.6/contextlib.py", line 52, in inner
return func(*args, **kwds)
File "/usr/lib/python3/dist-packages/maasserver/websockets/handlers/machine.py", line 743, in action
return action.execute(**extra_params)
File "/usr/lib/python3/dist-packages/maasserver/node_action.py", line 247, in execute
testing_scripts=testing_scripts)
File "/usr/lib/python3/dist-packages/maasserver/utils/orm.py", line 738, in call_within_transaction
return func_within_txn(*args, **kwargs)
File "/usr/lib/python3.6/contextlib.py", line 52, in inner
return func(*args, **kwds)
File "/usr/lib/python3/dist-packages/maasserver/models/node.py", line 1901, in start_commissioning
self, testing_scripts)
File "/usr/lib/python3/dist-packages/metadataserver/models/scriptset.py", line 179, in create_testing_script_set
script_set.delete()
File "/usr/lib/python3/dist-packages/metadataserver/models/scriptset.py", line 500, in delete
elif self == self.node.current_testing_script_set:
File "/usr/lib/python3/dist-packages/django/db/models/fields/related_descriptors.py", line 184, in __get__
rel_obj = self.get_object(instance)
File "/usr/lib/python3/dist-packages/django/db/models/fields/related_descriptors.py", line 159, in get_object
return qs.get(self.field.get_reverse_related_filter(instance))
File "/usr/lib/python3/dist-packages/django/db/models/query.py", line 380, in get
self.model._meta.object_name
metadataserver.models.scriptset.DoesNotExist: ScriptSet matching query does not exist.
Looking at the line numbers from the stack trace this appears to be from a previous version(6db74f). I've landed fixes since then to scriptset.py. I think this is a duplicate of LP:1751946 which has landed in master and 2.3. Could you please try to reproduce with the latest master/2.3?