VSM
VSM

Reputation: 1785

JSONDecodeError in OpenStack Ubuntu 18.4

I am a beginner of OpenStack devstack. When I install OpenStack and login in to the system I notice that there was no any error messages there. But after rebooting my machine and login in to the instance and overview sections, i found that there was a error, which is called

JSONDecodeError: Expecting value: line 1 column 1 (char 0)

. Still I don't have a idea how to solve this. Please hep me to achive this. Appreciate you help.

JSONDecodeError at /project/instances/

Expecting value: line 1 column 1 (char 0)

Request Method:     GET
Request URL:    http://10.1.1.140/dashboard/project/instances/
Django Version:     2.2.12
Exception Type:     JSONDecodeError
Exception Value:    

Expecting value: line 1 column 1 (char 0)

Exception Location:     /usr/lib/python3.6/json/decoder.py in raw_decode, line 357
Python Executable:  /usr/bin/python3
Python Version:     3.6.9
Python Path:    

['/opt/stack/horizon',
 '/opt/stack/horizon',
 '/opt/stack/keystone',
 '/opt/stack/glance',
 '/opt/stack/cinder',
 '/opt/stack/neutron',
 '/opt/stack/nova',
 '/opt/stack/placement',
 '/opt/stack/horizon',
 '/opt/stack/tempest',
 '/usr/lib/python36.zip',
 '/usr/lib/python3.6',
 '/usr/lib/python3.6/lib-dynload',
 '/usr/local/lib/python3.6/dist-packages',
 '/usr/lib/python3/dist-packages',
 '/opt/stack/horizon/openstack_dashboard']

Server time:    Sat, 4 Apr 2020 14:09:49 +0000

Traceback

Environment:


Request Method: GET
Request URL: http://10.1.1.140/dashboard/project/instances/

Django Version: 2.2.12
Python Version: 3.6.9
Installed Applications:
['openstack_dashboard.dashboards.project',
 'openstack_dashboard.dashboards.admin',
 'openstack_dashboard.dashboards.identity',
 'openstack_dashboard.dashboards.settings',
 'openstack_dashboard',
 'django.contrib.contenttypes',
 'django.contrib.auth',
 'django.contrib.sessions',
 'django.contrib.messages',
 'django.contrib.staticfiles',
 'django.contrib.humanize',
 'django_pyscss',
 'debreach',
 'openstack_dashboard.django_pyscss_fix',
 'compressor',
 'horizon',
 'openstack_auth']
Installed Middleware:
('openstack_auth.middleware.OpenstackAuthMonkeyPatchMiddleware',
 'debreach.middleware.RandomCommentMiddleware',
 'django.middleware.common.CommonMiddleware',
 'django.middleware.csrf.CsrfViewMiddleware',
 'django.contrib.sessions.middleware.SessionMiddleware',
 'django.contrib.auth.middleware.AuthenticationMiddleware',
 'horizon.middleware.OperationLogMiddleware',
 'django.contrib.messages.middleware.MessageMiddleware',
 'horizon.middleware.HorizonMiddleware',
 'horizon.themes.ThemeMiddleware',
 'django.middleware.locale.LocaleMiddleware',
 'django.middleware.clickjacking.XFrameOptionsMiddleware',
 'openstack_dashboard.contrib.developer.profiler.middleware.ProfilerClientMiddleware',
 'openstack_dashboard.contrib.developer.profiler.middleware.ProfilerMiddleware')



Traceback:

File "/usr/lib/python3.6/json/decoder.py" in raw_decode
  355.             obj, end = self.scan_once(s, idx)

During handling of the above exception (0), another exception occurred:

File "/usr/local/lib/python3.6/dist-packages/django/core/handlers/exception.py" in inner
  34.             response = get_response(request)

File "/usr/local/lib/python3.6/dist-packages/django/core/handlers/base.py" in _get_response
  115.                 response = self.process_exception_by_middleware(e, request)

File "/usr/local/lib/python3.6/dist-packages/django/core/handlers/base.py" in _get_response
  113.                 response = wrapped_callback(request, *callback_args, **callback_kwargs)

File "/opt/stack/horizon/horizon/decorators.py" in dec
  52.             return view_func(request, *args, **kwargs)

File "/opt/stack/horizon/horizon/decorators.py" in dec
  36.         return view_func(request, *args, **kwargs)

File "/opt/stack/horizon/horizon/decorators.py" in dec
  36.         return view_func(request, *args, **kwargs)

File "/opt/stack/horizon/horizon/decorators.py" in dec
  113.         return view_func(request, *args, **kwargs)

File "/opt/stack/horizon/horizon/decorators.py" in dec
  84.                 return view_func(request, *args, **kwargs)

File "/usr/local/lib/python3.6/dist-packages/django/views/generic/base.py" in view
  71.             return self.dispatch(request, *args, **kwargs)

File "/usr/local/lib/python3.6/dist-packages/django/views/generic/base.py" in dispatch
  97.         return handler(request, *args, **kwargs)

File "/opt/stack/horizon/horizon/tables/views.py" in get
  223.         handled = self.construct_tables()

File "/opt/stack/horizon/horizon/tables/views.py" in construct_tables
  214.             handled = self.handle_table(table)

File "/opt/stack/horizon/horizon/tables/views.py" in handle_table
  123.         data = self._get_data_dict()

File "/opt/stack/horizon/horizon/tables/views.py" in _get_data_dict
  252.             self._data = {self.table_class._meta.name: self.get_data()}

File "/opt/stack/horizon/openstack_dashboard/dashboards/project/instances/views.py" in get_data
  156.                 self._get_images, self._get_flavors, self._get_volumes

File "/opt/stack/horizon/openstack_dashboard/utils/futurist_utils.py" in call_functions_parallel
  50.     return tuple(f.result() for f in futures)

File "/opt/stack/horizon/openstack_dashboard/utils/futurist_utils.py" in <genexpr>
  50.     return tuple(f.result() for f in futures)

File "/usr/lib/python3.6/concurrent/futures/_base.py" in result
  425.                 return self.__get_result()

File "/usr/lib/python3.6/concurrent/futures/_base.py" in __get_result
  384.             raise self._exception

File "/usr/local/lib/python3.6/dist-packages/futurist/_utils.py" in run
  52.             result = self.fn(*self.args, **self.kwargs)

File "/opt/stack/horizon/openstack_dashboard/dashboards/project/instances/views.py" in _get_volumes
  147.             exceptions.handle(self.request, ignore=True)

File "/opt/stack/horizon/openstack_dashboard/dashboards/project/instances/views.py" in _get_volumes
  144.             volumes = api.cinder.volume_list(self.request)

File "/opt/stack/horizon/openstack_dashboard/api/cinder.py" in volume_list
  296.         sort_dir=sort_dir)

File "/opt/stack/horizon/openstack_dashboard/api/cinder.py" in volume_list_paged
  333.     c_client = _cinderclient_with_generic_groups(request)

File "/opt/stack/horizon/openstack_dashboard/api/cinder.py" in _cinderclient_with_generic_groups
  285.     return _cinderclient_with_features(request, 'groups')

File "/opt/stack/horizon/openstack_dashboard/api/cinder.py" in _cinderclient_with_features
  267.     version = get_microversion(request, features)

File "/opt/stack/horizon/openstack_dashboard/api/cinder.py" in get_microversion
  260.                                                         insecure, cacert)

File "/usr/local/lib/python3.6/dist-packages/cinderclient/client.py" in get_server_version
  117.         data = json.loads(response.text)

File "/usr/lib/python3.6/json/__init__.py" in loads
  354.         return _default_decoder.decode(s)

File "/usr/lib/python3.6/json/decoder.py" in decode
  339.         obj, end = self.raw_decode(s, idx=_w(s, 0).end())

File "/usr/lib/python3.6/json/decoder.py" in raw_decode
  357.             raise JSONDecodeError("Expecting value", s, err.value) from None

Exception Type: JSONDecodeError at /project/instances/
Exception Value: Expecting value: line 1 column 1 (char 0)

Upvotes: 0

Views: 2532

Answers (2)

ocsi
ocsi

Reputation: 11

This solved for me horizon query problem under ubuntu 18.04 :

sudo systemctl restart devstack@*

Restart all devstack services.

Upvotes: 1

blazingkin
blazingkin

Reputation: 572

I was able to fix this problem by restarting my database, and then by restarting the Cinder service. On my devstack setup, that consisted of running sudo service mysql restart and sudo service devstack@c-api restart

The problem was that Cinder was not responding to the request that the horizon dashboard. As can be seen in your stack trace here

File "/usr/local/lib/python3.6/dist-packages/cinderclient/client.py" in get_server_version
  117.         data = json.loads(response.text)

A further diagnosis, is that by running the command openstack volume list (which calls the cinder api) returns Internal Server Error (HTTP 500)

Upvotes: 1

Related Questions