← Back to team overview

yahoo-eng-team team mailing list archive

[Bug 1697881] Re: populating neutron database to sqlite db type connection

 

For example in functional tests only MySQL and PostgreSQL backends are
tested:
https://github.com/openstack/neutron/blob/master/neutron/tests/functional/db/test_migrations.py
and I remember also that some time ago Ann Taraday said me in comment to
one of my patches that we don't support sqlite as production backend:
https://review.openstack.org/#/c/338986/

** Changed in: neutron
       Status: New => Invalid

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

Title:
  populating neutron database to sqlite db type connection

Status in neutron:
  Invalid

Bug description:

  I have this issue with neutron db-manage with sqlite connection!
  Ubuntu 16.04 Server with newton openstack installation

  # su -s /bin/sh -c "neutron-db-manage --config-file /etc/neutron/neutron.conf \
    --config-file /etc/neutron/plugins/ml2/ml2_conf.ini upgrade head" neutron
  No handlers could be found for logger "oslo_config.cfg"
  INFO [alembic.runtime.migration] Context impl SQLiteImpl.
  INFO [alembic.runtime.migration] Will assume non-transactional DDL.
    Running upgrade for neutron ...
  INFO [alembic.runtime.migration] Context impl SQLiteImpl.
  INFO [alembic.runtime.migration] Will assume non-transactional DDL.
  INFO [alembic.runtime.migration] Running upgrade -> kilo, kilo_initial
  INFO [alembic.runtime.migration] Running upgrade kilo -> 354db87e3225, nsxv_vdr_metadata.py
  INFO [alembic.runtime.migration] Running upgrade 354db87e3225 -> 599c6a226151, neutrodb_ipam
  INFO [alembic.runtime.migration] Running upgrade 599c6a226151 -> 52c5312f6baf, Initial operations in support of address scopes
  INFO [alembic.runtime.migration] Running upgrade 52c5312f6baf -> 313373c0ffee, Flavor framework
  INFO [alembic.runtime.migration] Running upgrade 313373c0ffee -> 8675309a5c4f, network_rbac
  INFO [alembic.runtime.migration] Running upgrade 8675309a5c4f -> 45f955889773, quota_usage
  INFO [alembic.runtime.migration] Running upgrade 45f955889773 -> 26c371498592, subnetpool hash
  INFO [alembic.runtime.migration] Running upgrade 26c371498592 -> 1c844d1677f7, add order to dnsnameservers
  INFO [alembic.runtime.migration] Running upgrade 1c844d1677f7 -> 1b4c6e320f79, address scope support in subnetpool
  INFO [alembic.runtime.migration] Running upgrade 1b4c6e320f79 -> 48153cb5f051, qos db changes
  INFO [alembic.runtime.migration] Running upgrade 48153cb5f051 -> 9859ac9c136, quota_reservations
  INFO [alembic.runtime.migration] Running upgrade 9859ac9c136 -> 34af2b5c5a59, Add dns_name to Port
  INFO [alembic.runtime.migration] Running upgrade 34af2b5c5a59 -> 59cb5b6cf4d, Add availability zone
  INFO [alembic.runtime.migration] Running upgrade 59cb5b6cf4d -> 13cfb89f881a, add is_default to subnetpool
  /usr/lib/python2.7/dist-packages/alembic/util/messaging.py:69: UserWarning: Skipping unsupported ALTER for creation of implicit constraint
    warnings.warn(msg)
  INFO [alembic.runtime.migration] Running upgrade 13cfb89f881a -> 32e5974ada25, Add standard attribute table
  INFO [alembic.runtime.migration] Running upgrade 32e5974ada25 -> ec7fcfbf72ee, Add network availability zone
  INFO [alembic.runtime.migration] Running upgrade ec7fcfbf72ee -> dce3ec7a25c9, Add router availability zone
  INFO [alembic.runtime.migration] Running upgrade dce3ec7a25c9 -> c3a73f615e4, Add ip_version to AddressScope
  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 750, in main
      return_val |= bool(CONF.command.func(config, CONF.command.name))
    File "/usr/lib/python2.7/dist-packages/neutron/db/migration/cli.py", line 226, in do_upgrade
      desc=branch, sql=CONF.command.sql)
    File "/usr/lib/python2.7/dist-packages/neutron/db/migration/cli.py", line 127, in do_alembic_command
      getattr(alembic_command, cmd)(config, *args, **kwargs)
    File "/usr/lib/python2.7/dist-packages/alembic/command.py", line 174, in upgrade
      script.run_env()
    File "/usr/lib/python2.7/dist-packages/alembic/script/base.py", line 397, in run_env
      util.load_python_file(self.dir, 'env.py')
    File "/usr/lib/python2.7/dist-packages/alembic/util/pyfiles.py", line 81, in load_python_file
      module = load_module_py(module_id, path)
    File "/usr/lib/python2.7/dist-packages/alembic/util/compat.py", line 79, in load_module_py
      mod = imp.load_source(module_id, path, fp)
    File "/usr/lib/python2.7/dist-packages/neutron/db/migration/alembic_migrations/env.py", line 126, in <module>
      run_migrations_online()
    File "/usr/lib/python2.7/dist-packages/neutron/db/migration/alembic_migrations/env.py", line 120, in run_migrations_online
      context.run_migrations()
    File "<string>", line 8, in run_migrations
    File "/usr/lib/python2.7/dist-packages/alembic/runtime/environment.py", line 797, in run_migrations
      self.get_context().run_migrations(**kw)
    File "/usr/lib/python2.7/dist-packages/alembic/runtime/migration.py", line 312, in run_migrations
      step.migration_fn(**kw)
    File "/usr/lib/python2.7/dist-packages/neutron/db/migration/alembic_migrations/versions/mitaka/expand/c3a73f615e4_add_ip_version_to_address_scope.py", line 33, in upgrade
      sa.Column('ip_version', sa.Integer(), nullable=False))
    File "<string>", line 8, in add_column
    File "<string>", line 3, in add_column
    File "/usr/lib/python2.7/dist-packages/alembic/operations/ops.py", line 1535, in add_column
      return operations.invoke(op)
    File "/usr/lib/python2.7/dist-packages/alembic/operations/base.py", line 318, in invoke
      return fn(self, operation)
    File "/usr/lib/python2.7/dist-packages/alembic/operations/toimpl.py", line 123, in add_column
      schema=schema
    File "/usr/lib/python2.7/dist-packages/alembic/ddl/impl.py", line 172, in add_column
      self._exec(base.AddColumn(table_name, column, schema=schema))
    File "/usr/lib/python2.7/dist-packages/alembic/ddl/impl.py", line 118, in _exec
      return conn.execute(construct, *multiparams, **params)
    File "/usr/lib/python2.7/dist-packages/sqlalchemy/engine/base.py", line 914, in execute
      return meth(self, multiparams, params)
    File "/usr/lib/python2.7/dist-packages/sqlalchemy/sql/ddl.py", line 68, in _execute_on_connection
      return connection._execute_ddl(self, multiparams, params)
    File "/usr/lib/python2.7/dist-packages/sqlalchemy/engine/base.py", line 968, in _execute_ddl
      compiled
    File "/usr/lib/python2.7/dist-packages/sqlalchemy/engine/base.py", line 1146, in _execute_context
      context)
    File "/usr/lib/python2.7/dist-packages/sqlalchemy/engine/base.py", line 1337, in _handle_dbapi_exception
      util.raise_from_cause(newraise, exc_info)
    File "/usr/lib/python2.7/dist-packages/sqlalchemy/util/compat.py", line 200, in raise_from_cause
      reraise(type(exception), exception, tb=exc_tb)
    File "/usr/lib/python2.7/dist-packages/sqlalchemy/engine/base.py", line 1139, in _execute_context
      context)
    File "/usr/lib/python2.7/dist-packages/sqlalchemy/engine/default.py", line 450, in do_execute
      cursor.execute(statement, parameters)
  sqlalchemy.exc.OperationalError: (sqlite3.OperationalError) Cannot add a NOT NULL column with default value NULL [SQL: u'ALTER TABLE address_scopes ADD COLUMN ip_version INTEGER NOT NULL']

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


References