swift unable to upload file

asked 2016-03-10 01:31:12 -0600

njk84sg gravatar image

updated 2016-03-13 20:18:21 -0600

Hi Guys,

I encountered the following error when I tried to upload a file to swift.

Warning: failed to create container 'container1': 404 Not Found: <html>

Not Found

The resource could not be found.< Object HEAD failed: http://controller:8080/v1/AUTH_xxx/co... 400 Bad Request

Where am I able to check what went wrong?

Cheers, JK

--Update-- I found the following error in my object-server log file:

Mar 12 11:12:09 object1 swift: Exception dumping recon cache: #012Traceback (most recent call last):#012 File "/usr/lib/python2.7/dist-packages/swift/common/utils.py", line 2132, in dump_recon_cache#012 with lock_file(cache_file, lock_timeout, unlink=False) as cf:#012 File "/usr/lib/python2.7/contextlib.py", line 17, in __enter__#012 return self.gen.next()#012 File "/usr/lib/python2.7/dist-packages/swift/common/utils.py", line 1432, in lock_file#012 fd = os.open(filename, flags)#012OSError: [Errno 13] Permission denied: '/var/cache/swift/object.recon'

--update 2-- I found the following issue: I followed the installation guide in openstack website for ubuntu, and set permissions to /var/cache/swift on the storage node to root:swift. However, controller node is not able to access that.

What could be the issue here?

I have confirmed that iptables is not running, and SELinux is not installed. I am using apparmor.

Thank you in advance.

edit retag flag offensive close merge delete


Check the following Logs in your controller

Bipin gravatar imageBipin ( 2016-03-10 04:46:53 -0600 )edit

Hi Bipin, there is no such file in existance.

njk84sg gravatar imagenjk84sg ( 2016-03-10 21:55:51 -0600 )edit

Could you please tell me more about your Openstack version, Operating system etc ?

Bipin gravatar imageBipin ( 2016-03-11 00:58:29 -0600 )edit

ubuntu 14.04, openstack liberty.

njk84sg gravatar imagenjk84sg ( 2016-03-11 03:27:17 -0600 )edit

Hi Bipin, also, I had managed to setup controller and compute node and block storage without any issues, and swift is my first module with errors.

njk84sg gravatar imagenjk84sg ( 2016-03-11 19:07:12 -0600 )edit

3 answers

Sort by ยป oldest newest most voted

answered 2016-03-13 22:42:35 -0600

Bipin gravatar image

updated 2016-03-13 22:44:42 -0600

Make sure both admin and demo have SwiftOperator role added

keystone user-role-list --user <username> --tenant admin

You should see something like following

|                id                |      name     | user_id |            tenant_id             |
| b62f29f0a8b345a8a4d2632bd39b4167 | SwiftOperator |  14173  | 069275e634a7420bbbfa4a679aa89fkk |
| 9fe2ff9ee4384b1894a90878d3e9ab2b |    _member_   |  14173  | 069275e634a7420bbbfa4a679aa89fkk |

If you cannot see the SwiftOperator Role, add the role to the tenant like following.

openstack role add --user <username> --project 069275e634a7420bbbfa4a679aa89fkk  SwiftOperator
edit flag offensive delete link more


Hi Bipin,

Is this suitable for Liberty? I understand that keystone command is deprecated.

njk84sg gravatar imagenjk84sg ( 2016-03-14 02:19:02 -0600 )edit

I missed that point

openstack role add --user username --project TENANT_ID ROLE_NAME SwiftOperator
Bipin gravatar imageBipin ( 2016-03-14 09:29:46 -0600 )edit

demo | Demo Project | 47e8331565da4bfdaaf462b9a8a9b5d1

service | Service Project | c27967a5a6d24915a3393b8f8eeac73c    

admin | Admin Project | f619db111afd4cbd818ee15804d7d685

So, does that mean if I want to add the swiftoperator role to demo project i must use the demo project id? Thanks.

njk84sg gravatar imagenjk84sg ( 2016-03-14 20:07:51 -0600 )edit

Hi Bipin,

I just realised what is going on.
Everything is set under admin role, under the service project. Roles are assigned to both admin and user in the proxy-server.conf, instead of the usual admin and swiftoperator. I am testing out with different port numbers (8080 changed to 8081).

njk84sg gravatar imagenjk84sg ( 2016-03-14 21:10:29 -0600 )edit

Hi Bipin,

I am only having 1 object storage node with 3 hdd inside, sdb and sdc for swift storage. Is that the issue?

njk84sg gravatar imagenjk84sg ( 2016-03-14 22:45:04 -0600 )edit

answered 2016-03-10 01:50:07 -0600

Aun gravatar image

/var/log/messages on swift storage nodes and /var/log/swift/swift.log on swift proxy node should help you find out the exact issue.

edit flag offensive delete link more


I am unable to locate /var/log/swift.

I am using ubuntu 14.04 with Liberty.

njk84sg gravatar imagenjk84sg ( 2016-03-10 02:06:32 -0600 )edit

@njk84sg have you created the swift endpoint on keystone?

guimaluf gravatar imageguimaluf ( 2016-03-14 06:19:46 -0600 )edit

yes. service name is object-store.

njk84sg gravatar imagenjk84sg ( 2016-03-14 20:15:20 -0600 )edit

sorry. service name is swift, service type of object-store

njk84sg gravatar imagenjk84sg ( 2016-03-14 20:15:48 -0600 )edit

answered 2016-03-15 03:27:30 -0600

njk84sg gravatar image

updated 2016-03-15 04:47:23 -0600

--update 4 --
Found the issue! :)
When you do swift-ring-builder account.ring add xxx..., please make sure that the port number is 6002.
When you do swift-ring-builder container.ring add xxx...., please make sure that the port number is 6001.
When you do swift-ring-builder object.ring add xxx...., please make sure that the port number is 6000. Problem solved!

-update 3-

I found out that whenever I try to rebalance, I get the following: /usr/lib/python2.7/dist-packages/swift/common/ring/builder.py:406: RingValidationWarning: Replica count of 3.0 requires more than 2 devices 'num_devices': num_devices, No partitions could be reassigned. Either none need to be or none can be due to min_part_hours [1].

Also, when I try to do
swift post container1
I get Container POST failed: http://controller1:8081/v1/AUTH_47e83... 400 Bad Request [first 60 chars of response] Invalid path: /sdb/466/AUTH_47e8331565da4bfdaaf462b9a8a9b5d1

Again, when I enter the disk /sdb/ I do not see 466. I only see accounts and tmp. And also, under accounts, I still do not see 466. I see 513 and 313.

If this is easier for @Bipin or @guimaluf, or everyone, please tell me what I should do.

Cheers, JK

edit flag offensive delete link more

Get to know Ask OpenStack

Resources for moderators

Question Tools

1 follower


Asked: 2016-03-10 01:31:12 -0600

Seen: 1,398 times

Last updated: Mar 15 '16