Identical os/release boot-source-selections break the images UI.

Bug #1376812 reported by Dave Chiluk
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
MAAS
Triaged
High
Unassigned

Bug Description

The BootSourceSelection model does not have unique set on boot_source/os/release. Without this the usage of the images UI breaks, and also leaves the data inconsistent.

Revision history for this message
Dave Chiluk (chiluk) wrote :

Let me know if you want access to the server experiencing the issue.

Revision history for this message
Blake Rouse (blake-rouse) wrote :

Can you please attach the following logs so we can debug what occurred.

maas.log
maas-django.log
apache2/error.log

Changed in maas:
status: New → Incomplete
tags: added: boot-images
Changed in maas:
milestone: none → 1.7.0
Revision history for this message
Dave Chiluk (chiluk) wrote :

Requested error logs.

Raphaël Badin (rvb)
Changed in maas:
importance: Undecided → Critical
Revision history for this message
Dave Chiluk (chiluk) wrote :

If it means anything to you I did just do an upgrade from beta3 to beta4. During the update apt wanted to replace my configuration files with maintainer versions. I checked the diff and it looked like it wanted to reset the passwords to the database processes. I chose not use the maintainer versions.

Revision history for this message
Blake Rouse (blake-rouse) wrote :

Could you please test this with the latest version to see if this is still occurring as I am unable to reproduce this issue.

Revision history for this message
Julian Edwards (julian-edwards) wrote : Re: [Bug 1376812] Re: Add release 13.10 under images tab causes internal server error

On Thursday 02 Oct 2014 18:32:25 Dave Chiluk wrote:
> If it means anything to you I did just do an upgrade from beta3 to
> beta4. During the update apt wanted to replace my configuration files
> with maintainer versions. I checked the diff and it looked like it
> wanted to reset the passwords to the database processes. I chose not
> use the maintainer versions.

This is normal and is piece of stupid in the packaging. Please let it change
the passwords.

Revision history for this message
Dave Chiluk (chiluk) wrote : Re: Add release 13.10 under images tab causes internal server error

I retested with the latest 1.7.0~beta5+bzr3198-0ubuntu1 just now, and am still receiving the error.

Do I need to restart any particular services in order for the update to take place? I would've figured apt would take care of a lot of that for you.

tags: added: cts
Revision history for this message
Julian Edwards (julian-edwards) wrote :

I cannot recreate this with the latest package in experimental. Can you try again please Dave?

Revision history for this message
Raphaël Badin (rvb) wrote :

This seems to be the problem (except from your log):

Traceback (most recent call last):
  File "/usr/lib/python2.7/dist-packages/django/core/handlers/base.py", line 112, in get_response
    response = wrapped_callback(request, *callback_args, **callback_kwargs)
  File "/usr/lib/python2.7/dist-packages/django/views/generic/base.py", line 69, in view
    return self.dispatch(request, *args, **kwargs)
  File "/usr/lib/python2.7/dist-packages/django/views/generic/base.py", line 87, in dispatch
    return handler(request, *args, **kwargs)
  File "/usr/lib/python2.7/dist-packages/maasserver/views/images.py", line 152, in post
    self.ubuntu_sources[0], 'ubuntu', releases, arches)
  File "/usr/lib/python2.7/dist-packages/maasserver/views/images.py", line 313, in update_source_selection
    boot_source=boot_source, os=os, release=release)
  File "/usr/lib/python2.7/dist-packages/django/db/models/manager.py", line 154, in get_or_create
    return self.get_queryset().get_or_create(**kwargs)
  File "/usr/lib/python2.7/dist-packages/django/db/models/query.py", line 373, in get_or_create
    return self.get(**lookup), False
  File "/usr/lib/python2.7/dist-packages/django/db/models/query.py", line 310, in get
    (self.model._meta.object_name, num))
MultipleObjectsReturned: get() returned more than one BootSourceSelection -- it returned 3!

Revision history for this message
Christian Reis (kiko) wrote :

Moving ahead, but will post a workaround for you meanwhile.

Changed in maas:
milestone: 1.7.0 → next
Revision history for this message
Blake Rouse (blake-rouse) wrote :

The issue is that you created boot-source-selections for os/release multiple times, and the UI is failing to handle this. Overall your boot-source-selections are in an inconsistent state. You need to merge all boot-source-selections for os/release into one selection.

Use the API to remove all extra selections on that boot source or the given os/release combination. Make only one os/release combination per selection.

If you need multiple architectures then you can just do 'arches="amd64" arches="arm64"' in the same create command.

Changed in maas:
importance: Critical → High
Revision history for this message
Christian Reis (kiko) wrote :

Is this bug not a dupe of bug 1376812?

summary: - Add release 13.10 under images tab causes internal server error
+ Identical os/release boot-source-selections break the images UI.
description: updated
Changed in maas:
status: Incomplete → Triaged
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.