Can't import images

Bug #1498659 reported by Andres Rodriguez
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
MAAS
Fix Released
Critical
Gavin Panella

Bug Description

Upgrading from 1.9.0~alpha2+bzr4287-0ubuntu1~wily1 to 1.9.0~alpha2+bzr4293-0ubuntu1~wily1. The latest change sin trunk break the image import.

2015-09-22 17:20:59 [-] Exception in thread Thread-8:
2015-09-22 17:20:59 [-] Traceback (most recent call last):
2015-09-22 17:20:59 [-] File "/usr/lib/python2.7/threading.py", line 810, in __bootstrap_inner
2015-09-22 17:20:59 [-] self.run()
2015-09-22 17:20:59 [-] File "/usr/lib/python2.7/threading.py", line 763, in run
2015-09-22 17:20:59 [-] Exception in thread Thread-7:
2015-09-22 17:20:59 [-] self.__target(*self.__args, **self.__kwargs)
2015-09-22 17:20:59 [-] File "/usr/lib/python2.7/dist-packages/maasserver/utils/orm.py", line 481, in call_within_transaction
2015-09-22 17:20:59 [-] return func_outside_txn(*args, **kwargs)
2015-09-22 17:20:59 [-] File "/usr/lib/python2.7/dist-packages/maasserver/utils/orm.py", line 308, in retrier
2015-09-22 17:20:59 [-] return func(*args, **kwargs)
2015-09-22 17:20:59 [-] File "/usr/lib/django16/django/db/transaction.py", line 371, in inner
2015-09-22 17:20:59 [-] return func(*args, **kwargs)
2015-09-22 17:20:59 [-] File "/usr/lib/python2.7/dist-packages/maasserver/bootresources.py", line 698, in write_content_thread
2015-09-22 17:20:59 [-] rfile = BootResourceFile.objects.get(id=rid)
2015-09-22 17:20:59 [-] File "/usr/lib/django16/django/db/models/manager.py", line 151, in get
2015-09-22 17:20:59 [-] return self.get_queryset().get(*args, **kwargs)
2015-09-22 17:20:59 [-] File "/usr/lib/django16/django/db/models/query.py", line 310, in get
2015-09-22 17:20:59 [-] self.model._meta.object_name)
2015-09-22 17:20:59 [-] DoesNotExist: BootResourceFile matching query does not exist.
2015-09-22 17:20:59 [-]
2015-09-22 17:20:59 [-] Traceback (most recent call last):
2015-09-22 17:20:59 [-] File "/usr/lib/python2.7/threading.py", line 810, in __bootstrap_inner
2015-09-22 17:20:59 [-] self.run()
2015-09-22 17:20:59 [-] File "/usr/lib/python2.7/threading.py", line 763, in run
2015-09-22 17:20:59 [-] self.__target(*self.__args, **self.__kwargs)
2015-09-22 17:20:59 [-] File "/usr/lib/python2.7/dist-packages/maasserver/utils/orm.py", line 481, in call_within_transaction
2015-09-22 17:20:59 [-] return func_outside_txn(*args, **kwargs)
2015-09-22 17:20:59 [-] File "/usr/lib/python2.7/dist-packages/maasserver/utils/orm.py", line 308, in retrier
2015-09-22 17:20:59 [-] return func(*args, **kwargs)
2015-09-22 17:20:59 [-] File "/usr/lib/django16/django/db/transaction.py", line 371, in inner
2015-09-22 17:20:59 [-] return func(*args, **kwargs)
2015-09-22 17:20:59 [-] File "/usr/lib/python2.7/dist-packages/maasserver/bootresources.py", line 698, in write_content_thread
2015-09-22 17:20:59 [-] rfile = BootResourceFile.objects.get(id=rid)
2015-09-22 17:20:59 [-] File "/usr/lib/django16/django/db/models/manager.py", line 151, in get
2015-09-22 17:20:59 [-] return self.get_queryset().get(*args, **kwargs)
2015-09-22 17:20:59 [-] File "/usr/lib/django16/django/db/models/query.py", line 310, in get
2015-09-22 17:20:59 [-] self.model._meta.object_name)
2015-09-22 17:20:59 [-] DoesNotExist: BootResourceFile matching query does not exist.

Tags: tech-debt

Related branches

Changed in maas:
assignee: nobody → Gavin Panella (allenap)
milestone: none → 1.9.0
importance: Undecided → Critical
status: New → Confirmed
Gavin Panella (allenap)
Changed in maas:
status: Confirmed → In Progress
Revision history for this message
Gavin Panella (allenap) wrote :

FWIW, deferToDatabase() ensures that the function it calls is wrapped in a transaction. However, _import_resources() explicitly manages its own transactions, and it breaks if it is called within a transaction. Unfortunately there was no test, no assertion, and no documentation stating this.

tags: added: tech-debt
Gavin Panella (allenap)
Changed in maas:
status: In Progress → Fix Committed
Changed in maas:
status: Fix Committed → Fix Released
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.