SQL error during alembic.migration when populating Neutron database on MariaDB 10.0

asked 2015-02-16 12:02:52 -0500

rohit gravatar image

I am trying to install openstack using this guide http://docs.openstack.org/juno/install-guide/install/apt/content/neutron-controller-node.html (http://docs.openstack.org/juno/instal...)

while populating database using the command

su -s /bin/sh -c "neutron-db-manage --config-file /etc/neutron/neutron.conf \
--config-file /etc/neutron/plugins/ml2/ml2_conf.ini upgrade juno" neutron

I get the following error NotImplementedError: No support for ALTER of constraints in SQLite dialect

There is a resolution here at this link https://bugs.launchpad.net/neutron/+bug/1384555 (https://bugs.launchpad.net/neutron/+b...)

However, I am finding it difficult to fix this. One of the persons in IRC suggested me to add run_as_root in my utils.execute. However, there are lot of places where utils.execute is present and I am not sure where I need to make that change. Has anyone faced similar issue?

edit retag flag offensive close merge delete

2 answers

Sort by » oldest newest most voted

answered 2015-02-16 12:54:55 -0500

Are you using Maria DB or are you using SQLite as the DB?

Can you paste your neutron.conf file , the section where you define the db connection.

edit flag offensive delete link more


http://paste.openstack.org/show/175618/ I am sorry. I don't know where it is :( Thanks!

rohit gravatar imagerohit ( 2015-02-16 20:00:51 -0500 )edit

Here is the problem:

connection = mysql://neutron:openstack@controller/neutron

connection = sqlite:////var/lib/neutron/neutron.sqlite

You have 2 connection defined!!! Comment out the sqlite connection and try again.

sfcloudman gravatar imagesfcloudman ( 2015-02-16 21:03:37 -0500 )edit

That solved the problem. Thanks a lot :)

rohit gravatar imagerohit ( 2015-02-16 21:52:14 -0500 )edit

i have the same problem... ill try this commenting out the extra connection. thanks in advance MR. sfcloudman

warlord gravatar imagewarlord ( 2015-02-21 11:37:35 -0500 )edit

answered 2018-02-16 06:06:23 -0500

krir gravatar image

Hi I'm seeing the same issue. I am using only defined one connection in the neutron.conf file.

connection = mysql://neutron:cisco123@controller/neutron

Note: initialy I tried with the below one as per the openstack docuemntation. but either of this was not working. connection = mysql+pymysql://neutron:NEUTRON_DBPASS@controller/neutron

I get the following errors. what could be the issue? could you please help me here

root@krish-UCSC-C220-M3L:/etc/nova# 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 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 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 686, 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 207, in do_upgrade desc=branch, sql=CONF.command.sql) File "/usr/lib/python2.7/dist-packages/neutron/db/migration/cli.py", line 108, 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 407, in run_env util.load_python_file(self.dir, 'env.py') File "/usr/lib/python2.7/dist-packages/alembic/util/pyfiles.py", line 93, 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 120, in <module> run_migrations_online() File "/usr/lib/python2.7/dist-packages/neutron/db/migration/alembic_migrations/env.py", line 114, 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/kilo_initial.py", line 53, in upgrade migration.pk_on_alembic_version_table() File "/usr/lib/python2.7/dist-packages/neutron/db/migration/__init__.py", line 220, in pk_on_alembic_version_table 'alembic_version', ['version_num']) File "<string>", line 8, in create_primary_key File "<string>", line 3, in create_primary_key File "/usr/lib/python2.7/dist-packages/alembic/operations/ops.py", line 265, in create_primary_key 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 135, in create_constraint operation.to_constraint(operations.migration_context) File "/usr/lib/python2.7/dist-packages/alembic/ddl/sqlite.py", line 34, in add_constraint "No support for ALTER of constraints in SQLite dialect") NotImplementedError: No support for ALTER of constraints in SQLite dialect

edit flag offensive delete link more

Get to know Ask OpenStack

Resources for moderators

Question Tools

1 follower


Asked: 2015-02-16 12:02:52 -0500

Seen: 1,340 times

Last updated: Feb 16 '15