[Glance] Non-informative message when image-create with incorrect md5sum

Bug #1452712 reported by Kairat Kushaev
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Mirantis OpenStack
Fix Released
High
Mike Fedosin
6.1.x
Won't Fix
High
Unassigned
7.0.x
Fix Released
High
Mike Fedosin

Bug Description

When I am trying to create an image and provides incorrect md5sum for checking I got 500 error. There is no information about error and no reference how can I solve it.
Steps to reproduce:
1. Create an image
glance image-create --file path --container_format bare --disk-format qcow2 --checksum ca0b493e7b0b0a98ba10c0234d688921092a108378c877e60e60969dee83bc3a
where

path - path to downloaded file http://download.fedoraproject.org/pub/fedora/linux/releases/21/Cloud/Images/i386/Fedora-Cloud-Base-20141203-21.i386.qcow2

I also used checksum value from this file:
https://getfedora.org/en/static/checksums/Fedora-Cloud-Images-i386-21-CHECKSUM

AR: 500 Error
ER: Some informative message about error. F.e. "Checksum is incorrect. Please provide correct checksum."

Tags: glance
Changed in mos:
status: New → Confirmed
importance: Undecided → Medium
importance: Medium → High
description: updated
Revision history for this message
Inessa Vasilevskaya (ivasilevskaya) wrote :

I was unable to reproduce it on devstack, though it is reproducible on mos6.1 lab by running

glance image-create --disk-format qcow2 --container-format bare --name my_image_500 --file my_images/Fedora-Cloud-Base-20141203-21.i386.qcow2 --checksum 497cedc18834e01007f1e3fb05e56cc7c8fc8298ad4aeb0b1e8b2142868bae3c

Revision history for this message
Inessa Vasilevskaya (ivasilevskaya) wrote :

Hm, it's really interesting. So far I managed to find out that the bug is observed when the checksum passed as --checksum parameter is longer than 32 characters.

glance image-create --disk-format raw --container-format bare --name 500_my_image_500 --file ceph.conf --checksum `printf '%*s' 33 | tr ' ' 'x'`

will raise 500 InternalServerError

while

glance image-create --disk-format raw --container-format bare --name 500_my_image_500 --file ceph.conf --checksum `printf '%*s' 32 | tr ' ' 'x'`

will raise typical 400 BadRequest.

Revision history for this message
Inessa Vasilevskaya (ivasilevskaya) wrote :

The 2^5 hint worked like a charm:

  File "/usr/lib64/python2.6/site-packages/sqlalchemy/engine/base.py", line 1156, in _handle_dbapi_exception
    util.raise_from_cause(newraise, exc_info)
  File "/usr/lib64/python2.6/site-packages/sqlalchemy/util/compat.py", line 199, in raise_from_cause
    reraise(type(exception), exception, tb=exc_tb)
  File "/usr/lib64/python2.6/site-packages/sqlalchemy/engine/base.py", line 951, in _execute_context
    context)
  File "/usr/lib64/python2.6/site-packages/sqlalchemy/engine/default.py", line 436, in do_execute
    cursor.execute(statement, parameters)
  File "/usr/lib64/python2.6/site-packages/MySQLdb/cursors.py", line 205, in execute
    self.errorhandler(self, exc, value)
  File "/usr/lib64/python2.6/site-packages/MySQLdb/connections.py", line 36, in defaulterrorhandler
    raise errorclass, errorvalue
DBError: (DataError) (1406, "Data too long for column 'checksum' at row 1") 'INSERT INTO images (created_at, updated_at, deleted_at, deleted, id, name, disk_format, container_format, size, virtual_size, status, is_public, checksum, min_disk, min_ram, owner, protected) VALUES (%s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s)' (datetime.datetime(2015, 5, 7, 15, 19, 46, 181201), datetime.datetime(2015, 5, 7, 15, 19, 46, 181288), None, 0, '6beaf295-e28c-413a-83d9-67a16a6344b5', '500_my_image_500', 'raw', 'bare', 717, None, 'queued', 0, 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx', 0, 0, '57429b8d10aa4438a76428c76c20455e', 0)
2015-05-07 15:19:46.408 30131 INFO glance.wsgi.server [f8a812a3-29b9-4d8d-946a-30dca69c8027 62c3712137e44ccd9dc1ed53a8575a16 57429b8d10aa4438a76428c76c20455e - - -] 192.168.0.2 - - [07/May/2015 15:19:46] "POST /images HTTP/1.1" 500 139 1.382551

Changed in mos:
assignee: MOS Glance (mos-glance) → Inessa Vasilevskaya (ivasilevskaya)
ruhe (ruhe)
summary: - Non-informative message when image-create with incorrect md5sum
+ [Glance] Non-informative message when image-create with incorrect md5sum
Revision history for this message
Fuel Devops McRobotson (fuel-devops-robot) wrote : Fix proposed to openstack/glance (openstack-ci/fuel-6.1/2014.2)

Fix proposed to branch: openstack-ci/fuel-6.1/2014.2
Change author: Inessa Vasilevskaya <email address hidden>
Review: https://review.fuel-infra.org/6483

Revision history for this message
ruhe (ruhe) wrote :

We reached HCF. Thus marking this bug as won't fix in 6.1

Changed in mos:
importance: High → Medium
status: Confirmed → Won't Fix
importance: Medium → High
Revision history for this message
Mike Fedosin (mfedosin) wrote :

Upstream commit is merged in Liberty: https://review.openstack.org/#/c/182703/

ruhe (ruhe)
tags: added: glance
Revision history for this message
Mike Fedosin (mfedosin) wrote :
Revision history for this message
Alexey Galkin (agalkin) wrote :

Tested on MOS 7.0 in ISO #228.

Revision history for this message
Fuel Devops McRobotson (fuel-devops-robot) wrote : Change abandoned on openstack/glance (openstack-ci/fuel-6.1/2014.2)

Change abandoned by Ruslan Kamaldinov <email address hidden> on branch: openstack-ci/fuel-6.1/2014.2
Review: https://review.fuel-infra.org/6483

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.