Ask Your Question
0

Error 412 between Glance and Swift - TempAuth

asked 2012-02-14 18:19:49 -0500

warik gravatar image

Hello!

I am having an issue when I am trying to upload an image to Glance. Glance is working fine when I am using the default_store =file. Since I installed Swift, I wanted to upload my images there with Glance. I changed the following fields in the glance-api.conf:

default_store = swift swift_store_auth_address = http://192.168.100.203:8080/v1.0/ swift_store_user = system:root swift_store_key = mypass swift_store_container = glance swift_store_create_container_on_put = True

Then I restarted Glance API, and used the glance command to upload an image, but I got this error:


    glance add -A stack0t name=ttylinux-kernel is_public=true container_format=aki disk_format=aki < ttylinux-vmlinux

Failed to add image. Got error: 400 Bad Request

The server could not comply with the request since it is either malformed or otherwise incorrect.

Error uploading image: (ClientException): Auth GET failed: http://192.168.100.203:8080/1.0 412 Precondition Failed

Note: Your image metadata may still be in the registry, but the image's status will likely be 'killed'.

I poked around a little, look at some Launchpad threads but none of the solutions worked for me. I tried with a Glance stable/diablo and a Glance trunk version but the error is the same.

I am using Swift 1.4.5. I can check my installation with the "swift stat -v" and a curl command, they both work fine.

Does anyone had this issue before? Thanks a ton for your help!

Warik

edit retag flag offensive close merge delete

5 answers

Sort by ยป oldest newest most voted
0

answered 2012-02-14 18:29:21 -0500

eglynn gravatar image

Hi Warik,

Try:

swift_store_auth_address = http://192.168.100.203:8080/auth/v1.0

i.e. note the "/auth" segment in the path.

Cheers, Eoghan

edit flag offensive delete link more
0

answered 2012-02-14 20:25:14 -0500

warik gravatar image

Hello Eoghan,

Thanks for your reply, I tried your suggestion and now I get this one:

glance add -A stack0t name=ttylinux-kernel is_public=true container_format=aki disk_format=aki < /root/openstack-setup/ttylinux-vmlinux Failed to add image. Got error: 400 Bad Request

The server could not comply with the request since it is either malformed or otherwise incorrect.

Error uploading image: (BackendException): Failed to add object to Swift. Got error from Swift: put_object('glance', '1', ...) failure and no ability to reset contents for reupload.
Note: Your image metadata may still be in the registry, but the image's status will likely be 'killed'.

Any thoughts ? Thanks

edit flag offensive delete link more
0

answered 2012-02-14 21:52:19 -0500

eglynn gravatar image

Hi Warik,

Just to ask the obvious question, presumably you've already verified the username, key and container name via the swift CLI?

Cheers, Eoghan

edit flag offensive delete link more
0

answered 2012-02-15 01:17:31 -0500

warik gravatar image

Eoghan,

Here are the result of the Swift command:


swift -A http://192.168.100.203:8080/auth/v1.0 -U system:root -K testpass stat Account: AUTH_system Containers: 271 Objects: 11 Bytes: 14316679

Accept-Ranges: bytes

The curl command works as well:


curl -k -v -H 'X-Storage-User: system:root' -H 'X-Storage-Pass: testpass' http://192.168.100.203:8080/auth/v1.0 * About to connect() to 192.168.100.203 port 8080 (#0) * Trying 192.168.100.203... connected * Connected to 192.168.100.203 (192.168.100.203) port 8080 (#0)

GET /auth/v1.0 HTTP/1.1 User-Agent: curl/7.21.6 (x86_64-pc-linux-gnu) libcurl/7.21.6 OpenSSL/1.0.0e zlib/1.2.3.4 libidn/1.22 librtmp/2.3 Host: 192.168.100.203:8080 Accept: / X-Storage-User: system:root X-Storage-Pass: testpass

< HTTP/1.1 200 OK < X-Storage-Url: http://192.168.100.203:8080/v1/AUTH_system (http://192.168.100.203:8080/v1/AUTH_s...) < X-Storage-Token: AUTH_tka2a8fac8647042d0bab03951ef651ab6 < X-Auth-Token: AUTH_tka2a8fac8647042d0bab03951ef651ab6 < Content-Length: 0 < Date: Wed, 15 Feb 2012 01:12:24 GMT < * Connection #0 to host 192.168.100.203 left intact

* Closing connection #0

It seems to be in a good shape. I can also upload/download with the swift command.

Do I need to test something else? Thank you

edit flag offensive delete link more
0

answered 2012-02-15 01:40:35 -0500

warik gravatar image

Hi Eoghan,

I don't really know why but it's working now.

I add a new zone to my ring, rebalanced it and it's working... Do you think that one of these steps can fix this issue?! That sounds will it should!

Anyway, if I found the root of the problem and the solution I will share it. :)

Thanks for the time! Warik

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Get to know Ask OpenStack

Resources for moderators

Question Tools

1 follower

Stats

Asked: 2012-02-14 18:19:49 -0500

Seen: 319 times

Last updated: Feb 15 '12