1.9 rc2: error in migration when migrating unmanaged subnet

Bug #1519247 reported by Mike Pontillo on 2015-11-24
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
MAAS
Critical
Mike Pontillo
1.9
Critical
Mike Pontillo
Trunk
Critical
Mike Pontillo

Bug Description

The following traceback was seen while migrating from MAAS 1.8.3 to MAAS 1.9 rc2:

Error in migration: maasserver:0146_populate_subnets
Traceback (most recent call last):
  File "/usr/sbin/maas-region-admin", line 68, in <module>
    main()
  File "/usr/sbin/maas-region-admin", line 64, in main
    run()
  File "/usr/sbin/maas-region-admin", line 57, in run
    management.execute_from_command_line()
  File "/usr/lib/python2.7/dist-packages/django/core/management/__init__.py", line 399, in execute_from_command_line
    utility.execute()
  File "/usr/lib/python2.7/dist-packages/django/core/management/__init__.py", line 392, in execute
    self.fetch_command(subcommand).run_from_argv(self.argv)
  File "/usr/lib/python2.7/dist-packages/django/core/management/base.py", line 242, in run_from_argv
    self.execute(*args, **options.__dict__)
  File "/usr/lib/python2.7/dist-packages/django/core/management/base.py", line 285, in execute
    output = self.handle(*args, **options)
  File "/usr/lib/python2.7/dist-packages/south/management/commands/migrate.py", line 107, in handle
    ignore_ghosts = ignore_ghosts,
  File "/usr/lib/python2.7/dist-packages/south/migration/__init__.py", line 219, in migrate_app
    success = migrator.migrate_many(target, workplan, database)
  File "/usr/lib/python2.7/dist-packages/south/migration/migrators.py", line 235, in migrate_many
    result = migrator.__class__.migrate_many(migrator, target, migrations, database)
  File "/usr/lib/python2.7/dist-packages/south/migration/migrators.py", line 310, in migrate_many
    result = self.migrate(migration, database)
  File "/usr/lib/python2.7/dist-packages/south/migration/migrators.py", line 133, in migrate
    result = self.run(migration)
  File "/usr/lib/python2.7/dist-packages/south/migration/migrators.py", line 107, in run
    return self.run_migration(migration)
  File "/usr/lib/python2.7/dist-packages/south/migration/migrators.py", line 81, in run_migration
    migration_function()
  File "/usr/lib/python2.7/dist-packages/south/migration/migrators.py", line 57, in <lambda>
    return (lambda: direction(orm))
  File "/usr/lib/python2.7/dist-packages/maasserver/migrations/0146_populate_subnets.py", line 31, in forwards
    now, NodeGroupInterface, Subnet, default_space, default_vlan)
  File "/usr/lib/python2.7/dist-packages/maasserver/models/migrations/populate_subnets_helper.py", line 120, in _migrate_nodegroupinterfaces_forward
    now, ngi, Subnet, default_space, default_vlan)
  File "/usr/lib/python2.7/dist-packages/maasserver/models/migrations/populate_subnets_helper.py", line 137, in _create_subnet_from_nodegroupinterface
    subnet.save()
  File "/usr/lib/python2.7/dist-packages/django/db/models/base.py", line 545, in save
    force_update=force_update, update_fields=update_fields)
  File "/usr/lib/python2.7/dist-packages/django/db/models/base.py", line 573, in save_base
    updated = self._save_table(raw, cls, force_insert, force_update, using, update_fields)
  File "/usr/lib/python2.7/dist-packages/django/db/models/base.py", line 654, in _save_table
    result = self._do_insert(cls._base_manager, using, fields, update_pk, raw)
  File "/usr/lib/python2.7/dist-packages/django/db/models/base.py", line 687, in _do_insert
    using=using, raw=raw)
  File "/usr/lib/python2.7/dist-packages/django/db/models/manager.py", line 232, in _insert
    return insert_query(self.model, objs, fields, **kwargs)
  File "/usr/lib/python2.7/dist-packages/django/db/models/query.py", line 1511, in insert_query
    return query.get_compiler(using=using).execute_sql(return_id)
  File "/usr/lib/python2.7/dist-packages/django/db/models/sql/compiler.py", line 897, in execute_sql
    for sql, params in self.as_sql():
  File "/usr/lib/python2.7/dist-packages/django/db/models/sql/compiler.py", line 855, in as_sql
    for obj in self.query.objs
  File "/usr/lib/python2.7/dist-packages/django/db/models/fields/__init__.py", line 350, in get_db_prep_save
    prepared=False)
  File "/usr/lib/python2.7/dist-packages/django/db/models/fields/__init__.py", line 342, in get_db_prep_value
    value = self.get_prep_value(value)
  File "/usr/lib/python2.7/dist-packages/maasserver/fields.py", line 592, in get_prep_value
    return parse_cidr(value)
  File "/usr/lib/python2.7/dist-packages/maasserver/fields.py", line 578, in parse_cidr
    return unicode(IPNetwork(value).cidr)
  File "/usr/lib/python2.7/dist-packages/netaddr/ip/__init__.py", line 907, in __init__
    implicit_prefix, flags)
  File "/usr/lib/python2.7/dist-packages/netaddr/ip/__init__.py", line 802, in parse_ip_network
    raise TypeError('unexpected type %s for addr arg' % type(addr))
TypeError: unexpected type <type 'NoneType'> for addr arg

Related branches

Mike Pontillo (mpontillo) wrote :

Here's an easier to read traceback:

http://paste.ubuntu.com/13490388/

Changed in maas:
assignee: nobody → Mike Pontillo (mpontillo)
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers