Create new container always raise ERROR Container HEAD failed

Bug #1469118 reported by Vlad Okhrimenko
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Dashboard (Horizon)
Invalid
Undecided
Unassigned
python-swiftclient
New
Undecided
Unassigned

Bug Description

Following error messages raised in Horizon log file:
dashboard-swiftclient: ERROR Container HEAD failed

Steps:
1. Login to Horizon as admin.
2. Go to Object Store.
3. Create three containers: Container1, Container2, Container3
4. Containers created and became operable, but dashboard log contains batch of identical errors for them.

It's happening because we check of exists container name https://github.com/openstack/horizon/blob/master/openstack_dashboard/api/swift.py#L126 and swift always generate error in https://github.com/openstack/python-swiftclient/blob/master/swiftclient/client.py#L692
We need a better mechanism in swift (maybe return resp.status or something like this)

no longer affects: swift
Revision history for this message
Christian Schwede (cschwede) wrote :

This is not an error, in fact rest.status is returned with the exception. Look at the code in 695: https://github.com/openstack/python-swiftclient/blob/master/swiftclient/client.py#L695 The HTTP status (in this case a 404) is returned.

To me the error message looks correct - doing a GET or HEAD on a non-existing container should raise an exception, because you assumed the container exists.

What I could imagine is a method like "container_exists()" that will directly return a true or false and not raise an Exception; though this can be done in the client as well. Maybe the logging in horizon needs to be changed a bit?

Revision history for this message
Vlad Okhrimenko (vokhrimenko) wrote :

We get error in Horizon log, after https://github.com/openstack/python-swiftclient/blob/master/swiftclient/client.py#L692
Maybe don't need generate error for this case (for checking name ) ? Or maybe create function for this case (in swift) -- and then use new function in Horizon?

Revision history for this message
Vlad Okhrimenko (vokhrimenko) wrote :

Can I ask you to create a new function in `swift`, for checking of existing name ? (or show this function, if it exists)

Changed in horizon:
status: New → Invalid
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.