Images: 256 character limit isn't accurate for create image

Bug #1418061 reported by Nikunj Aggarwal
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Glance
Opinion
Undecided
Unassigned
OpenStack Dashboard (Horizon)
Fix Released
Undecided
Nikunj Aggarwal

Bug Description

The 256 characters limit for Images doesn't seem quite accurate. If you try to set up a long name with special characters (less than 256 characters, but more than 256 bytes?) it fails.

A user reported:

1. Create a image and the name of the image should be more than 256 bytes. For example: を引き続きご使用になるお客様はを引き続きご使用になるお客様はを引き続きご使用になるお客様はを引き続きご使用になるお客様はを引き続きご使用になるお客様はを引き続きご使用になるお客様はを引き続きご使用になるお客様はを引き続きご使用になるお客様はを引き続きご使用になるお客様は

2. Horizon fails with a generic error.

But actually it is the same with e.g. just creating a new image (The error returned is the generic: "Unable to create new image. ")

We see this in the logs:

[Tue Jan 20 16:40:45.594430 2015] [:error] [pid 17230] Recoverable error: <html>
[Tue Jan 20 16:40:45.594454 2015] [:error] [pid 17230] <head>
[Tue Jan 20 16:40:45.594458 2015] [:error] [pid 17230] <title>400 Bad Request</title>
[Tue Jan 20 16:40:45.594460 2015] [:error] [pid 17230] </head>
[Tue Jan 20 16:40:45.594462 2015] [:error] [pid 17230] <body>
[Tue Jan 20 16:40:45.594465 2015] [:error] [pid 17230] <h1>400 Bad Request</h1>
[Tue Jan 20 16:40:45.594467 2015] [:error] [pid 17230] Image name too long: 405<br /><br />
[Tue Jan 20 16:40:45.594469 2015] [:error] [pid 17230]
[Tue Jan 20 16:40:45.594472 2015] [:error] [pid 17230] </body>
[Tue Jan 20 16:40:45.594474 2015] [:error] [pid 17230] </html> (HTTP 400)

So Glance does return a more meaningful error, that we should try to present to the user.

Changed in horizon:
assignee: nobody → Nikunj Aggarwal (nikunj2512)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to horizon (master)

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

Changed in horizon:
status: New → In Progress
Revision history for this message
Travis Tripp (travis-tripp) wrote :

Just adding to glance team for evaluation since the error is reported out of the service response to horizon.

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

Reviewed: https://review.openstack.org/152927
Committed: https://git.openstack.org/cgit/openstack/horizon/commit/?id=3ff278d4eedac60eb0310f0c78f0c7eab6ee18c9
Submitter: Jenkins
Branch: master

commit 3ff278d4eedac60eb0310f0c78f0c7eab6ee18c9
Author: nikunj2512 <email address hidden>
Date: Wed Feb 4 20:09:18 2015 +0530

    Fixes Error message during image upload due to long name

    While uploading an image, if you give a name which is less than 256
    characters but more than 256 bytes, horizon gives a generic error
    but glance gives meaningful error-> "Image name too long" but it
    doesn't propagate to the horizon. So, this patch fixes this issue.

    Change-Id: I1bfe0056e3bc052e04b04db69a62251c1ac4cce7
    Closes-bug: #1418061

Changed in horizon:
status: In Progress → Fix Committed
Thierry Carrez (ttx)
Changed in horizon:
milestone: none → kilo-3
status: Fix Committed → Fix Released
Thierry Carrez (ttx)
Changed in horizon:
milestone: kilo-3 → 2015.1.0
Changed in glance:
status: New → Fix Committed
status: Fix Committed → Opinion
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.