Bug 1547852 - internal server error when accessing attributes of the "picture" resource
Summary: internal server error when accessing attributes of the "picture" resource
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Red Hat CloudForms Management Engine
Classification: Red Hat
Component: API
Version: 5.9.0
Hardware: Unspecified
OS: Unspecified
high
medium
Target Milestone: GA
: 5.10.0
Assignee: Gregg Tanzillo
QA Contact: Martin Kourim
URL:
Whiteboard: api:rest
Depends On:
Blocks: 1552828
TreeView+ depends on / blocked
 
Reported: 2018-02-22 06:03 UTC by Martin Kourim
Modified: 2019-02-11 14:03 UTC (History)
2 users (show)

Fixed In Version: 5.10.0.0
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
: 1552828 (view as bug list)
Environment:
Last Closed: 2019-02-11 14:03:53 UTC
Category: ---
Cloudforms Team: CFME Core
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

Description Martin Kourim 2018-02-22 06:03:01 UTC
Description of problem:
When accessing attributes "href_slug", "region_description", "region_number" and "image_href" of the "pictures" resource the request fails with internal server error:
{
    "error": {
        "kind": "internal_server_error",
        "message": "\"\\x89\" from ASCII-8BIT to UTF-8",
        "klass": "Encoding::UndefinedConversionError"
    }
}

All these attributes are listed by OPTIONS method.


Version-Release number of selected component (if applicable):
5.9.0.21
The identical requests work on 5.8.3.2


How reproducible:
100%


Steps to Reproduce:
1. create picture:
POST /api/pictures
{
	"action": "create",
	"content": "iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR42mNk+M9QDwADhgGAWjR9awAAAABJRU5ErkJggg==",
	"extension": "png"
}
2. access attribute
GET /api/pictures/8?attributes=href_slug

Comment 4 CFME Bot 2018-02-27 15:32:12 UTC
New commit detected on ManageIQ/manageiq-api/master:
https://github.com/ManageIQ/manageiq-api/commit/2ae5d7812a56bc6a71ec12fad0357aa8fa6d0d08

commit 2ae5d7812a56bc6a71ec12fad0357aa8fa6d0d08
Author:     Jillian Tullo <jtullo>
AuthorDate: Thu Feb 22 10:45:25 2018 -0500
Commit:     Jillian Tullo <jtullo>
CommitDate: Tue Feb 27 07:49:10 2018 -0500

    Allow for specifying of additional attributes for pictures
    
    Fixes https://bugzilla.redhat.com/show_bug.cgi?id=1547852

 app/controllers/api/mixins/pictures.rb     |  4 ++-
 app/controllers/api/pictures_controller.rb |  8 ++++++
 spec/requests/pictures_spec.rb             | 42 ++++++++++++++++++++++++++++++
 3 files changed, 53 insertions(+), 1 deletion(-)

Comment 7 Martin Kourim 2018-07-11 08:03:38 UTC
Verified on 5.10.0.3 using our automated tests.


Note You need to log in before you can comment on or make changes to this bug.