Keystone doesn't handle UTF8 in exceptions

Bug #1253905 reported by Jamie Lennox
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Identity (keystone)
Fix Released
High
Jamie Lennox
Havana
Fix Released
High
Jamie Lennox

Bug Description

Originally reported: https://bugzilla.redhat.com/show_bug.cgi?id=1033190

Description of problem:

[root@public-control1 ~]# keystone tenant-create --name "Consulting – Middleware Delivery"
Unable to communicate with identity service: {"error": {"message": "An unexpected error prevented the server from fulfilling your request. 'ascii' codec can't encode character u'\\u2013' in position 11: ordinal not in range(128)", "code": 500, "title": "Internal Server Error"}}. (HTTP 500)

NB: the "dash" in the name is not an ascii dash. It's something else.

Version-Release number of selected component (if applicable):

openstack-keystone-2013.1.3-2.el6ost.noarch

How reproducible:

Every

Additional info:

Performing the same command on a Folsom cloud works just fine.

Revision history for this message
Jamie Lennox (jamielennox) wrote :

If UTF8 characters are thrown in an exception that is to be propagated to the user the message building will fail resulting in a 5xx error.

description: updated
Changed in keystone:
assignee: nobody → Jamie Lennox (jamielennox)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to keystone (master)

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

Changed in keystone:
status: New → In Progress
Dolph Mathews (dolph)
Changed in keystone:
importance: Undecided → High
tags: added: havana-backport-potential
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Related fix merged to keystone (master)

Reviewed: https://review.openstack.org/57850
Committed: http://github.com/openstack/keystone/commit/edb17b677ab29a2fa93b2f1c8b75922feefdb962
Submitter: Jenkins
Branch: master

commit edb17b677ab29a2fa93b2f1c8b75922feefdb962
Author: Jamie Lennox <email address hidden>
Date: Fri Nov 22 16:47:01 2013 +1000

    Import strutils from oslo

    Handles common UTF8 encoding and decoding situations.

    Related-Bug: 1253905
    Change-Id: Ia5e743afd59f33bfc7006ff98c39e32e63733803

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

Reviewed: https://review.openstack.org/57851
Committed: http://github.com/openstack/keystone/commit/dcefe5874de3073551226c0bdd1e70f00d6a91a1
Submitter: Jenkins
Branch: master

commit dcefe5874de3073551226c0bdd1e70f00d6a91a1
Author: Jamie Lennox <email address hidden>
Date: Fri Nov 22 16:52:42 2013 +1000

    Try decoding string to UTF-8 on error message fail

    Database Errors from SQLAlchemy tend to get mangled into ASCII. If an
    error is process that contains UTF-8 data in ASCII form if fails to
    build the message and will lead to a 5xx error. Catch the error and try
    to decode it to create the message again, if that doesn't work at least
    fail gracefully.

    Change-Id: Iecb1170387c51064918780dc6de07db7ca8aeeee
    Closes-Bug: 1253905

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

Fix proposed to branch: stable/havana
Review: https://review.openstack.org/60106

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Related fix proposed to keystone (stable/havana)

Related fix proposed to branch: stable/havana
Review: https://review.openstack.org/60386

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to keystone (stable/havana)

Fix proposed to branch: stable/havana
Review: https://review.openstack.org/62264

Thierry Carrez (ttx)
Changed in keystone:
milestone: none → icehouse-2
status: Fix Committed → Fix Released
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Related fix merged to keystone (stable/havana)

Reviewed: https://review.openstack.org/60386
Committed: https://git.openstack.org/cgit/openstack/keystone/commit/?id=152eba3a915b1652c116e02d6a07bf7f32b50ce9
Submitter: Jenkins
Branch: stable/havana

commit 152eba3a915b1652c116e02d6a07bf7f32b50ce9
Author: Alan Pevec <email address hidden>
Date: Fri Dec 6 00:40:22 2013 +0100

    Import strutils from oslo

    Handles common UTF8 encoding and decoding situations.

    Related-Bug: 1253905
    Change-Id: Ia5e743afd59f33bfc7006ff98c39e32e63733803

tags: added: in-stable-havana
Alan Pevec (apevec)
tags: removed: havana-backport-potential in-stable-havana
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to keystone (stable/havana)

Reviewed: https://review.openstack.org/62264
Committed: https://git.openstack.org/cgit/openstack/keystone/commit/?id=e7d6a7f94faae205459ab41b50fcd457b6ca7345
Submitter: Jenkins
Branch: stable/havana

commit e7d6a7f94faae205459ab41b50fcd457b6ca7345
Author: Jamie Lennox <email address hidden>
Date: Fri Nov 22 16:52:42 2013 +1000

    Try decoding string to UTF-8 on error message fail

    Database Errors from SQLAlchemy tend to get mangled into ASCII. If an
    error is process that contains UTF-8 data in ASCII form if fails to
    build the message and will lead to a 5xx error. Catch the error and try
    to decode it to create the message again, if that doesn't work at least
    fail gracefully.

    Closes-Bug: 1253905
    Change-Id: Iecb1170387c51064918780dc6de07db7ca8aeeee
    (cherry picked from commit dcefe5874de3073551226c0bdd1e70f00d6a91a1)

Thierry Carrez (ttx)
Changed in keystone:
milestone: icehouse-2 → 2014.1
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.