Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.

Bug 1141302

Summary: glance: no error reported by client when image create is killed on quota
Product: Red Hat OpenStack Reporter: Dafna Ron <dron>
Component: openstack-glanceAssignee: hguemar
Status: CLOSED UPSTREAM QA Contact: nlevinki <nlevinki>
Severity: medium Docs Contact:
Priority: low    
Version: 5.0 (RHEL 7)CC: eglynn, fpercoco, jobernar, jruzicka, nlevinki, sclewis, scohen, sgordon, sgotliv, yeylon
Target Milestone: ---Keywords: ZStream
Target Release: 6.0 (Juno)   
Hardware: x86_64   
OS: Linux   
Whiteboard: storage
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: 1055550 Environment:
Last Closed: 2015-08-25 11:57:26 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On: 1055550    
Bug Blocks:    

Description Dafna Ron 2014-09-12 16:19:39 UTC
verifying bug below we realised that the quota violation is reported in the log as INFO but user is not getting any error message. 

I am opening a bug on the client since user errors should be cough and reported by the client. 





+++ This bug was initially created as a clone of Bug #1055550 +++

Description of problem:

I set user_storage_quota = 2 in /etc/glance/glance-api.conf and tried to create an image with --copy-from:

[root@cougar07 tmp(keystone_admin)]# echo '>>>>>>>' >> /var/log/glance/api.log
[root@cougar07 tmp(keystone_admin)]# glance image-create --name dafna2 --disk-format qcow2 --container-format bare --copy-from http://download.eng.tlv.redhat.com/pub/rhel/released/RHEL-6/6.4/Appliance/rhel-workstation-x86_64-ec2-starter-6.4_20130130.0-1-sda.raw
+------------------+--------------------------------------+
| Property | Value |
+------------------+--------------------------------------+
| checksum | None |
| container_format | bare |
| created_at | 2014-01-20T13:56:13 |
| deleted | False |
| deleted_at | None |
| disk_format | qcow2 |
| id | 858ae6af-d9e1-4e24-9193-b85955aa0597 |
| is_public | False |
| min_disk | 0 |
| min_ram | 0 |
| name | dafna2 |
| owner | d4aaa7c237054d408a65f40bb4ee74d0 |
| protected | False |
| size | 6442450945 |
| status | queued |
| updated_at | 2014-01-20T13:56:13 |
+------------------+--------------------------------------+
[root@cougar07 tmp(keystone_admin)]# less /var/log/glance/api.log

there is no error logged in the glance.api log (as you can see the >>>> I added in echo before running the create command - no error related to this issue is logged).

Stderr: '/bin/sh: collie: command not found\n'
2014-01-20 13:41:25.844 7946 WARNING glance.store.base [-] Failed to configure store correctly: Store sheepdog could not be configured correctly. Reason: Error in store configuration: Unexpected error while running command.
Command: collie
Exit code: 127
Stdout: ''
Stderr: '/bin/sh: collie: command not found\n' Disabling add method.
2014-01-20 13:41:25.883 7946 WARNING glance.store.base [-] Failed to configure store correctly: Store cinder could not be configured correctly. Reason: Cinder storage requires a context. Disabling add method.
>>>>>>>

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

python-glance-2013.2.1-3.el6ost.noarch
python-glanceclient-0.12.0-1.el6ost.noarch
openstack-glance-2013.2.1-3.el6ost.noarch

How reproducible:

100%

Steps to Reproduce:
1. set user_storage_quota = 2 in /etc/glance/glance-api.conf 
2. create an image with --copy-from
3. look at the api.log or egrep image from /var/log/*/*

Actual results:

we do not have any error logged. 

Expected results:

we should have an error logged 

Additional info:

my setup is set from 4 server with a stand alone glance/cinder and 2 computes.
with glusterfs configured for cinder.

--- Additional comment from Flavio Percoco on 2014-01-21 06:08:38 EST ---

mmh, this is strange: 

@Jon FYI: you may want to look here:

API v1: https://github.com/openstack/glance/blob/master/glance/api/v1/upload_utils.py#L213


API v2 Looks like a log line is missing here:

https://github.com/openstack/glance/blob/master/glance/quota/__init__.py#L276

--- Additional comment from Dafna Ron on 2014-04-25 06:07:53 EDT ---

reopening since it was moved from post to closed upstream.

--- Additional comment from Sergey Gotliv on 2014-04-29 08:16:20 EDT ---

There is a decision to handle this bug.

--- Additional comment from Scott Lewis on 2014-08-22 09:29:53 EDT ---

Adding POST bugs to next release as potential inclusion (still need 3-acks to be included)

--- Additional comment from errata-xmlrpc on 2014-09-10 15:47:36 EDT ---

Bug report changed to ON_QA status by Errata System.
A QE request has been submitted for advisory RHBA-2014:18776-01
https://errata.devel.redhat.com/advisory/18776

--- Additional comment from Dafna Ron on 2014-09-12 12:11:10 EDT ---

The failure is now logged but it's logged as INFO: 

2014-09-12 18:54:58.921 21663 INFO glance.api.common [-] User 2bcd197108b44efe84f3c5a19d40a716 attempted to upload an image of size 6442450945 that will exceeed the quota. 2 bytes remaining.
2014-09-12 18:54:58.923 21663 INFO glance.api.v1.upload_utils [-] Denying attempt to upload image because it exceeds the .quota: The size of the data 6442450945 will exceed the limit. 2 bytes remaining.
2014-09-12 18:55:01.980 21671 INFO urllib3.connectionpool [-] Starting new HTTP connection (1): 10.35.160.123
2014-09-12 18:55:02.152 21671 INFO glance.wsgi.server [25188ae9-2a1d-4791-b6ba-23051cb90e8b 2bcd197108b44efe84f3c5a19d40a716 8f8749df409d4bbab5d982384b0d6ab0 - - -] 10.35.160.123 - - [12/Sep/2014 18:55:02] "GET /v1/images/detail?sort_key=name&sort_dir=asc&limit=20 HTTP/1.1" 200 671 0.175247


However speaking to Flavio, we do not log user errors as errors and only software errors should be logged as ERRORs.

Comment 2 Flavio Percoco 2015-01-27 08:54:55 UTC
patch landed upstream, this needs to be packaged.

Comment 5 Flavio Percoco 2015-08-25 11:57:26 UTC
Looking at this bug again, it's weird that's been filed under glanceclient since both upstream bugs were filed against Glance. Furthermore, the patch that landed fixed the issue in Glance.

Closing as UPSTREAM since this issue was fixed upstream already and it's part the code that's been released. Also, there's no need to dedicate resources to this.