update failed: 503 service unavailable
I have confronted a problem when I tried to deploy swift on my virtual machine. I followed the SAIO instruction and when I typed the command :
swift-auth-add-user -K filestore -a test tester testing
it reported an error like this:
Update failed: 503 Service Unavailable
I checked my /var/log/syslog, it says:
Mar 9 20:28:56 ubuntuswift auth-server ERROR attempting to create account http://
Mar 9 20:28:56 ubuntuswift auth-server FAILED create_user('test', 'tester', _, True, False) [0.03]
Mar 9 20:28:56 ubuntuswift auth-server 127.0.0.1 - - [09/Mar/
I have tried methods written in other answers titled "503 service unavailable", but it seems not right for me, does anyone know how to reslove this problem? Thanks a lot.
Question information
- Language:
- English Edit question
- Status:
- Solved
- Assignee:
- No assignee Edit question
- Solved by:
- Du Ran
- Solved:
- Last query:
- Last reply:
Revision history for this message
|
#1 |
Does your proxy-server.conf file have the line "allow_
Revision history for this message
|
#2 |
I have double checked the following conf files:
1 /etc/swift/
[app:proxy-server]
use = egg:swift#proxy
allow_account_
2 /etc/swift/
/etc/swift/
[DEFAULT]
bind_port = 8080 -------
user = bella |
/etc/swift/
[app:auth-server] |
use = egg:swift#auth |
default_cluster_url = http://
3 ll -d /etc/swift
drwxr-xr-x 6 bella bella 4096 2011-03-10 11:13 /etc/swift/ <=bella is the user id
4 /etc/swift/
mount_check = false
5 full content of /etc/swift/
DEFAULT]
bind_port = 8080
user = bella
[pipeline:main]
# For DevAuth:
pipeline = healthcheck cache auth proxy-server
# For Swauth:
# pipeline = healthcheck cache swauth proxy-server
[app:proxy-server]
use = egg:swift#proxy
allow_account_
# Only needed for DevAuth
[filter:auth]
use = egg:swift#auth
# Only needed for Swauth
#[filter:swauth]
#use = egg:swift#swauth
# Highly recommended to change this.
super_admin_key = filestore
[filter:
use = egg:swift#
6 full content of /etc/swift/
[DEFAULT]
user = bella
[pipeline:main]
pipeline = auth-server
[app:auth-server]
use = egg:swift#auth
default_cluster_url = http://
# Highly recommended to change this.
super_admin_key = filestore
[filter:cache]
use = egg:swift#memcache
7 other entries from /var/log/syslog about the proxy-server:
Mar 9 19:31:23 ubuntuswift swift CRITICAL: THERE ARE ACCOUNTS IN YOUR auth.db THAT DO NOT BEGIN WITH YOUR NEW RESELLER PREFIX OF "AUTH". YOU HAVE A FEW OPTIONS: 1) RUN "swift-
thanks a lot, gholt :)
Revision history for this message
|
#3 |
Ah, you have a really old auth.db from early dev. I get it. Let me know if you have trouble with upgrade instructions posted in the log [reposted here for future searchers]:
Mar 9 19:31:23 ubuntuswift swift CRITICAL:
THERE ARE ACCOUNTS IN YOUR auth.db THAT DO NOT BEGIN WITH YOUR NEW RESELLER PREFIX OF "AUTH". YOU HAVE A FEW OPTIONS:
1) RUN "swift-
2) REMOVE /tmp/swift_
3) ADD "reseller_prefix = " (WITHOUT THE QUOTES) TO YOUR proxy-server.conf IN THE [filter:auth] SECTION AND TO YOUR auth-server.conf IN THE [app:auth-server] SECTION AND RUN "swift-init proxy-server restart" AND "swift-init auth-server restart" TO REVERT BACK TO YOUR PREVIOUS RESELLER PREFIX.
SINCE YOUR PREVIOUS RESELLER PREFIX WAS AN EMPTY STRING, IT IS NOT RECOMMENDED TO PERFORM OPTION 3 AS THAT WOULD MAKE SUPPORTING MULTIPLE RESELLERS MORE DIFFICULT.
Revision history for this message
|
#4 |
Good afternoon, gholt. I have tried the first method you mentioned in the post, but when I typed in command:
swift-auth-
it returned the following message:
Updating /tmp/swift_
Traceback (most recent call last):
File "/usr/local/
execfile(
File "/home/
conn = get_db_
File "/home/
timeout=
swift.common.
Traceback (most recent call last):
File "/home/
factory=
File "/home/
sqlite3.
OperationalError: unable to open database file
then I tried the second method , and found that the file /tmp/swift_
dosen't exist.
what should I do next? By the way,what is reseller prefix? did I mis-config something?
thank you very much, gholt! :)
Revision history for this message
|
#5 |
hello again, gholt.
I tried the command :
swift-init auth-server restart
and it retured:
Stopping auth-server pid: 2597 signal: 15
Unable to increase file descriptor limit. Running as non-root?
Starting auth-server
and then I tried the command :
swift-auth-add-user -K filestore -a test tester testing
then it return the same 503 error message:
Update failed: 503 Service Unavailable
I checked the /var/log/syslog, it says:
Mar 10 14:07:21 ubuntuswift auth-server SIGTERM received
Mar 10 14:07:21 ubuntuswift auth-server Exited
Mar 10 14:07:21 ubuntuswift auth-server Started child 2634
Mar 10 14:09:01 ubuntuswift CRON[2640]: (root) CMD ( [ -x /usr/lib/
Mar 10 14:10:37 ubuntuswift auth-server ERROR attempting to create account http://
Mar 10 14:10:37 ubuntuswift auth-server FAILED create_user('test', 'tester', _, True, False) [0.04]
Mar 10 14:10:37 ubuntuswift auth-server 127.0.0.1 - - [10/Mar/
also there are entries about proxy-server in /var/log/syslog:
Mar 10 13:43:43 ubuntuswift swift CRITICAL: THERE ARE ACCOUNTS IN YOUR auth.db THAT DO NOT BEGIN WITH YOUR NEW RESELLER PREFIX OF "AUTH". YOU HAVE A FEW OPTIONS: 1) RUN "swift-
and the file /tmp/swift_
I use the command locate auth.db, there is only one file: /etc/swift/auth.db
Revision history for this message
|
#6 |
I have tried Swauth , but it still report the error message "ubuntuswift swift CRITICAL: THERE ARE ACCOUNTS IN YOUR auth.db THAT DO NOT BEGIN WITH YOUR NEW RESELLER PREFIX OF "AUTH"...", I really don't know how to resolve this problem...
Revision history for this message
|
#7 |
If you are now using Swauth, it does not need the auth-server process, that's only required for DevAuth. The /tmp/swift_
If you can, can you log into IRC, maybe we can work it out faster there? chat.freenode.net and #openstack
I assume you're just working on a test/dev system. Since it has been a while between updates to your system, it might be best to refresh and work through the setup again.
Revision history for this message
|
#8 |
Thank you a lot, gholt.
I tried the folling Swauth authentication following the instruction and it still reported the same "update failed:503 message"
error.
I have checked my conf fiiles again, the /tmp/swift_
I don't have IRC account, can we discuss on msn, my msn account is <email address hidden>
And yes, after tried all methods but failed, I am trying to set up swift again , and not yet finished .
Revision history for this message
|
#9 |
Thank you a lot, gholt.
I tried the folling Swauth authentication following the instruction and it still reported the same "update failed:503 message"
error.
I have checked my conf fiiles again, the /tmp/swift_
I don't have IRC account, can we discuss on msn, my msn account is <email address hidden>
And yes, after tried all methods but failed, I am trying to set up swift again , and not yet finished .
Revision history for this message
|
#10 |
Good afternoon, gholt.
I re-deployed swift and no more errors "update failed:503 service unavailable", I guess maybe the new version swift code resolved this problem itself.
By the way, I checked the /var/log/syslog, it still has entries of error about proxy-server, like "THERE ARE ACCOUNTS IN YOUR auth.db THAT DO NOT BEGIN WITH YOUR NEW RESELLER PREFIX OF "AUTH". ". I think this error message is irrelavant with "update failed:503 service unavailable", and I noticed that this message appeard after I typed in the command "cd ~/swift/trunk; ./.unittests".
Thanks a lot, gholt.
Revision history for this message
|
#11 |
Dear gholt,
I am interested in consistent hashing and the ring mechanism in openstack swift, when I google some articles on the internet, I found a serious articles you have written about consistent hashing on your blog.
But I have a question about the third code section in second article(http://
I copy your code here:
from bisect import bisect_left
from hashlib import md5
from struct import unpack_from
NODE_COUNT = 100
DATA_ID_COUNT = 10000000
VNODE_COUNT = 1000
vnode_range_starts = []
vnode2node = []
for vnode_id in xrange(
vnode_
vnode2node.
new_vnode2node = list(vnode2node)
new_node_id = NODE_COUNT
NEW_NODE_COUNT = NODE_COUNT + 1
vnodes_to_reassign = VNODE_COUNT / NEW_NODE_COUNT
while vnodes_to_reassign > 0:
for node_to_take_from in xrange(NODE_COUNT):
for vnode_id, node_id in enumerate(
if node_id == node_to_take_from:
if vnodes_to_reassign <= 0:
if vnodes_to_reassign <= 0:
break
moved_ids = 0
for data_id in xrange(
data_id = str(data_id)
hsh = unpack_from('>I', md5(str(
vnode_id = bisect_
node_id = vnode2node[
new_node_id = new_vnode2node[
if node_id != new_node_id:
moved_ids += 1
percent_moved = 100.0 * moved_ids / DATA_ID_COUNT
print '%d ids moved, %.02f%%' % (moved_ids, percent_moved)
and I put the modified code here:
from bisect import bisect_left
from hashlib import md5
from struct import unpack_from
NODE_COUNT = 100
DATA_ID_COUNT = 10000000
VNODE_COUNT = 1000
vnode_range_starts = []
vnode2node = []
for vnode_id in xrange(
vnode_
vnode2node.
# I think this is the right method tfo get new_vnode2node
new_vnode2node = []
NEW_NODE_COUNT = NODE_COUNT + 1
for vnode_id in xrange(
new_
moved_ids = 0
for data_id in xrange(
data_id = str(data_id)
hsh = unpack_from('>I', md5(str(
vnode_id = bisect_
node_id = vnode2node[
new_node_id = new_vnode2node[
if node_id != new_node_id:
moved_ids += 1
percent_moved = 100.0 * moved_ids / DATA_ID_COUNT
print '%d ids moved, %.02f%%' % (moved_ids, percent_moved)
and here is the output of the modified code:
8997554 ids moved, 89.98%
I am looking forward to your reply, thanks for your attention.
Best regards,
Ran