97ac978118c6_nsp_fix_constraints fails on postgresql

Bug #1592824 reported by Ralf Haferkamp
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Group Based Policy
Fix Released
Critical
Ralf Haferkamp

Bug Description

Running "gbp-db-manage --config-file /etc/neutron/neutron.conf upgrade head" on a system using postgresql for the database currently fails in "97ac978118c6_nsp_fix_constraints.py" with this error:

Traceback (most recent call last):
  File "/usr/bin/gbp-db-manage", line 10, in <module>
    sys.exit(main())
  File "/usr/lib/python2.7/site-packages/gbpservice/neutron/db/migration/cli.py", line 24, in main
    CONF.command.func(config, CONF.command.name)
  File "/usr/lib/python2.7/site-packages/neutron/db/migration/cli.py", line 201, in do_upgrade
    desc=branch, sql=CONF.command.sql)
  File "/usr/lib/python2.7/site-packages/neutron/db/migration/cli.py", line 108, in do_alembic_command
    getattr(alembic_command, cmd)(config, *args, **kwargs)
  File "/usr/lib/python2.7/site-packages/alembic/command.py", line 174, in upgrade
    script.run_env()
  File "/usr/lib/python2.7/site-packages/alembic/script/base.py", line 397, in run_env
    util.load_python_file(self.dir, 'env.py')
  File "/usr/lib/python2.7/site-packages/alembic/util/pyfiles.py", line 81, in load_python_file
    module = load_module_py(module_id, path)
  File "/usr/lib/python2.7/site-packages/alembic/util/compat.py", line 79, in load_module_py
    mod = imp.load_source(module_id, path, fp)
  File "/usr/lib/python2.7/site-packages/gbpservice/neutron/db/migration/alembic_migrations/env.py", line 89, in <module>
    run_migrations_online()
  File "/usr/lib/python2.7/site-packages/gbpservice/neutron/db/migration/alembic_migrations/env.py", line 80, in run_migrations_online
    context.run_migrations()
  File "<string>", line 8, in run_migrations
  File "/usr/lib/python2.7/site-packages/alembic/runtime/environment.py", line 797, in run_migrations
    self.get_context().run_migrations(**kw)
  File "/usr/lib/python2.7/site-packages/alembic/runtime/migration.py", line 312, in run_migrations
    step.migration_fn(**kw)
  File "/usr/lib/python2.7/site-packages/gbpservice/neutron/db/migration/alembic_migrations/versions/97ac978118c6_nsp_fix_constraints.py", line 55, in upgrade
    type_='primary')
  File "<string>", line 8, in drop_constraint
  File "<string>", line 3, in drop_constraint
  File "/usr/lib/python2.7/site-packages/alembic/operations/ops.py", line 145, in drop_constraint
    return operations.invoke(op)
  File "/usr/lib/python2.7/site-packages/alembic/operations/base.py", line 318, in invoke
    return fn(self, operation)
  File "/usr/lib/python2.7/site-packages/alembic/operations/toimpl.py", line 146, in drop_constraint
    schema=operation.schema,
  File "/usr/lib/python2.7/site-packages/alembic/ddl/impl.py", line 183, in drop_constraint
    self._exec(schema.DropConstraint(const))
  File "/usr/lib/python2.7/site-packages/alembic/ddl/impl.py", line 118, in _exec
    return conn.execute(construct, *multiparams, **params)
  File "/usr/lib64/python2.7/site-packages/sqlalchemy/engine/base.py", line 914, in execute
    return meth(self, multiparams, params)
  File "/usr/lib64/python2.7/site-packages/sqlalchemy/sql/ddl.py", line 68, in _execute_on_connection
    return connection._execute_ddl(self, multiparams, params)
  File "/usr/lib64/python2.7/site-packages/sqlalchemy/engine/base.py", line 962, in _execute_ddl
    compiled = ddl.compile(dialect=dialect)
  File "<string>", line 1, in <lambda>
  File "/usr/lib64/python2.7/site-packages/sqlalchemy/sql/elements.py", line 494, in compile
    return self._compiler(dialect, bind=bind, **kw)
  File "/usr/lib64/python2.7/site-packages/sqlalchemy/sql/ddl.py", line 26, in _compiler
    return dialect.ddl_compiler(dialect, self, **kw)
  File "/usr/lib64/python2.7/site-packages/sqlalchemy/sql/compiler.py", line 190, in __init__
    self.string = self.process(self.statement, **compile_kwargs)
  File "/usr/lib64/python2.7/site-packages/sqlalchemy/sql/compiler.py", line 213, in process
    return obj._compiler_dispatch(self, **kwargs)
  File "/usr/lib64/python2.7/site-packages/sqlalchemy/ext/compiler.py", line 413, in <lambda>
    lambda *arg, **kw: existing(*arg, **kw))
  File "/usr/lib64/python2.7/site-packages/sqlalchemy/ext/compiler.py", line 451, in __call__
    return fn(element, compiler, **kw)
  File "/usr/lib64/python2.7/site-packages/sqlalchemy/sql/visitors.py", line 81, in _compiler_dispatch
    return meth(self, **kw)
  File "/usr/lib64/python2.7/site-packages/sqlalchemy/sql/compiler.py", line 2325, in visit_drop_constraint
    "it has no name" % drop.element)
sqlalchemy.exc.CompileError: Can't emit DROP CONSTRAINT for constraint PrimaryKeyConstraint(); it has no name

Revision history for this message
Sumit Naiksatam (snaiksat) wrote :

Could you indicate which release of GBP and version of PostgreSQL you are using?

Changed in group-based-policy:
status: New → Incomplete
Revision history for this message
Sumit Naiksatam (snaiksat) wrote :

Sorry, I did not notice that you already posted a patch for this. Thanks!

Changed in group-based-policy:
status: Incomplete → Confirmed
importance: Undecided → Critical
assignee: nobody → Ralf Haferkamp (rhafer)
milestone: none → next
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to group-based-policy (master)

Reviewed: https://review.openstack.org/329936
Committed: https://git.openstack.org/cgit/openstack/group-based-policy/commit/?id=13fb0b7549d8041dcc8d5532ed1377d9ba8a6238
Submitter: Jenkins
Branch: master

commit 13fb0b7549d8041dcc8d5532ed1377d9ba8a6238
Author: Ralf Haferkamp <email address hidden>
Date: Wed Jun 15 15:26:01 2016 +0200

    Fix unnamed contraints removal for postgresql

    Change-Id: Iddfcff965f67e637157e929614ca9ac48ffa7681
    Closes-Bug: #1592824

Changed in group-based-policy:
status: Confirmed → Fix Released
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to group-based-policy (stable/mitaka)

Fix proposed to branch: stable/mitaka
Review: https://review.openstack.org/330141

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to group-based-policy (stable/liberty)

Fix proposed to branch: stable/liberty
Review: https://review.openstack.org/330143

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to group-based-policy (stable/kilo)

Fix proposed to branch: stable/kilo
Review: https://review.openstack.org/330144

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to group-based-policy (stable/kilo)

Reviewed: https://review.openstack.org/330144
Committed: https://git.openstack.org/cgit/openstack/group-based-policy/commit/?id=85c9ffa40414c8d6c1f9b34f3befe3b71b3917c2
Submitter: Jenkins
Branch: stable/kilo

commit 85c9ffa40414c8d6c1f9b34f3befe3b71b3917c2
Author: Ralf Haferkamp <email address hidden>
Date: Wed Jun 15 15:26:01 2016 +0200

    Fix unnamed contraints removal for postgresql

    Change-Id: Iddfcff965f67e637157e929614ca9ac48ffa7681
    Closes-Bug: #1592824
    (cherry picked from commit 13fb0b7549d8041dcc8d5532ed1377d9ba8a6238)

tags: added: in-stable-kilo
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to group-based-policy (stable/mitaka)

Reviewed: https://review.openstack.org/330141
Committed: https://git.openstack.org/cgit/openstack/group-based-policy/commit/?id=5bdfc496531a00e3e3be7a335a49a193090f4a31
Submitter: Jenkins
Branch: stable/mitaka

commit 5bdfc496531a00e3e3be7a335a49a193090f4a31
Author: Ralf Haferkamp <email address hidden>
Date: Wed Jun 15 15:26:01 2016 +0200

    Fix unnamed contraints removal for postgresql

    Change-Id: Iddfcff965f67e637157e929614ca9ac48ffa7681
    Closes-Bug: #1592824
    (cherry picked from commit 13fb0b7549d8041dcc8d5532ed1377d9ba8a6238)

tags: added: in-stable-mitaka
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to group-based-policy (stable/liberty)

Reviewed: https://review.openstack.org/330143
Committed: https://git.openstack.org/cgit/openstack/group-based-policy/commit/?id=e68a1bf533591882016705fbc748cb3f456643bf
Submitter: Jenkins
Branch: stable/liberty

commit e68a1bf533591882016705fbc748cb3f456643bf
Author: Ralf Haferkamp <email address hidden>
Date: Wed Jun 15 15:26:01 2016 +0200

    Fix unnamed contraints removal for postgresql

    Change-Id: Iddfcff965f67e637157e929614ca9ac48ffa7681
    Closes-Bug: #1592824
    (cherry picked from commit 13fb0b7549d8041dcc8d5532ed1377d9ba8a6238)

tags: added: in-stable-liberty
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.