Hi Alessio,<br><br>Thank you for your help. Your answer solved the problem. I was really confused by the different documents with different versions. It should be v2.0.<br><br>But after this step, I met another problem, when I ran "swift -A <a href="http://127.0.0.1:5000/v2.0">http://127.0.0.1:5000/v2.0</a> -U joeuser -K secrete stat -v", I got the following error message: <br>
Traceback (most recent call last):<br>
File "/usr/bin/swift", line 1853, in <module><br>
error_queue)<br>
File "/usr/bin/swift", line 1363, in st_stat<br>
headers = conn.head_account()<br>
File "/usr/bin/swift", line 818, in head_account<br>
return self._retry(None, head_account)<br>
File "/usr/bin/swift", line 790, in _retry<br>
self.http_conn = self.http_connection()<br>File "/usr/bin/swift", line 778, in http_connection<br><p id="yui_3_3_0_5_1326847052702305">
return http_connection(self.url)<br>
File "/usr/bin/swift", line 163, in http_connection<br>
parsed = urlparse(url)<br>
File "/usr/lib/python2.7/urlparse.py", line 135, in urlparse<br>
tuple = urlsplit(url, scheme, allow_fragments)<br>
File "/usr/lib/python2.7/urlparse.py", line 174, in urlsplit<br>
i = url.find(':')<br>
AttributeError: 'NoneType' object has no attribute 'find'</p><p id="yui_3_3_0_5_1326847052702305">I have found a answer online said "Keystone try to pick the tenant ID from table "users" last variable which is tenant_id . if you did not specify it , I think that keystone will return wrong URL for swift client . try to associate a tenant for the user , and add an endpoint for the tenant to swift endpoint templates." And this answer worked for the guy who had this problem.</p>
<p id="yui_3_3_0_5_1326847052702305">But this solution haven't worked for me. I have created a user named "joeuser", its tenant is "customer-x". And I also have created the endpointTemplates, and added endpoints (swift endpoint is one) with tenants (customer-x). (All are done by running the sampledata provided by the keystone). <br>
</p><p id="yui_3_3_0_5_1326847052702305">The keystone api.log: WARNING [eventlet.wsgi.server] 127.0.0.1 -- [18/Jan/2012 14:05:30] "GET /v2.0 HTTP/1.1" 200 1364 0.000522. (It seemed nothing was wrong)</p><p id="yui_3_3_0_5_1326847052702305">
I was totally confused when I fed the swift with wrong username and password "swift -A <a href="http://127.0.0.1:5000/v2.0">http://127.0.0.1:5000/v2.0</a> -U asdf -K asdfasdf stat -v", I got the same error message and the api.log showed the same log message. So, it seemed that his problem may happen before authentication.</p>
<p id="yui_3_3_0_5_1326847052702305">So, could you please help with this problem? That must be highly appreciated. I have got stuck here for several days.</p><p id="yui_3_3_0_5_1326847052702305">Other information: I used the tempauth for swift successfully and created two containers and uploaded several files. So I think swift works well. And the bug mentioned in the official documentation "note: you currently have to create a
container or upload something as your first action to have the account
created; there’s a Swift bug to be fixed soon" may NOT affect my swift command. I also got error message when I tried "swift -A <a href="http://127.0.0.1:5000/v2.0">http://127.0.0.1:5000/v2.0</a> -U asdf -K asdfasdf post myfiles" ("myfiles" is a container I created before).</p>
<p id="yui_3_3_0_5_1326847052702305">Thank you so much for you help.</p><p id="yui_3_3_0_5_1326847052702305">Fine regards,</p><p id="yui_3_3_0_5_1326847052702305">Sean.<br></p><p id="yui_3_3_0_5_1326847052702305"><br></p>
<p id="yui_3_3_0_5_1326847052702305"><br></p><div class="gmail_quote">On 17 January 2012 04:26, Alessio Ababilov <span dir="ltr"><<a href="mailto:aababilov@griddynamics.com">aababilov@griddynamics.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0pt 0pt 0pt 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<div bgcolor="#FFFFFF" text="#000000">
Hi!<br>
<br>
Please!<br>
<br>
Why are you using v1.0 in this command:<div class="im"><br>
<br>
swift -A <a href="http://127.0.0.1:5000/v1.0" target="_blank">http://127.0.0.1:5000/v1.0</a>
-U admin -K secrete stat -v<br>
<br></div>
Could you try:<br>
<br>
swift -A <a href="http://127.0.0.1:5000/v1.0" target="_blank">http://127.0.0.1:5000/v2.0</a>
-U admin -K secrete stat -v<div><div class="h5"><br>
<br>
<br>
On 01/16/2012 02:22 PM, Xuyun Zhang wrote:
<blockquote type="cite">Alessio,<br>
<br>
Your answer solved my problem. Thank you so much. But I met the
'500 Internal Server Error'.<br>
<br>
I generated a user admin with password secrete, and used curl to
produce the token successfully. When I ran " swift -A <a href="http://127.0.0.1:5000/v1.0" target="_blank">http://127.0.0.1:5000/v1.0</a>
-U admin -K secrete stat -v", but got "Auth GET failed; http:<a href="http://127.0.0.1:5000/v1.0" target="_blank">127.0.0.1:5000/v1.0</a>
500 Internal Server Error". <br>
the api.log showed that the publicURL error. So, could you please
help me with this problem. I guess there are something wrong with
adding endpoints. But I don't know what's the exact cause.<br>
<br>
tail of the /var/log/keystone/api.log:<br>
<a href="tel:2012-01-16%2022" value="+12012011622" target="_blank">2012-01-16 22</a>:53:17 WARNING [eventlet.wsgi.server] 127.0.0.1 - -
[16/Jan/2012 22:53:17] "GET /v1.0 HTTP/1.1" 500 747 0.030160<br>
<a href="tel:2012-01-16%2022" value="+12012011622" target="_blank">2012-01-16 22</a>:53:25 WARNING [eventlet.wsgi.server] Traceback
(most recent call last):<br>
File "/usr/lib/python2.7/dist-packages/eventlet/wsgi.py", line
336, in handle_one_response<br>
result = self.application(self.environ, start_response)<br>
File "/home/chang/keystone/keystone/frontends/normalizer.py",
line 107, in __call__<br>
return self.app(env, start_response)<br>
File
"/home/chang/keystone/keystone/frontends/legacy_token_auth.py",
line 77, in __call__<br>
json.loads(response.body))<br>
File
"/home/chang/keystone/keystone/frontends/legacy_token_auth.py",
line 102, in __transform_headers<br>
service_urls += endpoint["publicURL"]<br>
KeyError: 'publicURL'<br>
<a href="tel:2012-01-16%2022" value="+12012011622" target="_blank">2012-01-16 22</a>:53:25 WARNING [eventlet.wsgi.server] 127.0.0.1 - -
[16/Jan/2012 22:53:25] "GET /v1.0 HTTP/1.1" 500 747 0.030664<br>
<a href="tel:2012-01-16%2022" value="+12012011622" target="_blank">2012-01-16 22</a>:53:41 WARNING [eventlet.wsgi.server] Traceback
(most recent call last):<br>
File "/usr/lib/python2.7/dist-packages/eventlet/wsgi.py", line
336, in handle_one_response<br>
result = self.application(self.environ, start_response)<br>
File "/home/chang/keystone/keystone/frontends/normalizer.py",
line 107, in __call__<br>
return self.app(env, start_response)<br>
File
"/home/chang/keystone/keystone/frontends/legacy_token_auth.py",
line 77, in __call__<br>
json.loads(response.body))<br>
File
"/home/chang/keystone/keystone/frontends/legacy_token_auth.py",
line 102, in __transform_headers<br>
service_urls += endpoint["publicURL"]<br>
KeyError: 'publicURL'<br>
<a href="tel:2012-01-16%2022" value="+12012011622" target="_blank">2012-01-16 22</a>:53:41 WARNING [eventlet.wsgi.server] 127.0.0.1 - -
[16/Jan/2012 22:53:41] "GET /v1.0 HTTP/1.1" 500 747 0.034363<br>
<a href="tel:2012-01-16%2022" value="+12012011622" target="_blank">2012-01-16 22</a>:53:49 WARNING [eventlet.wsgi.server] 127.0.0.1 - -
[16/Jan/2012 22:53:49] "GET /v1.0 HTTP/1<br>
<br>
My environments:<br>
Keystone v2012.1-dev<br>
swift 1.4.3-0ubuntu2<br>
host IP: 138.25.61.81<br>
<br>
part of swift-proxy.conf:<br>
bind_port = 8080 (not 8888)<br>
<br>
part of keystone.conf:<br>
service_host = 127.0.0.1<br>
serivce_port = 5000<br>
admin_host = 127.0.0.1<br>
admin_port = 5001 (not 35357)<br>
<br>
data generate sh:<br>
#!/bin/bash<br>
rm -f /var/lib/keystone/keystone.db<br>
keystone-manage database sync<br>
chown keystone:nogroup /var/lib/keystone/keystone.db<br>
<br>
keystone-manage user add admin secrete<br>
keystone-manage role add Admin<br>
keystone-manage role add KeystoneServiceAdmin<br>
keystone-manage role grant Admin admin<br>
keystone-manage role grant KeystoneServiceAdmin admin<br>
<br>
keystone-manage service add nova compute "Nova-Compute-Service"<br>
keystone-manage service add glance "glance Glance-Image-Service"<br>
keystone-manage service add swift storage
"Swift-Ojbect-Storage-Service"<br>
keystone-manage service add keystone identity
"Keystone-Identity-Service"<br>
<br>
keystone-manage endpointTemplates add RegionOne nova <a href="http://138.25.61.81:8774/v1.1/%tenant_id%" target="_blank">http://138.25.61.81:8774/v1.1/%tenant_id%</a>
<a href="http://127.0.0.1:8774/v1.1/%tenant_id%" target="_blank">http://127.0.0.1:8774/v1.1/%tenant_id%</a>
<a href="http://138.25.61.81:8774/v1.1/%tenant_id%" target="_blank">http://138.25.61.81:8774/v1.1/%tenant_id%</a>
1 1<br>
keystone-manage endpointTemplates add RegionOne glance <a href="http://138.25.61.81:9292/v1" target="_blank">http://138.25.61.81:9292/v1</a>
<a href="http://127.0.0.1:9292/v1" target="_blank">http://127.0.0.1:9292/v1</a>
<a href="http://138.25.61.81:9292/v1" target="_blank">http://138.25.61.81:9292/v1</a>
1 1<br>
keystone-manage endpointTemplates add RegionOne swift <a href="http://138.25.61.81:8080/v1/AUTH_%tenant_id%" target="_blank">http://138.25.61.81:8080/v1/AUTH_%tenant_id%</a>
<a href="http://127.0.0.1:8080/v1.0/" target="_blank">http://127.0.0.1:8080/v1.0/</a>
<a href="http://138.25.61.81:8080/v1/AUTH_%tenant_id%" target="_blank">http://138.25.61.81:8080/v1/AUTH_%tenant_id%</a>
1 1<br>
keystone-manage endpointTemplates add RegionOne keystone <a href="http://138.25.61.81:5000/v2.0" target="_blank">http://138.25.61.81:5000/v2.0</a>
<a href="http://127.0.0.1:5001/v2.0" target="_blank">http://127.0.0.1:5001/v2.0</a>
<a href="http://138.25.61.81:5000/v2.0" target="_blank">http://138.25.61.81:5000/v2.0</a>
1 1<br>
<br>
keystone-manage tenant add admin-tenant<br>
keystone-manage role grant Admin admin admin-tenant<br>
<br>
keystone-manage token add 999888777666 admin admin-tenant
2015-02-05T00:00<br>
<br>
keystone-manage tenant add demo-tenant<br>
keystone-manage user add demo secrete<br>
keystone-manage role add Member<br>
keystone-manage role grant Member demo demo-tenant<br>
keystone-manage role grant Admin admin demo-tenant<br>
<br>
keystone-manage credentials add admin EC2 admin-key
secretepassword<br>
keystone-manage credentials add admin EC2 demo-key secretepassword<br>
<br>
keystone-manage endpoint add admin-tenant 1<br>
keystone-manage endpoint add admin-tenant 2<br>
keystone-manage endpoint add admin-tenant 3<br>
keystone-manage endpoint add admin-tenant 4<br>
<br>
keystone-manage endpoint add demo-tenant 1<br>
keystone-manage endpoint add demo-tenant 2<br>
keystone-manage endpoint add demo-tenant 3<br>
keystone-manage endpoint add demo-tenant 4<br>
<br>
<br>
<br>
<br>
<div class="gmail_quote">
On 16 January 2012 00:00, Alessio Ababilov <span dir="ltr"><<a href="mailto:aababilov@griddynamics.com" target="_blank">aababilov@griddynamics.com</a>></span>
wrote:<br>
<blockquote class="gmail_quote" style="margin:0pt 0pt 0pt 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<div bgcolor="#FFFFFF" text="#000000"> Hi!<br>
<br>
You are using sqlite and I guess that you have run
./sampledata as root. So, the database file is owned by root
and cannot be writable by `keystone` user.<br>
<br>
Please change it ownership (run as root in the directory
where you have your keystone.db):<br>
<br>
chown keystone keystone.db
<div>
<div><br>
<br>
<br>
On 01/14/2012 01:51 PM, Xuyun Zhang wrote: </div>
</div>
<blockquote type="cite">
<div>
<div>I set the database by running ./sampledata<br>
<br>
Then I tried to use curl to get tokens, the command
is: <br>
<br>
$ curl -d '{"auth":{"passwordCredentials":{"username":
"admin", "password": "secrete"}}}' -H "Content-type:
application/json" <a href="http://localhost:35357/v2.0/tokens" target="_blank">http://localhost:35357/v2.0/tokens</a><br>
<br>
The result is :<br>
$ {"IdentityFault": {"message": "Unhandled error",
"code": "500", "details": "(OperationalError) attempt
to write a readonly database u'INSERT INTO tokens (id,
user_id, tenant_id, expires) VALUES (?, ?, ?, ?)'
('ce9cc482-7ab5-4785-9152-3cab95e12833', 1, None, '<a href="tel:2012-01-15%2022" value="+12012011522" target="_blank">2012-01-15 22</a>:41:14.794615')"}}<br>
<br>
it seemed that the token had been generated yet can't
be written to the database.<br>
<br>
my environment:<br>
swift version: 1.4.3-0ubuntu2 (installed by apt-get
install command)<br>
keystone version: keystone 2012.1-dev (installation
directory: /home/chang/keystone)<br>
<br>
Any helpful information is highly appreciated! <br>
<br>
Regards,<br>
Sean<br>
<br>
<br>
<fieldset></fieldset>
<br>
</div>
</div>
<div>
<pre>_______________________________________________
Mailing list: <a href="https://launchpad.net/%7Eopenstack" target="_blank">https://launchpad.net/~openstack</a>
Post to : <a href="mailto:openstack@lists.launchpad.net" target="_blank">openstack@lists.launchpad.net</a>
Unsubscribe : <a href="https://launchpad.net/%7Eopenstack" target="_blank">https://launchpad.net/~openstack</a>
More help : <a href="https://help.launchpad.net/ListHelp" target="_blank">https://help.launchpad.net/ListHelp</a>
</pre>
</div>
</blockquote>
<span><font color="#888888"> <br>
<br>
<pre cols="72">--
Alessio Ababilov
Software Engineer
Grid Dynamics</pre>
</font></span></div>
</blockquote>
</div>
<br>
</blockquote>
<br>
<br>
<pre cols="72">--
Alessio Ababilov
Software Engineer
Grid Dynamics</pre>
</div></div></div>
</blockquote></div><br>