Migration of BMC power credentials fails with manual driver

Bug #2002109 reported by Adam Collard
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
MAAS
Fix Released
Critical
Adam Collard
3.3
Fix Released
Critical
Unassigned

Bug Description

$ bin/database --preserve run -- bin/maas-region dbupgrade
Operations to perform:
  Apply all migrations: auth, contenttypes, maasserver, metadataserver, piston3, sessions, sites
Running migrations:
  Applying maasserver.0288_rootkey_material_secret... OK
  Applying maasserver.0289_vault_secret... OK
  Applying maasserver.0290_migrate_node_power_parameters...Traceback (most recent call last):
  File "/home/ubuntu/maas/bin/maas-region", line 33, in <module>
    sys.exit(load_entry_point('maas', 'console_scripts', 'maas-region')())
  File "/home/ubuntu/maas/src/maasserver/region_script.py", line 78, in run
    run_django(is_snap, is_devenv)
  File "/home/ubuntu/maas/src/maasserver/region_script.py", line 67, in run_django
    management.execute_from_command_line()
  File "/usr/lib/python3/dist-packages/django/core/management/__init__.py", line 419, in execute_from_command_line
    utility.execute()
  File "/usr/lib/python3/dist-packages/django/core/management/__init__.py", line 413, in execute
    self.fetch_command(subcommand).run_from_argv(self.argv)
  File "/usr/lib/python3/dist-packages/django/core/management/base.py", line 354, in run_from_argv
    self.execute(*args, **cmd_options)
  File "/usr/lib/python3/dist-packages/django/core/management/base.py", line 398, in execute
    output = self.handle(*args, **options)
  File "/home/ubuntu/maas/src/maasserver/management/commands/dbupgrade.py", line 125, in handle
    call_command(
  File "/usr/lib/python3/dist-packages/django/core/management/__init__.py", line 181, in call_command
    return command.execute(*args, **defaults)
  File "/usr/lib/python3/dist-packages/django/core/management/base.py", line 398, in execute
    output = self.handle(*args, **options)
  File "/usr/lib/python3/dist-packages/django/core/management/base.py", line 89, in wrapped
    res = handle_func(*args, **kwargs)
  File "/usr/lib/python3/dist-packages/django/core/management/commands/migrate.py", line 244, in handle
    post_migrate_state = executor.migrate(
  File "/usr/lib/python3/dist-packages/django/db/migrations/executor.py", line 117, 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 147, 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 227, in apply_migration
    state = migration.apply(state, schema_editor)
  File "/usr/lib/python3/dist-packages/django/db/migrations/migration.py", line 126, 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 190, in database_forwards
    self.code(from_state.apps, schema_editor)
  File "/home/ubuntu/maas/src/maasserver/migrations/maasserver/0290_migrate_node_power_parameters.py", line 49, in move_secrets
    for name, value in power_parameters.items():
AttributeError: 'str' object has no attribute 'items'

By adding a pdb, we can see

> /home/ubuntu/maas/src/maasserver/migrations/maasserver/0290_migrate_node_power_parameters.py(52)move_secrets()
-> for name, value in power_parameters.items():
(Pdb) power_parameters
''
(Pdb) bmc_id
6
(Pdb) power_type
'manual'
(Pdb) bmc_id
6

that for manual power driver, power_parameters is an empty string, and cannot be iterated over

Related branches

Changed in maas:
milestone: none → 3.4.0
Changed in maas:
status: New → In Progress
assignee: nobody → Adam Collard (adam-collard)
importance: Undecided → Critical
Changed in maas:
status: In Progress → Fix Committed
Alberto Donato (ack)
Changed in maas:
milestone: 3.4.0 → 3.4.0-beta1
Alberto Donato (ack)
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.