Unable to upload image to glance

Bug #1398495 reported by Rob Mengert
12
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Glance
Incomplete
Undecided
Unassigned

Bug Description

Hello everyone. Details of the problem experienced have been documented at the link below. I'm not sure if this is an error with Glance or with Keystone.

https://ask.openstack.org/en/questions/54963/edit/

I installed and configured glance as per the install instructions on the OpenStack website and received the following error when attempting to upload a cirros image:

    [root@controller]# source ~/openstack-tools/admin-openrc.sh
    [root@controller]# glance image-create --name "cirros-0.3.3-x86_64" --file cirros-0.3.3-x86_64-disk.img --disk-format qcow2 --container-format bare --is-public True --progress
    [=============================>] 100%
    Request returned failure status.
    Invalid OpenStack Identity credentials.

Keystone Logs:

    2014-12-02 07:52:16.300 11159 INFO eventlet.wsgi.server [-] 192.168.122.11 - - [02/Dec/2014 07:52:16] "POST /v2.0/tokens HTTP/1.1" 200 1250 0.084692
    127.0.0.1 - - [02/Dec/2014 07:52:16] code 400, message Bad request version ('b\x00\x00\x82\xc00\xc0,\xc0(\xc0$\xc0\x14\xc0')
    127.0.0.1 - - [02/Dec/2014 07:52:16] "^V^C^A^A^\^A^@^A^X^C^C<DA>^M<FA><91><92>`^V<94><97>^Z^TPߕ<B9><A4><A8>^E<D3>G;<FA><AC>5^X"<9B><88> b^@^@<82><C0>0<C0>,<C0>(
    <C0>$<C0>^T<C0>" 400 -
    127.0.0.1 - - [02/Dec/2014 07:52:16] code 400, message Bad request syntax ('\x16\x03\x01\x01\x1c\x01\x00\x01\x18\x03\x03\xc7\xc2s\xdb\x97w\x94t\x84\xa4\xca.\x9c\x18\xa9\xd7\xd1\xf2\x94\xfb\xad\x1c\x04\xbc\x07\xcf!\xda5Z.\xa7\x00\x00\x82\xc00\xc0,\xc0(\xc0$\xc0\x14\xc0')
    127.0.0.1 - - [02/Dec/2014 07:52:16] "^V^C^A^A^\^A^@^A^X^C^C<C7><C2>sۗw<94>t<84><A4><CA>.<9C>^X<A9><D7><D1><F2><94><FB><AD>^\^D<BC>^G<CF>!<DA>5Z.<A7>^@^@<82><C0>0
    <C0>,<C0>(<C0>$<C0>^T<C0>" 400 -
    127.0.0.1 - - [02/Dec/2014 07:52:17] code 400, message Bad HTTP/0.9 request type ('\x16\x03\x01\x01\x1c\x01\x00\x01\x18\x03\x03\xdf\xa1\x88\xb5)\x95\xd8L')
    127.0.0.1 - - [02/Dec/2014 07:52:17] "^V^C^A^A^\^A^@^A^X^C^Cߡ<88><B5>)<95><D8>L 0<8E><B6>ܬqK<98><90><D8>^N<DF>F<CA>ܯ岼E|<B8>B^@^@<82><C0>0<C0>,<C0>(<C0>$<C0>^T
    <C0>" 400 -
    127.0.0.1 - - [02/Dec/2014 07:52:19] code 400, message Bad request syntax ('\x16\x03\x01\x01\x1c\x01\x00\x01\x18\x03\x03\x89\xc8\xa5\xea!\x8f\xad\x9d\xb1\xf86,X\xf1IC\xe1\x07\x95\x87Y\xa5\x8f\x05\xf9!d\xd97\x7f\xc1\xdf\x00\x00\x82\xc00\xc0,\xc0(\xc0$\xc0\x14\xc0')
    127.0.0.1 - - [02/Dec/2014 07:52:19] "^V^C^A^A^\^A^@^A^X^C^C<89>ȥ<EA>!<8F><AD><9D><B1><F8>6,X<F1>IC<E1>^G<95><87>Y<A5><8F>^E<F9>!d<D9>7^?<C1><DF>^@^@<82><C0>0<C0>,<C0>(<C0>$<C0>^T<C0>" 400 -
    2014-12-02 07:53:20.008 11159 INFO eventlet.wsgi.server [-] 192.168.122.11 - - [02/Dec/2014 07:53:20] "POST /v2.0/tokens HTTP/1.1" 200 1250 0.083278
    127.0.0.1 - - [02/Dec/2014 07:53:20] code 400, message Bad request syntax ("\x16\x03\x01\x01\x1c\x01\x00\x01\x18\x03\x03\x9e\xc4]-w\xb6\xad\xf1\x9a\x17\x1a'{%\xf9:H5[\xa3P\xea\xc8\x1a\x8b\x12\xee.y\x8f:\xc3\x00\x00\x82\xc00\xc0,\xc0(\xc0$\xc0\x14\xc0")
    127.0.0.1 - - [02/Dec/2014 07:53:20] "^V^C^A^A^\^A^@^A^X^C^C<9E><C4>]-w<B6><AD><F1><9A>^W^Z'{%<F9>:H5[<A3>P<EA><C8>^Z<8B>^R<EE>.y<8F>:<C3>^@^@<82><C0>0<C0>,<C0>(
    <C0>$<C0>^T<C0>" 400 -
    127.0.0.1 - - [02/Dec/2014 07:53:20] code 400, message Bad HTTP/0.9 request type ('\x16\x03\x01\x01\x1c\x01\x00\x01\x18\x03\x03\xbb\xa3v\x88bu\x07\xe9\x9dg>\x8e\xff\xa8p\xc0')
    127.0.0.1 - - [02/Dec/2014 07:53:20] "^V^C^A^A^\^A^@^A^X^C^C<BB><A3>v<88>bu^G<E9><9D>g><8E><FF><A8>p<C0>^K=<D8>]^1<F1><BA><A7>" 400 -
    127.0.0.1 - - [02/Dec/2014 07:53:21] code 400, message Bad HTTP/0.9 request type ('\x16\x03\x01\x01\x1c\x01\x00\x01\x18\x03\x03')
    127.0.0.1 - - [02/Dec/2014 07:53:21] "^V^C^A^A^\^A^@^A^X^C^C <B7>Iv<DB><D3>@<B2>~y<B7><FF>6<94>Ӯ<BF>8<E0>[I<80>F9<8C>^\<95>k" 400 -
    127.0.0.1 - - [02/Dec/2014 07:53:23] code 400, message Bad request syntax ('\x16\x03\x01\x01\x1c\x01\x00\x01\x18\x03\x03\x12\xc5(\xcbk\x05\x95\xd9\xae\xb1\xfbA\xba\x14bw\xc5>\xf2\xfes\x9e_\x97Rz\x1b\x8bA\xf6d\xa7\x00\x00\x82\xc00\xc0,\xc0(\xc0$\xc0\x14\xc0')
    127.0.0.1 - - [02/Dec/2014 07:53:23] "^V^C^A^A^\^A^@^A^X^C^C^R<C5>(<CB>k^E<95>ٮ<B1><FB>A<BA>^Tbw<C5>><F2><FE>s<9E>_<97>RzESC<8B>A<F6>d<A7>^@^@<82><C0>0<C0>,<C0>(
    <C0>$<C0>^T<C0>" 400 -

glance-api logs:

    2014-12-02 07:51:19.287 20032 INFO keystoneclient.middleware.auth_token [-] Starting keystone auth_token middleware
    2014-12-02 07:51:19.289 20032 INFO keystoneclient.middleware.auth_token [-] Using /tmp/keystone-signing-bRRmQx as cache directory for signing certificate
    2014-12-02 07:51:19.290 20032 INFO glance.wsgi.server [-] Starting 1 workers
    2014-12-02 07:51:19.293 20032 INFO glance.wsgi.server [-] Started child 20039
    2014-12-02 07:51:19.296 20039 INFO glance.wsgi.server [-] (20039) wsgi starting up on http://0.0.0.0:9292/
    2014-12-02 07:52:16.322 20039 INFO urllib3.connectionpool [-] Starting new HTTPS connection (1): 127.0.0.1
    2014-12-02 07:52:16.390 20039 WARNING keystoneclient.middleware.auth_token [-] Retrying on HTTP connection exception: [Errno 1] _ssl.c:510: error:140770FC:SSL routines:SSL23_GET_SERVER_HELLO:unknown protocol
    2014-12-02 07:52:16.892 20039 INFO urllib3.connectionpool [-] Starting new HTTPS connection (1): 127.0.0.1
    2014-12-02 07:52:16.909 20039 WARNING keystoneclient.middleware.auth_token [-] Retrying on HTTP connection exception: [Errno 1] _ssl.c:510: error:140770FC:SSL routines:SSL23_GET_SERVER_HELLO:unknown protocol
    2014-12-02 07:52:17.911 20039 INFO urllib3.connectionpool [-] Starting new HTTPS connection (1): 127.0.0.1
    2014-12-02 07:52:17.936 20039 WARNING keystoneclient.middleware.auth_token [-] Retrying on HTTP connection exception: [Errno 1] _ssl.c:510: error:140770FC:SSL routines:SSL23_GET_SERVER_HELLO:unknown protocol
    2014-12-02 07:52:19.939 20039 INFO urllib3.connectionpool [-] Starting new HTTPS connection (1): 127.0.0.1
    2014-12-02 07:52:19.964 20039 ERROR keystoneclient.middleware.auth_token [-] HTTP connection exception: [Errno 1] _ssl.c:510: error:140770FC:SSL routines:SSL23_GET_SERVER_HELLO:unknown protocol
    2014-12-02 07:52:19.964 20039 WARNING keystoneclient.middleware.auth_token [-] Authorization failed for token
    2014-12-02 07:52:19.964 20039 INFO keystoneclient.middleware.auth_token [-] Invalid user token - deferring reject downstream
    2014-12-02 07:52:19.972 20039 INFO glance.wsgi.server [-] 192.168.122.11 - - [02/Dec/2014 07:52:19] "POST /v1/images HTTP/1.1" 401 381 3.662323

I was caugth offguard by the SSL errors as I thought the authentication was supposed to take place over HTTP. The documentation explicitely states in a note in the glance install section that the following lines can be commented out in glance-api.conf and glance-registry.conf:

    auth_host = 127.0.0.1
    auth_port = 35357
    auth_protocol = http

It's stated that the auth_uri and identiry_uri replace the lines above. Just for grins, I uncommented the auth_protocol line and was subsequently able to create a cirros image with glance.

    [root@controller]# grep -A 7 keystone_authtoken glance-*
    glance-api.conf:[keystone_authtoken]
    glance-api.conf-#auth_host = 127.0.0.1
    glance-api.conf-#auth_port = 35357
    glance-api.conf-auth_protocol = http
    glance-api.conf-auth_uri = http://controller:5000/v2.0
    glance-api.conf-identity_uri = http://controller:35357
    glance-api.conf-admin_tenant_name = service
    glance-api.conf-admin_user = glance
    --
    glance-registry.conf:[keystone_authtoken]
    glance-registry.conf-#auth_host = 127.0.0.1
    glance-registry.conf-#auth_port = 35357
    glance-registry.conf-auth_protocol = http
    glance-registry.conf-auth_uri = http://controller:5000/v2.0
    glance-registry.conf-identity_uri = http://controller:35357
    glance-registry.conf-admin_tenant_name = service
    glance-registry.conf-admin_user = glance

    [root@controller]# !390
    service glance-registry restart ; service glance-api restart
    glance-registry stop/waiting
    glance-registry start/running, process 20377
    glance-api stop/waiting
    glance-api start/running, process 20387

    [root@controller]# cd /tmp/images/
    [root@controller]# !395
    glance image-create --name "cirros-0.3.3-x86_64" --file cirros-0.3.3-x86_64-disk.img --disk-format qcow2 --container-format bare --is-public True --progress
    [=============================>] 100%
    +------------------+--------------------------------------+
    | Property | Value |
    +------------------+--------------------------------------+
    | checksum | 133eae9fb1c98f45894a4e60d8736619 |
    | container_format | bare |
    | created_at | 2014-12-02T15:06:32 |
    | deleted | False |
    | deleted_at | None |
    | disk_format | qcow2 |
    | id | 2d90376a-68e0-467b-afd6-7cb277e5f0cf |
    | is_public | True |
    | min_disk | 0 |
    | min_ram | 0 |
    | name | cirros-0.3.3-x86_64 |
    | owner | None |
    | protected | False |
    | size | 13200896 |
    | status | active |
    | updated_at | 2014-12-02T15:06:33 |
    | virtual_size | None |
    +------------------+--------------------------------------+
    [root@controller]#

I'm not sure if this is a (known) bug in glance/keystone or if the documentation is incorrect. Glance is now working for me, just not sure whose attention is needed here or if this is a known bug. Thanks in advance for any assistance.

Sai Kiran (saikiran)
Changed in glance:
assignee: nobody → Sai Kiran (saikiran)
Revision history for this message
Sai Kiran (saikiran) wrote :

 Rob, we have to uncomment these fields in glance-api.conf and glance-registry.conf which are given below,

    auth_host = 127.0.0.1
    auth_port = 35357
    auth_protocol = http

and we must specify the controller Ip address to the auth_host ( like auth_host = 192.168.2.100 ) , after that restart glance services and please check your credentials once.

Revision history for this message
Rob Mengert (rob-mengert) wrote : Re: [Bug 1398495] Re: Unable to upload image to glance
Download full text (11.6 KiB)

Sai,

As per my original post, I got Glance working by simply removing the
comment for the "auth_protocol=http" line. If all the lines in your
previous mail have to have the comment removed, then the Juno install guide
for Ubuntu 14.04 needs to be updated.

http://docs.openstack.org/juno/install-guide/install/apt/content/glance-install.html

Snippet:
[image: [Note]]Note

Comment out any auth_host, auth_port, and auth_protocol options because the
identity_uri option replaces them.
Thanks,
Rob

On Tue, Dec 9, 2014 at 6:41 AM, Sai Kiran <email address hidden> wrote:

> Rob, we have to uncomment these fields in glance-api.conf and
> glance-registry.conf which are given below,
>
> auth_host = 127.0.0.1
> auth_port = 35357
> auth_protocol = http
>
> and we must specify the controller Ip address to the auth_host ( like
> auth_host = 192.168.2.100 ) , after that restart glance services and
> please check your credentials once.
>
> --
> You received this bug notification because you are subscribed to the bug
> report.
> https://bugs.launchpad.net/bugs/1398495
>
> Title:
> Unable to upload image to glance
>
> Status in OpenStack Image Registry and Delivery Service (Glance):
> New
>
> Bug description:
> Hello everyone. Details of the problem experienced have been
> documented at the link below. I'm not sure if this is an error with
> Glance or with Keystone.
>
> https://ask.openstack.org/en/questions/54963/edit/
>
> I installed and configured glance as per the install instructions on
> the OpenStack website and received the following error when attempting
> to upload a cirros image:
>
> [root@controller]# source ~/openstack-tools/admin-openrc.sh
> [root@controller]# glance image-create --name "cirros-0.3.3-x86_64"
> --file cirros-0.3.3-x86_64-disk.img --disk-format qcow2 --container-format
> bare --is-public True --progress
> [=============================>] 100%
> Request returned failure status.
> Invalid OpenStack Identity credentials.
>
>
> Keystone Logs:
>
> 2014-12-02 07:52:16.300 11159 INFO eventlet.wsgi.server [-]
> 192.168.122.11 - - [02/Dec/2014 07:52:16] "POST /v2.0/tokens HTTP/1.1" 200
> 1250 0.084692
> 127.0.0.1 - - [02/Dec/2014 07:52:16] code 400, message Bad request
> version ('b\x00\x00\x82\xc00\xc0,\xc0(\xc0$\xc0\x14\xc0')
> 127.0.0.1 - - [02/Dec/2014 07:52:16]
> "^V^C^A^A^\^A^@^A^X^C^C<DA>^M<FA><91><92>`^V<94><97>^Z^TPߕ<B9><A4><A8>^E<D3>G;<FA><AC>5^X"<9B><88>
> b^@^@<82><C0>0<C0>,<C0>(
> <C0>$<C0>^T<C0>" 400 -
> 127.0.0.1 - - [02/Dec/2014 07:52:16] code 400, message Bad request
> syntax
> ('\x16\x03\x01\x01\x1c\x01\x00\x01\x18\x03\x03\xc7\xc2s\xdb\x97w\x94t\x84\xa4\xca.\x9c\x18\xa9\xd7\xd1\xf2\x94\xfb\xad\x1c\x04\xbc\x07\xcf!\xda5Z.\xa7\x00\x00\x82\xc00\xc0,\xc0(\xc0$\xc0\x14\xc0')
> 127.0.0.1 - - [02/Dec/2014 07:52:16]
> "^V^C^A^A^\^A^@^A^X^C^C<C7><C2>sۗw<94>t<84><A4><CA>.<9C>^X<A9><D7><D1><F2><94><FB><AD>^\^D<BC>^G<CF>!<DA>5Z.<A7>^@^@<82><C0>0
> <C0>,<C0>(<C0>$<C0>^T<C0>" 400 -
> 127.0.0.1 - - [02/Dec/2014 07:52:17] code 400, message Bad HTTP/0.9
> request type
> ('\x16\x03\x01\x01\x1c\x01\x00\x01\x18\x03\x03\xd...

Ian Cordasco (icordasc)
Changed in glance:
importance: Undecided → High
assignee: Sai Kiran (saikiran) → Ian Cordasco (icordasc)
status: New → Confirmed
Revision history for this message
Ian Cordasco (icordasc) wrote :

Rob, are you using the correct install guide. For juno the link you provide is 100% correct. For Icehouse, though, you'll run into problems. You should be referencing http://docs.openstack.org/icehouse/install-guide/install/apt/content/glance-install.html

Changed in glance:
importance: High → Undecided
status: Confirmed → Incomplete
assignee: Ian Cordasco (icordasc) → nobody
Revision history for this message
Vikram (vikramvkhanna) wrote :
Download full text (3.5 KiB)

Previously even I was getting the following error message:-

root@controller:/home/XXXXXX# glance image-create --name "cirros-0.3.3-x86_64" - -file /tmp/images/cirros-0.3.3-x86_64-disk.img --disk-format qcow2 --container-f ormat bare --is-public True --progress
[=============================>] 100%
Request returned failure status.
Invalid OpenStack Identity credentials.

Issue solved by changing the following in glance-api.conf & glance-registry.conf:
===================================================================================
[keystone_authtoken]
auth_uri = http://controller:5000/v2.0
identity_uri = http://controller:35357
admin_tenant_name = service
admin_user = XXXXXX
admin_password = XXXXXX

To this:
=========
auth_host = controller
auth_port = 35357
auth_protocol = http
admin_tenant_name = service
admin_user = XXXXXX
admin_password = XXXXXX
auth_uri = http://controller:5000

============
=VALIDATION=
============
root@controller:/home/XXXXXX# nano /etc/glance/glance-api.conf root@controller:/home/XXXXXX# nano /etc/glance/glance-registry.conf
root@controller:/home/XXXXXX# service glance-registry restart
glance-registry stop/waiting
glance-registry start/running, process 7550
root@controller:/home/XXXXXX# service glance-api restart
glance-api stop/waiting
glance-api start/running, process 7563
root@controller:/home/XXXXXX#
root@controller:/home/XXXXXX# source admin-openrc.sh
root@controller:/home/XXXXXX# glance image-create --name "cirros-0.3.3-x86_64" --file /tmp/images/cirros-0.3.3-x86_64-disk.img --disk-format qcow2 --container-format bare --is-public True --progress
[=============================>] 100%
+------------------+--------------------------------------+
| Property | Value |
+------------------+--------------------------------------+
| checksum | 51b8afbd2b6d36d7012280e9ede51e7e |
| container_format | bare |
| created_at | 2015-06-08T18:14:12 |
| deleted | False |
| deleted_at | None |
| disk_format | qcow2 |
| id | 9a8b12c9-f0d6-43a4-a23a-f4cc67fe89f1 |
| is_public | True |
| min_disk | 0 |
| min_ram | 0 |
| name | cirros-0.3.3-x86_64 |
| owner | c3eab5d97c514aa4aec53ba1dc5aae40 |
| protected | False |
| size | 955802 |
| status | active |
| updated_at | 2015-06-08T18:14:12 |
| virtual_size | None |
+------------------+--------------------------------------+
root@controller:/home/XXXXXX# glance image-list
+--------------------------------------+---------------------+-------------+------------------+--------+--------+
| ID | Name | Disk Format | Container Format | Size | St...

Read more...

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.