← Back to team overview

yahoo-eng-team team mailing list archive

[Bug 1241577] Re: sqlalchemy.exc.OperationalError: (OperationalError) Cannot add a NOT NULL column with default value NULL

 

** Changed in: neutron/icehouse
       Status: Fix Committed => Fix Released

-- 
You received this bug notification because you are a member of Yahoo!
Engineering Team, which is subscribed to neutron.
https://bugs.launchpad.net/bugs/1241577

Title:
  sqlalchemy.exc.OperationalError: (OperationalError) Cannot add a NOT
  NULL column with default value NULL

Status in OpenStack Neutron (virtual network service):
  In Progress
Status in neutron icehouse series:
  Fix Released

Bug description:
  As per this piupart failure report:
  http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=726719

  there's a problem with alembic migration with SQLite.

  INFO  [alembic.migration] Context impl SQLiteImpl.
    INFO  [alembic.migration] Will assume transactional DDL.
    INFO  [alembic.migration] Running upgrade None -> folsom
    INFO  [alembic.migration] Running upgrade folsom -> 2c4af419145b
    INFO  [alembic.migration] Running upgrade 2c4af419145b -> 5a875d0e5c
    INFO  [alembic.migration] Running upgrade 5a875d0e5c -> 48b6f43f7471
    INFO  [alembic.migration] Running upgrade 48b6f43f7471 -> 3cb5d900c5de
    INFO  [alembic.migration] Running upgrade 3cb5d900c5de -> 1d76643bcec4
    INFO  [alembic.migration] Running upgrade 1d76643bcec4 -> 2a6d0b51f4bb
    INFO  [alembic.migration] Running upgrade 2a6d0b51f4bb -> 1b693c095aa3
    INFO  [alembic.migration] Running upgrade 1b693c095aa3 -> 1149d7de0cfa
    INFO  [alembic.migration] Running upgrade 1149d7de0cfa -> 49332180ca96
    INFO  [alembic.migration] Running upgrade 49332180ca96 -> 38335592a0dc
    INFO  [alembic.migration] Running upgrade 38335592a0dc -> 54c2c487e913
    INFO  [alembic.migration] Running upgrade 54c2c487e913 -> 45680af419f9
    INFO  [alembic.migration] Running upgrade 45680af419f9 -> 1c33fa3cd1a1
    INFO  [alembic.migration] Running upgrade 1c33fa3cd1a1 -> 363468ac592c
    INFO  [alembic.migration] Running upgrade 363468ac592c -> 511471cc46b
    INFO  [alembic.migration] Running upgrade 511471cc46b -> 3b54bf9e29f7
    INFO  [alembic.migration] Running upgrade 3b54bf9e29f7 -> 4692d074d587
    INFO  [alembic.migration] Running upgrade 4692d074d587 -> 1341ed32cc1e
    INFO  [alembic.migration] Running upgrade 1341ed32cc1e -> grizzly
    INFO  [alembic.migration] Running upgrade grizzly -> f489cf14a79c
    INFO  [alembic.migration] Running upgrade f489cf14a79c -> 176a85fc7d79
    INFO  [alembic.migration] Running upgrade 176a85fc7d79 -> 32b517556ec9
    INFO  [alembic.migration] Running upgrade 32b517556ec9 -> 128e042a2b68
    Traceback (most recent call last):
      File "/usr/bin/neutron-db-manage", line 10, in <module>
        sys.exit(main())
      File "/usr/lib/python2.7/dist-packages/neutron/db/migration/cli.py", line 143, in main
        CONF.command.func(config, CONF.command.name)
      File "/usr/lib/python2.7/dist-packages/neutron/db/migration/cli.py", line 80, in do_upgrade_downgrade
        do_alembic_command(config, cmd, revision, sql=CONF.command.sql)
      File "/usr/lib/python2.7/dist-packages/neutron/db/migration/cli.py", line 59, in do_alembic_command
        getattr(alembic_command, cmd)(config, *args, **kwargs)
      File "/usr/lib/python2.7/dist-packages/alembic/command.py", line 124, in upgrade
        script.run_env()
      File "/usr/lib/python2.7/dist-packages/alembic/script.py", line 191, in run_env
        util.load_python_file(self.dir, 'env.py')
      File "/usr/lib/python2.7/dist-packages/alembic/util.py", line 186, in load_python_file
        module = imp.load_source(module_id, path, open(path, 'rb'))
      File "/usr/lib/python2.7/dist-packages/neutron/db/migration/alembic_migrations/env.py", line 105, in <module>
        run_migrations_online()
      File "/usr/lib/python2.7/dist-packages/neutron/db/migration/alembic_migrations/env.py", line 89, in run_migrations_online
        options=build_options())
      File "<string>", line 7, in run_migrations
      File "/usr/lib/python2.7/dist-packages/alembic/environment.py", line 494, in run_migrations
        self.get_context().run_migrations(**kw)
      File "/usr/lib/python2.7/dist-packages/alembic/migration.py", line 211, in run_migrations
        change(**kw)
      File "/usr/lib/python2.7/dist-packages/neutron/db/migration/alembic_migrations/versions/128e042a2b68_ext_gw_mode.py", line 55, in upgrade
        nullable=False, default=True))
      File "<string>", line 7, in add_column
      File "/usr/lib/python2.7/dist-packages/alembic/operations.py", line 342, in add_column
        schema=schema
      File "/usr/lib/python2.7/dist-packages/alembic/ddl/impl.py", line 126, in add_column
        self._exec(base.AddColumn(table_name, column, schema=schema))
      File "/usr/lib/python2.7/dist-packages/alembic/ddl/impl.py", line 75, in _exec
        conn.execute(construct, *multiparams, **params)
      File "/usr/lib/python2.7/dist-packages/sqlalchemy/engine/base.py", line 662, in execute
        params)
      File "/usr/lib/python2.7/dist-packages/sqlalchemy/engine/base.py", line 720, in _execute_ddl
        compiled
      File "/usr/lib/python2.7/dist-packages/sqlalchemy/engine/base.py", line 874, in _execute_context
        context)
      File "/usr/lib/python2.7/dist-packages/sqlalchemy/engine/base.py", line 1024, in _handle_dbapi_exception
        exc_info
      File "/usr/lib/python2.7/dist-packages/sqlalchemy/util/compat.py", line 195, in raise_from_cause
        reraise(type(exception), exception, tb=exc_tb)
      File "/usr/lib/python2.7/dist-packages/sqlalchemy/engine/base.py", line 867, in _execute_context
        context)
      File "/usr/lib/python2.7/dist-packages/sqlalchemy/engine/default.py", line 324, in do_execute
        cursor.execute(statement, parameters)
    sqlalchemy.exc.OperationalError: (OperationalError) Cannot add a NOT NULL column with default value NULL u'ALTER TABLE routers ADD COLUMN enable_snat BOOLEAN NOT NULL' ()
    dpkg: error processing neutron-common (--configure):
     subprocess installed post-installation script returned error exit status 1
    Errors were encountered while processing:
     neutron-common

To manage notifications about this bug go to:
https://bugs.launchpad.net/neutron/+bug/1241577/+subscriptions