Bug 1055550 - glance: no error reported in api.log when image create is killed on quota
Summary: glance: no error reported in api.log when image create is killed on quota
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat OpenStack
Classification: Red Hat
Component: openstack-glance
Version: 4.0
Hardware: x86_64
OS: Linux
low
medium
Target Milestone: z1
: 5.0 (RHEL 7)
Assignee: Jon Bernard
QA Contact: nlevinki
URL:
Whiteboard: storage
Depends On:
Blocks: 1141302
TreeView+ depends on / blocked
 
Reported: 2014-01-20 14:23 UTC by Dafna Ron
Modified: 2022-07-09 07:00 UTC (History)
8 users (show)

Fixed In Version: openstack-glance-2014.1.2-1.el7ost
Doc Type: Bug Fix
Doc Text:
Previously, if an image was uploaded to the Image service which exceeded the user's current quota setting, no message appeared in the glance-api log to indicate this, even though the request was rejected. This has been fixed, now there is an "INFO" message in the glance-api log that indicates that the user's "image create" command was rejected because the quota was exceeded.
Clone Of:
: 1141302 (view as bug list)
Environment:
Last Closed: 2014-09-30 17:16:16 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)
api log (664 bytes, application/x-xz)
2014-01-20 14:23 UTC, Dafna Ron
no flags Details


Links
System ID Private Priority Status Summary Last Updated
Launchpad 1270832 0 None None None Never
OpenStack gerrit 68189 0 None None None Never
Red Hat Issue Tracker OSP-16469 0 None None None 2022-07-09 07:00:55 UTC
Red Hat Product Errata RHSA-2014:1337 0 normal SHIPPED_LIVE Moderate: openstack-glance security and bug fix update 2014-09-30 21:13:47 UTC

Description Dafna Ron 2014-01-20 14:23:32 UTC
Created attachment 852761 [details]
api log

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.

Comment 1 Flavio Percoco 2014-01-21 11:08:38 UTC
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

Comment 6 Dafna Ron 2014-09-12 16:11:10 UTC
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 8 errata-xmlrpc 2014-09-30 17:16:16 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

http://rhn.redhat.com/errata/RHSA-2014-1337.html


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