Bug 1022900 - Image creation returns an empty image when the size is 0 without checking if the image is external
Summary: Image creation returns an empty image when the size is 0 without checking if ...
Keywords:
Status: CLOSED UPSTREAM
Alias: None
Product: Red Hat OpenStack
Classification: Red Hat
Component: openstack-glance
Version: 4.0
Hardware: x86_64
OS: Linux
unspecified
medium
Target Milestone: ---
: 5.0 (RHEL 7)
Assignee: Flavio Percoco
QA Contact: Yogev Rabl
URL:
Whiteboard:
Depends On:
Blocks: 1070258
TreeView+ depends on / blocked
 
Reported: 2013-10-24 09:05 UTC by Haim
Modified: 2016-04-26 13:45 UTC (History)
5 users (show)

Fixed In Version: openstack-glance-2014.1-4.el7ost
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2014-06-16 08:13:30 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)
logs (1.11 MB, application/x-tar)
2013-10-24 09:09 UTC, Haim
no flags Details


Links
System ID Private Priority Status Summary Last Updated
Launchpad 1257273 0 None None None Never
OpenStack gerrit 86546 0 None None None Never
OpenStack gerrit 95656 0 None None None Never

Description Haim 2013-10-24 09:05:44 UTC
Description of problem:

trying to create an image from an HTTP backend I get the image is created but I don't see it in glance image-list or any other place. 
I also don't find anything in the logs. 

after changing Debug from False to True I see the following on api log:

2013-10-24 11:59:25.278 7727 DEBUG qpid.messaging.io.raw [-] READ[2ecb6c8]: '\x0f\x00\x00\x10\x00\x00\x00\x00\x00\x00\x00\x00\x01\x0c\x00\x00' readable /usr/lib/python2.6/site-packages/qpid/messaging/driver.py:416
2013-10-24 11:59:25.279 7727 DEBUG qpid.messaging.io.ops [-] RCVD[2ecb6c8]: ConnectionCloseOk() write /usr/lib/python2.6/site-packages/qpid/messaging/driver.py:654
2013-10-24 11:59:25.279 7727 DEBUG glance.common.client [f2edb6da-6141-4298-bd09-d12abc9a75a4 f39233dcb1d6437baa822ca0d80027e5 e549c26a26e749328a4245991e2619f1] Constructed URL: http://0.0.0.0:9191/images/559287e4-56c4-44b2-9afd-3b03a7e8ab96/members _construct_url /usr/lib/python2.6/site-packages/glance/common/client.py:408
2013-10-24 11:59:25.297 7727 DEBUG glance.registry.client.v1.client [f2edb6da-6141-4298-bd09-d12abc9a75a4 f39233dcb1d6437baa822ca0d80027e5 e549c26a26e749328a4245991e2619f1] Registry request GET /images/559287e4-56c4-44b2-9afd-3b03a7e8ab96/members HTTP 200 request id req-8c729698-54c3-421e-99c5-52de188b2387 do_request /usr/lib/python2.6/site-packages/glance/registry/client/v1/client.py:115
2013-10-24 11:59:25.298 7727 DEBUG glance.store [f2edb6da-6141-4298-bd09-d12abc9a75a4 f39233dcb1d6437baa822ca0d80027e5 e549c26a26e749328a4245991e2619f1] Skipping store.set_acls... not implemented. set_acls /usr/lib/python2.6/site-packages/glance/store/__init__.py:369

expected results:

if something is failing, user must be able to get a valid error or warning either is horizon or CLI, furthermore, we need to make sure to print something valid in the log as well. 

reproduction (make sure selinux is on):

- set a running httpd server 
- place an ISO image on the HTTP root dir 
- run glance-image create 

check logs

Comment 1 Haim 2013-10-24 09:09:37 UTC
Created attachment 815707 [details]
logs

Comment 2 Flavio Percoco 2013-10-30 11:05:42 UTC
There's no error here, the message you're seeing when setting Glance log level to Debug just tells you that the store being used does not implement set_acls method, which is totally fine since that's something store-specific and glance can still operate without that method.

`LOG.error` / `LOG.exception` is used when real errors occur and you'll find them in the logs, [0] for example.

[0] https://github.com/openstack/glance/blob/master/glance/store/__init__.py#L666

Comment 3 Haim 2013-11-02 15:08:53 UTC
(In reply to Flavio Percoco from comment #2)
> There's no error here, the message you're seeing when setting Glance log
> level to Debug just tells you that the store being used does not implement
> set_acls method, which is totally fine since that's something store-specific
> and glance can still operate without that method.
> 
> `LOG.error` / `LOG.exception` is used when real errors occur and you'll find
> them in the logs, [0] for example.
> 
> [0]
> https://github.com/openstack/glance/blob/master/glance/store/__init__.py#L666

Flavio, I think you miss-understood the bug, I know that there is no ERROR, this is why I opened a bug, the problem is that I would like to see an error or any indication that something is wrong if I commit an action and it fails.

please revise expected results again, moving back to assigned as its indeed a bug.

Comment 4 Flavio Percoco 2013-11-11 13:09:11 UTC
(In reply to Haim from comment #3)
> (In reply to Flavio Percoco from comment #2)
> > There's no error here, the message you're seeing when setting Glance log
> > level to Debug just tells you that the store being used does not implement
> > set_acls method, which is totally fine since that's something store-specific
> > and glance can still operate without that method.
> > 
> > `LOG.error` / `LOG.exception` is used when real errors occur and you'll find
> > them in the logs, [0] for example.
> > 
> > [0]
> > https://github.com/openstack/glance/blob/master/glance/store/__init__.py#L666
> 
> Flavio, I think you miss-understood the bug, I know that there is no ERROR,
> this is why I opened a bug, the problem is that I would like to see an error
> or any indication that something is wrong if I commit an action and it fails.
> 
> please revise expected results again, moving back to assigned as its indeed
> a bug.

I understood that. What I meant to say is that the reason of the failure here, if any, is unknown - or hidden somewhere - and that makes it impossible to report an actual error.

Errors are being sent back to the client when they occur. We need to find the cause of this failure - which is what #1022911 is for, isn't it? - and report that error back - or a generic one.

Again, if no error was reported is because no exception / failure occurred or it was caught and not sent back. I would rather use #1022911 to tackle this issue than having a generic bug that intends to report an error from a failure that we don't know.

Am I missing something?

Comment 5 Flavio Percoco 2013-11-26 09:51:19 UTC
Hey Haim,

In the bug report you mentioned you're using httpd. Could you re-test this taking this[0] under consideration?

[0] http://www.cberendt.de/2013/11/using-nginx-with-the-glance-api/?utm_source=rss&utm_medium=rss&utm_campaign=using-nginx-with-the-glance-api

Comment 6 Flavio Percoco 2013-12-03 09:29:21 UTC
The real bug is that glance-api returns an empty iterator when the size of the image is 0. This is an issue when the image is created with `--location` and the size of it is not provided. For example:

$ glance image-create --name Fedora17-image --disk-format=iso --container-format=bare --size 5 --is-public=True --location http://$IMAGE_HOST/Fedora-Live-Desktop-x86_64-19-1.iso

The above command will succeed and the download of the newly created image will do as well but it won't return any data.

Comment 7 Flavio Percoco 2013-12-03 22:28:02 UTC
(In reply to Flavio Percoco from comment #6)
> The real bug is that glance-api returns an empty iterator when the size of
> the image is 0. This is an issue when the image is created with `--location`
> and the size of it is not provided. For example:
> 
> $ glance image-create --name Fedora17-image --disk-format=iso
> --container-format=bare --size 5 --is-public=True --location
> http://$IMAGE_HOST/Fedora-Live-Desktop-x86_64-19-1.iso
> 

I meant:

$ glance image-create --name Fedora17-image --disk-format=iso --container-format=bare --is-public=True --location http://$IMAGE_HOST/Fedora-Live-Desktop-x86_64-19-1.iso

Without the size!


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