Upgrade MAAS from 2.4 to 2.5 version - with "Ubuntu extra architectures" changed

Bug #1826388 reported by masterpe
14
This bug affects 3 people
Affects Status Importance Assigned to Milestone
MAAS
Won't Fix
Medium
Unassigned

Bug Description

Hi,

As stated on https://discourse.maas.io/t/upgrade-maas-from-2-4-to-2-5-version/ I get an error when upgrading from MAAS 2.4 to 2.5.

from MAAS version: 2.4.2 (7034-g2f5deb8b8-0ubuntu1)
to MAAS version: 2.5.2 (7523-ge4ecbd54d-0ubuntu1~18.04.1)

I get the following error:

Setting up maas-region-controller (2.5.2-7523-ge4ecbd54d-0ubuntu1~18.04.1) ...
Operations to perform:
  Apply all migrations: auth, contenttypes, maasserver, metadataserver, piston3, sessions, sites
Running migrations:
  Applying maasserver.0161_pod_storage_pools... OK
  Applying maasserver.0162_storage_pools_notification... OK
  Applying maasserver.0163_create_new_power_parameters_with_jsonfield... OK
  Applying maasserver.0164_copy_over_existing_power_parameters... OK
  Applying maasserver.0165_remove_and_rename_power_parameters... OK
  Applying maasserver.0166_auto_select_s390x_extra_arches...Traceback (most recent call last):
  File "/usr/lib/python3.6/runpy.py", line 193, in _run_module_as_main
    "__main__", mod_spec)
  File "/usr/lib/python3.6/runpy.py", line 85, in _run_code
    exec(code, run_globals)
  File "/usr/lib/python3/dist-packages/maasserver/__main__.py", line 9, in <module>
    raise SystemExit(execute_from_command_line())
  File "/usr/lib/python3/dist-packages/maasserver/__init__.py", line 56, in execute_from_command_line
    management.execute_from_command_line()
  File "/usr/lib/python3/dist-packages/django/core/management/__init__.py", line 364, in execute_from_command_line
    utility.execute()
  File "/usr/lib/python3/dist-packages/django/core/management/__init__.py", line 356, in execute
    self.fetch_command(subcommand).run_from_argv(self.argv)
  File "/usr/lib/python3/dist-packages/django/core/management/base.py", line 283, in run_from_argv
    self.execute(*args, **cmd_options)
  File "/usr/lib/python3/dist-packages/django/core/management/base.py", line 330, in execute
    output = self.handle(*args, **options)
  File "/usr/lib/python3/dist-packages/maasserver/management/commands/dbupgrade.py", line 426, in handle
    fake_initial=self._south_was_performed(database))
  File "/usr/lib/python3/dist-packages/django/core/management/__init__.py", line 131, in call_command
    return command.execute(*args, **defaults)
  File "/usr/lib/python3/dist-packages/django/core/management/base.py", line 330, in execute
    output = self.handle(*args, **options)
  File "/usr/lib/python3/dist-packages/django/core/management/commands/migrate.py", line 204, in handle
    fake_initial=fake_initial,
  File "/usr/lib/python3/dist-packages/django/db/migrations/executor.py", line 115, in migrate
    state = self._migrate_all_forwards(state, plan, full_plan, fake=fake, fake_initial=fake_initial)
  File "/usr/lib/python3/dist-packages/django/db/migrations/executor.py", line 145, in _migrate_all_forwards
    state = self.apply_migration(state, migration, fake=fake, fake_initial=fake_initial)
  File "/usr/lib/python3/dist-packages/django/db/migrations/executor.py", line 244, in apply_migration
    state = migration.apply(state, schema_editor)
  File "/usr/lib/python3/dist-packages/django/db/migrations/migration.py", line 129, in apply
    operation.database_forwards(self.app_label, schema_editor, old_state, project_state)
  File "/usr/lib/python3/dist-packages/django/db/migrations/operations/special.py", line 193, in database_forwards
    self.code(from_state.apps, schema_editor)
  File "/usr/lib/python3/dist-packages/maasserver/migrations/builtin/maasserver/0166_auto_select_s390x_extra_arches.py", line 12, in add_s390x_to_pkg_repository_to_arches
    url='http://ports.ubuntu.com/ubuntu-ports')
  File "/usr/lib/python3/dist-packages/django/db/models/manager.py", line 85, in manager_method
    return getattr(self.get_queryset(), name)(*args, **kwargs)
  File "/usr/lib/python3/dist-packages/django/db/models/query.py", line 380, in get
    self.model._meta.object_name
__fake__.DoesNotExist: PackageRepository matching query does not exist.
dpkg: error processing package maas-region-controller (--configure):
 installed maas-region-controller package post-installation script subprocess returned error exit status 1
dpkg: dependency problems prevent configuration of maas:
 maas depends on maas-region-controller (= 2.5.2-7523-ge4ecbd54d-0ubuntu1~18.04.1); however:
  Package maas-region-controller is not configured yet.

dpkg: error processing package maas (--configure):
 dependency problems - leaving unconfigured

The steps that I follow to repreduse the failure:
1. Create a new container:
  lxc-create -n maas -t download -- -d ubuntu -a amd64 -r bionic
2. start the container
  lxc-start -n maas
3. Attache the container
  lxc-attach -n maas su
4. update the apt
  apt update
5. install maas
  apt install maas
6. create maas user
7. change the repo
  setting -> "package repositories" -> "Ubuntu extra architectures" set the URL to: http://192.168.1.2/ubuntu

8. install add-apt-repository
  sudo apt-get install software-properties-common
9. add ppa:maas/stable
  add-apt-repository ppa:maas/stable
10. upgrade the packages:
  apt upgrade

root@maas:~# dpkg -l '*maas*'|cat
Desired=Unknown/Install/Remove/Purge/Hold
| Status=Not/Inst/Conf-files/Unpacked/halF-conf/Half-inst/trig-aWait/Trig-pend
|/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad)
||/ Name Version Architecture Description
+++-===============================-======================================-============-=================================================
iU maas 2.5.2-7523-ge4ecbd54d-0ubuntu1~18.04.1 all "Metal as a Service" is a physical cloud and IPAM
ii maas-cli 2.5.2-7523-ge4ecbd54d-0ubuntu1~18.04.1 all MAAS client and command-line interface
un maas-cluster-controller <none> <none> (no description available)
ii maas-common 2.5.2-7523-ge4ecbd54d-0ubuntu1~18.04.1 all MAAS server common files
ii maas-dhcp 2.5.2-7523-ge4ecbd54d-0ubuntu1~18.04.1 all MAAS DHCP server
un maas-dns <none> <none> (no description available)
ii maas-proxy 2.5.2-7523-ge4ecbd54d-0ubuntu1~18.04.1 all MAAS Caching Proxy
ii maas-rack-controller 2.5.2-7523-ge4ecbd54d-0ubuntu1~18.04.1 all Rack Controller for MAAS
ii maas-region-api 2.5.2-7523-ge4ecbd54d-0ubuntu1~18.04.1 all Region controller API service for MAAS
iF maas-region-controller 2.5.2-7523-ge4ecbd54d-0ubuntu1~18.04.1 all Region Controller for MAAS
un maas-region-controller-min <none> <none> (no description available)
un python-django-maas <none> <none> (no description available)
un python-maas-client <none> <none> (no description available)
un python-maas-provisioningserver <none> <none> (no description available)
ii python3-django-maas 2.5.2-7523-ge4ecbd54d-0ubuntu1~18.04.1 all MAAS server Django web framework (Python 3)
ii python3-maas-client 2.5.2-7523-ge4ecbd54d-0ubuntu1~18.04.1 all MAAS python API client (Python 3)
ii python3-maas-provisioningserver 2.5.2-7523-ge4ecbd54d-0ubuntu1~18.04.1 all MAAS server provisioning libraries (Python 3)

Revision history for this message
masterpe (michiel-y) wrote :
Revision history for this message
Adam Beeman (abeeman) wrote :

I hit this issue as well during my upgrade. Since I don't need any other architectures than x86, I edited /usr/lib/python3/dist-packages/maasserver/migrations/builtin/maasserver/0166_auto_select_s390x_extra_arches.py and basically stubbed out the add_s390x_to_pkg_repository_to_arches() function, ran apt-update -y again, and the upgrade finished up just fine.

It's not a "solution" but if you are reading this because you hit the same issue, it's a viable workaround to get you out of trouble.

Lee Trager (ltrager)
Changed in maas:
status: New → Triaged
importance: Undecided → Medium
Revision history for this message
Sascha Dewald (sdhd) wrote :

i had a similar problem, when switching back from maas/next ppa to maas/stable

in my case i could fix the issue with:

  $ maas-region makemigrations

  $ apt install --reinstall maas-region-controller

Revision history for this message
Jerzy Husakowski (jhusakowski) wrote :

No longer an issue for more recent upgrades, edge case with a trivial workaround.

Changed in maas:
status: Triaged → Won't Fix
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Bug attachments

Remote bug watches

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