Glace return HTTPInternalServerError when use postgresql

Bug #1481154 reported by wangxiyuan
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Glance
Fix Released
Medium
wangxiyuan

Bug Description

version: master, db: postgreSQL

reproduce:

1.create one or more images without data, like:
glance image-create --name xxx or glance image-create

then we will get image information though 'glance image-list', like:

+--------------------------------------+--------------------------+-------------+------------------+---------+--------+
| ID | Name | Disk Format | Container Format | Size | Status |
+--------------------------------------+--------------------------+-------------+------------------+---------+--------+
| 67b47035-3e70-4dd0-a5a7-3fc3350a26ee | cirros-0.3.0-x86_64-disk | qcow2 | bare | 9761280 | active |
| bf8022ef-3e3a-4bef-8d13-ccea9000828f | test | | | | queued |
| 0180e9f2-6506-46c7-be07-e67ee6d5dab8 | test2 | | | | queued |
| 505bbc97-f470-44b7-bb59-315a5d92d8e0 | test3 | | | | queued |
| 03ef4387-f276-40dc-9aa6-ad811eb3c466 | test5 | | | | queued |
| 5af5d95d-8c2f-4bec-9fdd-74ce9ce3a4ca | | | | | queued |
+--------------------------------------+--------------------------+-------------+------------------+---------+--------+

2.list image like : glance image-list --sort-key=size --page-size=3 (sort-key must be 'size', and page-size must be less than or equal to image amount )

then, glance will return an error:
HTTPInternalServerError (HTTP 500)

P.S.:When use mysql db, I didn't encounter this problem.

wangxiyuan (wangxiyuan)
Changed in glance:
assignee: nobody → wangxiyuan (wangxiyuan)
wangxiyuan (wangxiyuan)
description: updated
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/208851

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

Reviewed: https://review.openstack.org/208851
Committed: https://git.openstack.org/cgit/openstack/glance/commit/?id=d13f088cac92988f3360363d9d34b60b518d18e9
Submitter: Jenkins
Branch: master

commit d13f088cac92988f3360363d9d34b60b518d18e9
Author: wangxiyuan <email address hidden>
Date: Tue Aug 4 14:35:46 2015 +0800

    Fix default value with postgreSQL

    When use 'sort-key=size' for multi-pages searching with postgreSQL
    DB, it will raise an error: DBError: (psycopg2.DataError). And return
    HTTPInternalServerError (HTTP 500) to users. The reason is that
    postgreSQL doesn't support the size's default value to be string.
    This patch set the size's default value to zero.

    Change-Id: Ib3b5f3f57be3683ba274f0122e6314978a79e75f
    Closes-bug:#1481154

Changed in glance:
status: In Progress → 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.