list-tasks call 500s with postgresql

Bug #1749297 reported by Brian Rosmaita
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Glance
Fix Released
High
Brian Rosmaita

Bug Description

Seeing this in the log when doing a list-tasks call with postgresql database:

ERROR oslo_db.sqlalchemy.exc_filters [None req-6db7b718-f2db-4bea-a962-9d24f632bbfa admin admin] DBAPIError exception wrapped from (psycopg2.ProgrammingError) operator does not exist: boolean = integer
LINE 1: ...66a90b2900405587821d90703fb926' AND tasks.deleted = 0 AND ta...
                                                             ^
HINT: No operator matches the given name and argument type(s). You might need to add explicit type casts.
[SQL: 'UPDATE tasks SET updated_at=%(updated_at)s, deleted_at=%(deleted_at)s, deleted=%(deleted)s WHERE tasks.owner = %(owner_1)s AND tasks.deleted = %(deleted_1)s AND tasks.expires_at <= %(expires_at_1)s'] [parameters: {'expires_at_1': datetime.datetime(2018, 2, 13, 14, 42, 18, 419244), 'deleted': True, 'updated_at': datetime.datetime(2018, 2, 13, 14, 42, 18, 422231), 'deleted_1': 0, 'owner_1': u'6b66a90b2900405587821d90703fb926', 'deleted_at': datetime.datetime(2018, 2, 13, 14, 42, 18, 419449)}] (Background on this error at: http://sqlalche.me/e/f405): ProgrammingError: operator does not exist: boolean = integer

Looked at this with Scott McClymont, traced it back to Change-Id: I0bde982de948901f6bfbfab9e57cf84891c22052 that introduced the opportunistic soft-delete functionality into the image-list call; it uses 0 and 1 instead of boolean values. MySQL doesn't care, but PostgreSQL is more picky.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to glance (master)

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

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

Reviewed: https://review.openstack.org/544105
Committed: https://git.openstack.org/cgit/openstack/glance/commit/?id=bac4595e08c23859345e8c80af8db5dd36c269b9
Submitter: Zuul
Branch: master

commit bac4595e08c23859345e8c80af8db5dd36c269b9
Author: Brian Rosmaita <email address hidden>
Date: Tue Feb 13 16:42:51 2018 -0500

    Use bool instead of int for boolean filter value

    At this layer, it's a boolean filter; we should let the ORM
    make the translation for whatever backend is in use. MySQL
    didn't care, but PostgreSQL is a bit more picky.

    Co-authored-by: Scott McClymont <email address hidden>
    Co-authored-by: Brian Rosmaita <email address hidden>

    Change-Id: Id1e5d2cec3be48f6a5164582591f2fd2f565a96b
    Closes-bug: #1749297

Changed in glance:
status: In Progress → Fix Released
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to glance (stable/queens)

Fix proposed to branch: stable/queens
Review: https://review.openstack.org/544713

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to glance (stable/queens)

Reviewed: https://review.openstack.org/544713
Committed: https://git.openstack.org/cgit/openstack/glance/commit/?id=5501f905ac9f457bc7e14badf99e84f696712d20
Submitter: Zuul
Branch: stable/queens

commit 5501f905ac9f457bc7e14badf99e84f696712d20
Author: Brian Rosmaita <email address hidden>
Date: Tue Feb 13 16:42:51 2018 -0500

    Use bool instead of int for boolean filter value

    At this layer, it's a boolean filter; we should let the ORM
    make the translation for whatever backend is in use. MySQL
    didn't care, but PostgreSQL is a bit more picky.

    Co-authored-by: Scott McClymont <email address hidden>
    Co-authored-by: Brian Rosmaita <email address hidden>

    Change-Id: Id1e5d2cec3be48f6a5164582591f2fd2f565a96b
    Closes-bug: #1749297
    (cherry picked from commit bac4595e08c23859345e8c80af8db5dd36c269b9)

tags: added: in-stable-queens
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/glance 16.0.0.0rc2

This issue was fixed in the openstack/glance 16.0.0.0rc2 release candidate.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/glance 17.0.0.0b1

This issue was fixed in the openstack/glance 17.0.0.0b1 development milestone.

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.