Postgre does not work as a backend with congress

Bug #1394319 reported by Aaron Rosen
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
congress
Fix Released
Undecided
Armando Migliaccio

Bug Description

http://logs2.aaronorosen.com/71/135471/2/check/dsvm-tempest-full-congress-pg/efde7db/logs/screen-congress.txt.gz#_2014-11-18_18_16_21_716

2014-11-18 18:16:21.716 804 DEBUG congress.dse.deepsix [-] d6cage:: updateRoutes msgbody: {'keys': ['allservices', 'local.allservices']} log_debug /opt/stack/new/congress/congress/dse/deepsix.py:563
2014-11-18 18:16:21.729 804 ERROR oslo.db.sqlalchemy.exc_filters [-] DBAPIError exception wrapped from (ProgrammingError) operator does not exist: character varying = integer
LINE 3: ...olicy_rules.policy_name IS NULL AND policy_rules.deleted = 0
                                                                    ^
HINT: No operator matches the given name and argument type(s). You might need to add explicit type casts.
 'SELECT policy_rules.id AS policy_rules_id, policy_rules.created_at AS policy_rules_created_at, policy_rules.updated_at AS policy_rules_updated_at, policy_rules.deleted_at AS policy_rules_deleted_at, policy_rules.deleted AS policy_rules_deleted, policy_rules.rule AS policy_rules_rule, policy_rules.policy_name AS policy_rules_policy_name, policy_rules.comment AS policy_rules_comment \nFROM policy_rules \nWHERE policy_rules.policy_name IS NULL AND policy_rules.deleted = %(deleted_1)s' {'deleted_1': 0}
2014-11-18 18:16:21.729 804 TRACE oslo.db.sqlalchemy.exc_filters Traceback (most recent call last):
2014-11-18 18:16:21.729 804 TRACE oslo.db.sqlalchemy.exc_filters File "/usr/local/lib/python2.7/dist-packages/oslo/db/sqlalchemy/compat/handle_error.py", line 59, in _handle_dbapi_exception
2014-11-18 18:16:21.729 804 TRACE oslo.db.sqlalchemy.exc_filters e, statement, parameters, cursor, context)
2014-11-18 18:16:21.729 804 TRACE oslo.db.sqlalchemy.exc_filters File "/usr/lib/python2.7/dist-packages/sqlalchemy/engine/base.py", line 1024, in _handle_dbapi_exception
2014-11-18 18:16:21.729 804 TRACE oslo.db.sqlalchemy.exc_filters exc_info
2014-11-18 18:16:21.729 804 TRACE oslo.db.sqlalchemy.exc_filters File "/usr/lib/python2.7/dist-packages/sqlalchemy/util/compat.py", line 196, in raise_from_cause
2014-11-18 18:16:21.729 804 TRACE oslo.db.sqlalchemy.exc_filters reraise(type(exception), exception, tb=exc_tb)
2014-11-18 18:16:21.729 804 TRACE oslo.db.sqlalchemy.exc_filters File "/usr/lib/python2.7/dist-packages/sqlalchemy/engine/base.py", line 867, in _execute_context
2014-11-18 18:16:21.729 804 TRACE oslo.db.sqlalchemy.exc_filters context)
2014-11-18 18:16:21.729 804 TRACE oslo.db.sqlalchemy.exc_filters File "/usr/lib/python2.7/dist-packages/sqlalchemy/engine/default.py", line 324, in do_execute
2014-11-18 18:16:21.729 804 TRACE oslo.db.sqlalchemy.exc_filters cursor.execute(statement, parameters)
2014-11-18 18:16:21.729 804 TRACE oslo.db.sqlalchemy.exc_filters ProgrammingError: (ProgrammingError) operator does not exist: character varying = integer
2014-11-18 18:16:21.729 804 TRACE oslo.db.sqlalchemy.exc_filters LINE 3: ...olicy_rules.policy_name IS NULL AND policy_rules.deleted = 0
2014-11-18 18:16:21.729 804 TRACE oslo.db.sqlalchemy.exc_filters ^
2014-11-18 18:16:21.729 804 TRACE oslo.db.sqlalchemy.exc_filters HINT: No operator matches the given name and argument type(s). You might need to add explicit type casts.
2014-11-18 18:16:21.729 804 TRACE oslo.db.sqlalchemy.exc_filters 'SELECT policy_rules.id AS policy_rules_id, policy_rules.created_at AS policy_rules_created_at, policy_rules.updated_at AS policy_rules_updated_at, policy_rules.deleted_at AS policy_rules_deleted_at, policy_rules.deleted AS policy_rules_deleted, policy_rules.rule AS policy_rules_rule, policy_rules.policy_name AS policy_rules_policy_name, policy_rules.comment AS policy_rules_comment \nFROM policy_rules \nWHERE policy_rules.policy_name IS NULL AND policy_rules.deleted = %(deleted_1)s' {'deleted_1': 0}
2014-11-18 18:16:21.729 804 TRACE oslo.db.sqlalchemy.exc_filters
2014-11-18 18:16:21.781 804 DEBUG congress.service [-] (ProgrammingError) operator does not exist: character varying = integer

I think we need to do something like this: https://review.openstack.org/#/c/135485/

Aaron Rosen (arosen)
Changed in congress:
assignee: nobody → Armando Migliaccio (armando-migliaccio)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to congress (master)

Fix proposed to branch: master
Review: https://review.openstack.org/136206

Changed in congress:
status: New → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to congress (master)

Reviewed: https://review.openstack.org/136206
Committed: https://git.openstack.org/cgit/stackforge/congress/commit/?id=745fca199460d0c5a5a2ef49e08a78dde9367910
Submitter: Jenkins
Branch: master

commit 745fca199460d0c5a5a2ef49e08a78dde9367910
Author: armando-migliaccio <email address hidden>
Date: Thu Nov 20 15:20:55 2014 -0800

    Fix Postgres support for Congress

    This patch fixes the use of the deleted column for the PolicyRule.

    Even though the 'deleted' attribute for the DB model is a literal,
    the flag being passed around is a boolean. This causes a mismatch
    between the conceptual model and the logical schema that may lead
    to errors depending on the actual DB backend. For instance MySql
    is fine, but Postgres is not.

    Furthermore, soft deletes were also not represented correctly during
    the initialization of the policy rule, as when a rule is soft deleted,
    the deleted literal is a representation of the entity's uuid, rather
    than a simple bool.

    This patch also makes sure that from a DB schema migration, the
    right defaults are captured.

    Finally, the db module has been extended to allow the retrieval
    of soft deleted rules, as a future-proofing measure.

    Closes-bug: #1394319

    Change-Id: Ifce2506d95b68ef168d53f7f5977734f378c43df

Changed in congress:
status: In Progress → Fix Committed
Tim Hinrichs (thinrichs)
Changed in congress:
milestone: none → kilo-3
status: Fix Committed → Fix Released
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.