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">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">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>
2012-01-16 22: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>2012-01-16 22: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>2012-01-16 22: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>
2012-01-16 22: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>
2012-01-16 22: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>2012-01-16 22: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%">http://138.25.61.81:8774/v1.1/%tenant_id%</a> <a href="http://127.0.0.1:8774/v1.1/%tenant_id%">http://127.0.0.1:8774/v1.1/%tenant_id%</a> <a href="http://138.25.61.81:8774/v1.1/%tenant_id%">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">http://138.25.61.81:9292/v1</a> <a href="http://127.0.0.1:9292/v1">http://127.0.0.1:9292/v1</a> <a href="http://138.25.61.81:9292/v1">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%">http://138.25.61.81:8080/v1/AUTH_%tenant_id%</a> <a href="http://127.0.0.1:8080/v1.0/">http://127.0.0.1:8080/v1.0/</a> <a href="http://138.25.61.81:8080/v1/AUTH_%tenant_id%">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">http://138.25.61.81:5000/v2.0</a> <a href="http://127.0.0.1:5001/v2.0">http://127.0.0.1:5001/v2.0</a> <a href="http://138.25.61.81:5000/v2.0">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>