412 Precondition Failed

Asked by Du Ran

I am using curl command to test swift ReST API, when I typed in the following command:
curl -k -D - -H "X-Auth-Key: test" -H "X-Auth-User: admin" https://192.168.61.89:8080/v1.0

I got the following response:
HTTP/1.1 412 Precondition Failed
Content-Type: text/html; charset=UTF-8
Content-Length: 7
Date: Wed, 07 Sep 2011 13:27:09 GMT

I used bexar code and devauth, any opinion? Thanks!

Question information

Language:
English Edit question
Status:
Expired
For:
OpenStack Object Storage (swift) Edit question
Assignee:
No assignee Edit question
Last query:
Last reply:
Revision history for this message
Marcelo Martins (btorch) said :
#1

Yes, don't use such al old release. My suggestion is that you give it a try with 1.4.X version of swift using Ubuntu 10.04. I assume this is a SAIO setup.

Revision history for this message
Du Ran (duran-ihep) said :
#2

only use apt-get to upgrade swift code or do I need to re-deploy swift on my muliti-nodes?

Revision history for this message
Du Ran (duran-ihep) said :
#3

I typed in command:
apt-cache showpkg swift

I got the following results:

Package: swift
Versions:
1.2.0-0ubuntu1~lucid0 (/var/lib/apt/lists/ppa.launchpad.net_swift-core_ppa_ubuntu_dists_lucid_main_binary-i386_Packages) (/var/lib/dpkg/status)
 Description Language:
                 File: /var/lib/apt/lists/ppa.launchpad.net_swift-core_ppa_ubuntu_dists_lucid_main_binary-i386_Packages
                  MD5: e0952832fac69c95c1164bcfbafe5f46

Reverse Depends:
Dependencies:
1.2.0-0ubuntu1~lucid0 - python-swift (5 1.2.0-0ubuntu1~lucid0) python (2 2.6)
Provides:
1.2.0-0ubuntu1~lucid0 -
Reverse Provides:

which means swift version is 1.2.0

after I typed in command:

add-apt-repository ppa:swift-core/trunk

I got the following results:

Package: swift
Versions:
1.4.3~20110822.346-0ubuntu0ppa1~lucid1 (/var/lib/apt/lists/ppa.launchpad.net_swift-core_trunk_ubuntu_dists_lucid_main_binary-i386_Packages)
 Description Language:
                 File: /var/lib/apt/lists/ppa.launchpad.net_swift-core_trunk_ubuntu_dists_lucid_main_binary-i386_Packages
                  MD5: 7de15bde951264e5f9603202d2a74a72

1.2.0-0ubuntu1~lucid0 (/var/lib/apt/lists/ppa.launchpad.net_swift-core_ppa_ubuntu_dists_lucid_main_binary-i386_Packages) (/var/lib/dpkg/status)
 Description Language:
                 File: /var/lib/apt/lists/ppa.launchpad.net_swift-core_ppa_ubuntu_dists_lucid_main_binary-i386_Packages
                  MD5: e0952832fac69c95c1164bcfbafe5f46

Reverse Depends:
Dependencies:
1.4.3~20110822.346-0ubuntu0ppa1~lucid1 - python-swift (5 1.4.3~20110822.346-0ubuntu0ppa1~lucid1) python (2 2.6)
1.2.0-0ubuntu1~lucid0 - python-swift (5 1.2.0-0ubuntu1~lucid0) python (2 2.6)
Provides:
1.4.3~20110822.346-0ubuntu0ppa1~lucid1 -
1.2.0-0ubuntu1~lucid0 -
Reverse Provides:

now there are two versions here: v1.4.3 and v1.2.0

here comes the question: which one is the one I am using, and how to decide?

I typed in command:
apt-get upgrade swift

and here is the response :
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following packages have been kept back:
  linux-generic-pae linux-headers-generic linux-headers-generic-pae linux-image-generic-pae
0 upgraded, 0 newly installed, 0 to remove and 4 not upgraded.

which means there is no upgrade, did I really install swift v1.4.3, when?

Any opinion? Or how to upgrade swift to version 1.4.3?

Thanks a lot!

Revision history for this message
Du Ran (duran-ihep) said :
#4

root@ubuntu:~# dpkg -l swift
Desired=Unknown/Install/Remove/Purge/Hold
| Status=Not/Inst/Cfg-files/Unpacked/Failed-cfg/Half-inst/trig-aWait/Trig-pend
|/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad)
||/ Name Version Description
+++-======================================-======================================-============================================================================================
ii swift 1.2.0-0ubuntu1~lucid0 A distributed virtual object store (common files)

Revision history for this message
Du Ran (duran-ihep) said :
#5

the above is un-upgraded one, the following is the one after upgrading
root@ubuntu:/opt/swift# dpkg -l swift
Desired=Unknown/Install/Remove/Purge/Hold
| Status=Not/Inst/Cfg-files/Unpacked/Failed-cfg/Half-inst/trig-aWait/Trig-pend
|/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad)
||/ Name Version Description
+++-======================================-======================================-============================================================================================
ii swift 1.4.3~20110822.346-0ubuntu0ppa1~lucid1 distributed virtual object store - common files

Revision history for this message
Du Ran (duran-ihep) said :
#6

this is the response of dpkg -L command before upgrading

root@ubuntu:~# dpkg -L swift
/.
/usr
/usr/bin
/usr/bin/swift-account-audit
/usr/bin/swift-ring-builder
/usr/bin/swift-stats-report
/usr/bin/swauth-delete-user
/usr/bin/swauth-prep
/usr/bin/swauth-add-user
/usr/bin/swift-get-nodes
/usr/bin/swift-stats-populate
/usr/bin/swift-bench
/usr/bin/swauth-set-account-service
/usr/bin/swauth-list
/usr/bin/swauth-add-account
/usr/bin/swauth-cleanup-tokens
/usr/bin/st
/usr/bin/swauth-delete-account
/usr/share
/usr/share/doc
/usr/share/doc/swift
/usr/share/doc/swift/changelog.Debian.gz
/usr/share/doc/swift/drive-audit.conf-sample
/usr/share/doc/swift/stats.conf-sample
/usr/share/doc/swift/changelog.gz
/usr/share/doc/swift/copyright

and the following is the response of dpkg -L command after upgrading

root@ubuntu:/opt/swift# dpkg -L swift
/.
/usr
/usr/share
/usr/share/doc
/usr/share/doc/swift
/usr/share/doc/swift/stats.conf-sample
/usr/share/doc/swift/changelog.Debian.gz
/usr/share/doc/swift/copyright
/usr/share/doc/swift/drive-audit.conf-sample
/usr/share/man
/usr/share/man/man8
/usr/share/man/man8/swift-stats-report.8.gz
/usr/share/man/man8/swauth-set-account-service.8.gz
/usr/share/man/man8/swauth-cleanup-tokens.8.gz
/usr/share/man/man8/swauth-delete-account.8.gz
/usr/share/man/man8/swauth-add-account.8.gz
/usr/share/man/man8/swauth-prep.8.gz
/usr/share/man/man8/swauth-list.8.gz
/usr/share/man/man8/swift.8.gz
/usr/share/man/man8/swift-bench.8.gz
/usr/share/man/man8/swauth-add-user.8.gz
/usr/share/man/man8/swift-log-stats-collector.8.gz
/usr/share/man/man8/swift-account-audit.8.gz
/usr/share/man/man8/swauth-delete-user.8.gz
/usr/share/man/man8/swift-stats-populate.8.gz
/usr/share/man/man8/swift-ring-builder.8.gz
/usr/share/man/man8/swift-get-nodes.8.gz
/usr/bin
/usr/bin/swift-get-nodes
/usr/bin/swift-dispersion-populate
/usr/bin/swift-bench
/usr/bin/swift-stats-populate
/usr/bin/swift
/usr/bin/swift-dispersion-report
/usr/bin/swift-ring-builder
/usr/bin/swift-stats-report

we can see that it's different, so I think the current version is 1.4.3, am I right?

Revision history for this message
Jay Payne (letterj) said :
#7

What do you get when you run:

dpkg -l | grep swift

Revision history for this message
Marcelo Martins (btorch) said :
#8

Ok, quite a bit of information there :) I don't personally use the packages provided by launchpad PPA, since I've only had issues with them. Instead I use the ones that are available at http://crashsite.github.com/swift_debian and maintained and tested by us. If you want to use the packages provided by launchpad, you should be using the "ppa:swift-core/release" repository, which will have the latest stable release 1.4.2. The 1.4.3 version that you retrieved is in it's final stages to be released.

Upgrading swift 1.2.0 to a 1.4.X version could be messy but not impossible, since there have been quite a few changes to swift and its configurations. I would suggest you get a git copy of the swift github repo and use the sample configurations provided to setup your 1.4.X configuration files prior to the upgrade.

Also, when we go through the process of upgrading swift to a newer release on a multi-node environment. We usually start with the Storage nodes (one zone at a time). Once all the storage nodes have been upgraded and everything looks ok, we proceed to upgrading the proxy servers (also one zone at a time). After that we upgrade our other internal swift systems that are not user related.

Instead of using an "apt-get upgrade" command, just use "apt-get install [SWIFT PACKAGES ... ]". For example, if I'm upgrading storage nodes the command that will run on each storage node would be something like:

"apt-get install python-swift swift swift-account swift-container swift-object --force-yes -Vy"

Obviously, first I run the command above with -Vs instead of -Vy on at least one box just to make sure the proper packages will be retrieved.

Also note that since 1.4.X, the swauth authentication is now a separate project:
https://github.com/gholt/swauth

The same goes for the swift stats logging, which is also a separate project now:
https://github.com/notmyname/slogging
https://github.com/notmyname/slogging-debian

You could also do something like the following for checking on the version if you are in doubt.
root@saio-1:/var/log/swift# python
Python 2.6.5 (r265:79063, Apr 16 2010, 13:57:41)
[GCC 4.4.3] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import swift
>>> print swift.__version__
1.4.2
>>>

Revision history for this message
Du Ran (duran-ihep) said :
#9

Jay Payne (letterj) ,

on proxy & auth node:
root@ubuntu:~# dpkg -l | grep swift
ii python-swift 1.2.0-0ubuntu1~lucid0 A distributed virtual object store (python l
ii swift 1.2.0-0ubuntu1~lucid0 A distributed virtual object store (common f
ii swift-auth 1.2.0-0ubuntu1~lucid0 The swift auth server
ii swift-proxy 1.2.0-0ubuntu1~lucid0 The swift proxy server

on storage node:
root@ubuntu:~# dpkg -l | grep swift
ii python-swift 1.2.0-0ubuntu1~lucid0 A distributed virtual object store (python l
ii swift 1.2.0-0ubuntu1~lucid0 A distributed virtual object store (common f
ii swift-account 1.2.0-0ubuntu1~lucid0 The swift account server
ii swift-container 1.2.0-0ubuntu1~lucid0 The swift container server
ii swift-object 1.2.0-0ubuntu1~lucid0 The swift object server

Revision history for this message
Du Ran (duran-ihep) said :
#10

Marcelo Martins (btorch) ,

Thank you very much! Very helpful, I will have a try according to what you said, and I will let you know if I succeed.

Revision history for this message
Launchpad Janitor (janitor) said :
#11

This question was expired because it remained in the 'Needs information' state without activity for the last 15 days.