griddynamics / openstack

Grid Dynamics OpenStack distribution
griddynamics.github.com/openstack
5 stars 1 forks source link

Error on dashboard login -- 'module' object has no attribute 'dumps' #6

Closed sstent closed 12 years ago

sstent commented 12 years ago

openstack-keystone.noarch 2011.3.1-b1357 openstack-dashboard.noarch 2012.1-b1351 python-novaclient.noarch 2011.3-b1360


DefaultPluginManager load plugin sqlalchemy = sqlalchemy_nose.noseplugin:NoseSQLAlchemy Creating a new client connection with endpoint: http://127.0.0.1:5000/v2.0. Error while handling form "Login". Traceback (most recent call last): File "/usr/lib/python2.6/site-packages/dashboard/wsgi/../../horizon/forms/base.py", line 211, in maybe_handle return form, form.handle(request, data) File "/usr/lib/python2.6/site-packages/dashboard/wsgi/../../horizon/views/auth_forms.py", line 88, in handle data['password']) File "/usr/lib/python2.6/site-packages/dashboard/wsgi/../../horizon/api/keystone.py", line 167, in token_create tenant_id=tenant) File "/usr/lib/python2.6/site-packages/dashboard/wsgi/../../keystoneclient/v2_0/tokens.py", line 37, in authenticate return self._create('/tokens', params, "access", return_raw=return_raw) File "/usr/lib/python2.6/site-packages/dashboard/wsgi/../../keystoneclient/base.py", line 82, in _create resp, body = self.api.post(url, body=body) File "/usr/lib/python2.6/site-packages/dashboard/wsgi/../../keystoneclient/client.py", line 188, in post return self._cs_request(url, 'POST', _kwargs) File "/usr/lib/python2.6/site-packages/dashboard/wsgi/../../keystoneclient/client.py", line 153, in _cs_request _kwargs) File "/usr/lib/python2.6/site-packages/dashboard/wsgi/../../keystoneclient/client.py", line 114, in request request_kwargs['body'] = json.dumps(kwargs['body'])

AttributeError: 'module' object has no attribute 'dumps'

aababilov commented 12 years ago

Remove python-json!

yum erase python-json

sstent commented 12 years ago

Now we get:

Traceback: File "/usr/lib/python2.6/site-packages/django/core/handlers/base.py" in get_response

  1. response = callback(request, _callback_args, *_callback_kwargs) File "/usr/lib/python2.6/site-packages/dashboard/wsgi/../../horizon/decorators.py" in dec
  2. return view_func(request, _args, *_kwargs) File "/usr/lib/python2.6/site-packages/dashboard/wsgi/../../horizon/decorators.py" in dec
  3. return view_func(request, _args, *_kwargs) File "/usr/lib/python2.6/site-packages/dashboard/wsgi/../../horizon/decorators.py" in dec
  4. return view_func(request, _args, *_kwargs) File "/usr/lib/python2.6/site-packages/dashboard/wsgi/../../horizon/decorators.py" in dec
  5. return view_func(request, _args, *_kwargs) File "/usr/lib/python2.6/site-packages/dashboard/wsgi/../../horizon/dashboards/syspanel/instances/views.py" in usage
  6. global_summary.service() File "/usr/lib/python2.6/site-packages/dashboard/wsgi/../../horizon/dashboards/syspanel/instances/views.py" in service
  7. self.service_list = api.service_list(self.request) File "/usr/lib/python2.6/site-packages/dashboard/wsgi/../../horizon/api/deprecated.py" in inner
  8. return f(_args, *_kwargs) File "/usr/lib/python2.6/site-packages/dashboard/wsgi/../../horizon/api/keystone.py" in service_list
  9. return [Services(s) for s in admin_api(request).services.list()] File "/usr/lib/python2.6/site-packages/dashboard/wsgi/../../horizon/api/deprecated.py" in admin_api
  10. management_url = url_for(request, 'compute', True) File "/usr/lib/python2.6/site-packages/dashboard/wsgi/../../horizon/api/base.py" in url_for
  11. raise exceptions.ServiceCatalogException(service_type)

Exception Type: ServiceCatalogException at /syspanel/ Exception Value: Invalid service catalog service: compute

keystone-manage service list

id name type

1 nova nova 2 keystone identity

sstent commented 12 years ago

Still having the same issue using the newer packages.

horizon.noarch 2012.1-b1407
openstack-dashboard.noarch 2012.1-b1407 python-keystoneclient.noarch 2.7-b1413

aababilov commented 12 years ago

This has nothing to do with package versions :)

Please initialize your keystone database with appropriate data. You can use https://github.com/aababilov/keystone-init - just follow the instructions for init-keystone-db.py script.

sstent commented 12 years ago

Wow, I love that this doesn't appear in the documentation for installing keystone.

sstent commented 12 years ago

Also, should these python scripts be included in the package if they are essential to installing the system?

sstent commented 12 years ago

1) line 9 ('user', 'add', 'admin', 'secrete'), should be ('user', 'add', 'admin', 'secrete', 'systenant'), This assigns the admin user to the systenant tenancy, otherwise you get an error about no tenant for admin

2) I still get the same error

Traceback: File "/usr/lib/python2.6/site-packages/django/core/handlers/base.py" in get_response

  1. response = callback(request, _callback_args, *_callback_kwargs) File "/usr/lib/python2.6/site-packages/dashboard/wsgi/../../horizon/decorators.py" in dec
  2. return view_func(request, _args, *_kwargs) File "/usr/lib/python2.6/site-packages/dashboard/wsgi/../../horizon/decorators.py" in dec
  3. return view_func(request, _args, *_kwargs) File "/usr/lib/python2.6/site-packages/dashboard/wsgi/../../horizon/decorators.py" in dec
  4. return view_func(request, _args, *_kwargs) File "/usr/lib/python2.6/site-packages/dashboard/wsgi/../../horizon/decorators.py" in dec
  5. return view_func(request, _args, *_kwargs) File "/usr/lib/python2.6/site-packages/dashboard/wsgi/../../horizon/dashboards/syspanel/instances/views.py" in usage
  6. global_summary.service() File "/usr/lib/python2.6/site-packages/dashboard/wsgi/../../horizon/dashboards/syspanel/instances/views.py" in service
  7. self.service_list = api.service_list(self.request) File "/usr/lib/python2.6/site-packages/dashboard/wsgi/../../horizon/api/deprecated.py" in inner
  8. return f(_args, *_kwargs) File "/usr/lib/python2.6/site-packages/dashboard/wsgi/../../horizon/api/keystone.py" in service_list
  9. return [Services(s) for s in admin_api(request).services.list()] File "/usr/lib/python2.6/site-packages/dashboard/wsgi/../../horizon/api/deprecated.py" in admin_api
  10. management_url = url_for(request, 'compute', True) File "/usr/lib/python2.6/site-packages/dashboard/wsgi/../../horizon/api/base.py" in url_for
  11. raise exceptions.ServiceCatalogException(service_type)

Exception Type: ServiceCatalogException at /syspanel/ Exception Value: Invalid service catalog service: compute

aababilov commented 12 years ago

Frankly speaking, there is a sample script to init the database - https://github.com/openstack/keystone/blob/stable/diablo/keystone/test/sampledata.py . But it only shows how should look the keystone's database.

Generally, by design, keystone has bad scenario of integration with nova and glance. So, don't be surprised ;)

That's strange that you have problems with admin user that has no default tenant. Default tenant is optional, and it is enough if you just grant Admin role on systenant for admin user. However, I will add this default tenant to avoid possible problems.

Have you passed nova= to init-keystone-db.py? Could you please dump your services and endpoint_templates tables? Also, you could restart keystone and also perform authentication by curl and check exact service catalogs.

aababilov commented 12 years ago

You could run curl like this: $ curl -d '{"auth":{"tenantName": "systenant", "passwordCredentials":{"username": "admin", "password": "secrete"}}}' -H "Content-type: application/json" http://localhost:5000/v2.0/tokens

rlz commented 12 years ago

Hello sstent,

Does this issue still open?