← Back to team overview

yahoo-eng-team team mailing list archive

[Bug 1361235] Re: visit horizon failure because of import module failure

 

** Changed in: horizon
       Status: In Progress => Fix Released

-- 
You received this bug notification because you are a member of Yahoo!
Engineering Team, which is subscribed to OpenStack Dashboard (Horizon).
https://bugs.launchpad.net/bugs/1361235

Title:
  visit horizon failure because of import module failure

Status in OpenStack Dashboard (Horizon):
  Fix Released
Status in openstack-ansible:
  Fix Released
Status in osprofiler:
  In Progress
Status in python-mistralclient:
  Fix Released
Status in tripleo:
  Fix Released

Bug description:
  1. Use TripleO to deploy both undercloud, and overcloud, and enable horizon when building images.
  2. Visit horizon portal always failure, and has below errors in horizon_error.log

  [Wed Aug 20 01:45:58.441221 2014] [:error] [pid 5035:tid 3038755648] [remote 10.74.104.27:54198] mod_wsgi (pid=5035): Exception occurred processing WSGI script '/opt/stack/venvs/openstack/lib/python2.7/site-packages/openstack_dashboard/wsgi/django.wsgi'.
  [Wed Aug 20 01:45:58.441273 2014] [:error] [pid 5035:tid 3038755648] [remote 10.74.104.27:54198] Traceback (most recent call last):
  [Wed Aug 20 01:45:58.441294 2014] [:error] [pid 5035:tid 3038755648] [remote 10.74.104.27:54198]   File "/opt/stack/venvs/openstack/lib/python2.7/site-packages/django/core/handlers/wsgi.py", line 187, in __call__
  [Wed Aug 20 01:45:58.449979 2014] [:error] [pid 5035:tid 3038755648] [remote 10.74.104.27:54198]     self.load_middleware()
  [Wed Aug 20 01:45:58.450000 2014] [:error] [pid 5035:tid 3038755648] [remote 10.74.104.27:54198]   File "/opt/stack/venvs/openstack/lib/python2.7/site-packages/django/core/handlers/base.py", line 44, in load_middleware
  [Wed Aug 20 01:45:58.450556 2014] [:error] [pid 5035:tid 3038755648] [remote 10.74.104.27:54198]     for middleware_path in settings.MIDDLEWARE_CLASSES:
  [Wed Aug 20 01:45:58.450576 2014] [:error] [pid 5035:tid 3038755648] [remote 10.74.104.27:54198]   File "/opt/stack/venvs/openstack/lib/python2.7/site-packages/django/conf/__init__.py", line 54, in __getattr__
  [Wed Aug 20 01:45:58.454248 2014] [:error] [pid 5035:tid 3038755648] [remote 10.74.104.27:54198]     self._setup(name)
  [Wed Aug 20 01:45:58.454269 2014] [:error] [pid 5035:tid 3038755648] [remote 10.74.104.27:54198]   File "/opt/stack/venvs/openstack/lib/python2.7/site-packages/django/conf/__init__.py", line 49, in _setup
  [Wed Aug 20 01:45:58.454305 2014] [:error] [pid 5035:tid 3038755648] [remote 10.74.104.27:54198]     self._wrapped = Settings(settings_module)
  [Wed Aug 20 01:45:58.454319 2014] [:error] [pid 5035:tid 3038755648] [remote 10.74.104.27:54198]   File "/opt/stack/venvs/openstack/lib/python2.7/site-packages/django/conf/__init
  __.py", line 128, in __init__
  [Wed Aug 20 01:45:58.454338 2014] [:error] [pid 5035:tid 3038755648] [remote 10.74.104.27:54198]     mod = importlib.import_module(self.SETTINGS_MODULE)
  [Wed Aug 20 01:45:58.454350 2014] [:error] [pid 5035:tid 3038755648] [remote 10.74.104.27:54198]   File "/opt/stack/venvs/openstack/lib/python2.7/site-packages/django/utils/importlib.py", line 40, in import_module
  [Wed Aug 20 01:45:58.462806 2014] [:error] [pid 5035:tid 3038755648] [remote 10.74.104.27:54198]     __import__(name)
  [Wed Aug 20 01:45:58.462826 2014] [:error] [pid 5035:tid 3038755648] [remote 10.74.104.27:54198]   File "/opt/stack/venvs/openstack/lib/python2.7/site-packages/openstack_dashboard/wsgi/../../openstack_dashboard/settings.py", line 28, in <module>
  [Wed Aug 20 01:45:58.467136 2014] [:error] [pid 5035:tid 3038755648] [remote 10.74.104.27:54198]     from openstack_dashboard import exceptions
  [Wed Aug 20 01:45:58.467156 2014] [:error] [pid 5035:tid 3038755648] [remote 10.74.104.27:54198]   File "/opt/stack/venvs/openstack/lib/python2.7/site-packages/openstack_dashboard/wsgi/../../openstack_dashboard/exceptions.py", line 22, in <module>
  [Wed Aug 20 01:45:58.467667 2014] [:error] [pid 5035:tid 3038755648] [remote 10.74.104.27:54198]     from keystoneclient import exceptions as keystoneclient
  [Wed Aug 20 01:45:58.467685 2014] [:error] [pid 5035:tid 3038755648] [remote 10.74.104.27:54198]   File "/opt/stack/venvs/openstack/lib/python2.7/site-packages/openstack_dashboard/wsgi/../../keystoneclient/__init__.py", line 28, in <module>
  [Wed Aug 20 01:45:58.472968 2014] [:error] [pid 5035:tid 3038755648] [remote 10.74.104.27:54198]     from keystoneclient import client
  [Wed Aug 20 01:45:58.472989 2014] [:error] [pid 5035:tid 3038755648] [remote 10.74.104.27:54198]   File "/opt/stack/venvs/openstack/lib/python2.7/site-packages/openstack_dashboard/wsgi/../../keystoneclient/client.py", line 13, in <module>
  [Wed Aug 20 01:45:58.473833 2014] [:error] [pid 5035:tid 3038755648] [remote 10.74.104.27:54198]     from keystoneclient import discover
  [Wed Aug 20 01:45:58.473851 2014] [:error] [pid 5035:tid 3038755648] [remote 10.74.104.27:54198]   File "/opt/stack/venvs/openstack/lib/python2.7/site-packages/openstack_dashboard/wsgi/../../keystoneclient/discover.py", line 19, in <module>
  [Wed Aug 20 01:45:58.474163 2014] [:error] [pid 5035:tid 3038755648] [remote 10.74.104.27:54198]     from keystoneclient import session as client_session
  [Wed Aug 20 01:45:58.474182 2014] [:error] [pid 5035:tid 3038755648] [remote 10.74.104.27:54198]   File "/opt/stack/venvs/openstack/lib/python2.7/site-packages/openstack_dashboard/wsgi/../../keystoneclient/session.py", line 27, in <module>
  [Wed Aug 20 01:45:58.482131 2014] [:error] [pid 5035:tid 3038755648] [remote 10.74.104.27:54198]     osprofiler_web = importutils.try_import("osprofiler.web")
  [Wed Aug 20 01:45:58.482152 2014] [:error] [pid 5035:tid 3038755648] [remote 10.74.104.27:54198]   File "/opt/stack/venvs/openstack/lib/python2.7/site-packages/openstack_dashboard/wsgi/../../keystoneclient/openstack/common/importutils.py", line 71, in try_import
  [Wed Aug 20 01:45:58.482434 2014] [:error] [pid 5035:tid 3038755648] [remote 10.74.104.27:54198]     return import_module(import_str)
  [Wed Aug 20 01:45:58.482452 2014] [:error] [pid 5035:tid 3038755648] [remote 10.74.104.27:54198]   File "/opt/stack/venvs/openstack/lib/python2.7/site-packages/openstack_dashboard/wsgi/../../keystoneclient/openstack/common/importutils.py", line 57, in import_module
  [Wed Aug 20 01:45:58.482475 2014] [:error] [pid 5035:tid 3038755648] [remote 10.74.104.27:54198]     __import__(import_str)
  [Wed Aug 20 01:45:58.482495 2014] [:error] [pid 5035:tid 3038755648] [remote 10.74.104.27:54198]   File "/opt/stack/venvs/openstack/lib/python2.7/site-packages/openstack_dashboard/wsgi/../../osprofiler/__init__.py", line 23, in <module>
  [Wed Aug 20 01:45:58.487936 2014] [:error] [pid 5035:tid 3038755648] [remote 10.74.104.27:54198]     utils.import_modules_from_package("osprofiler._notifiers")
  [Wed Aug 20 01:45:58.487956 2014] [:error] [pid 5035:tid 3038755648] [remote 10.74.104.27:54198]   File "/opt/stack/venvs/openstack/lib/python2.7/site-packages/openstack_dashboard/wsgi/../../osprofiler/_utils.py", line 172, in import_modules_from_package
  [Wed Aug 20 01:45:58.488588 2014] [:error] [pid 5035:tid 3038755648] [remote 10.74.104.27:54198]     __import__(module_name)
  [Wed Aug 20 01:45:58.488615 2014] [:error] [pid 5035:tid 3038755648] [remote 10.74.104.27:54198] ValueError: Empty module name

  3. After troubleshooting, seems like function
  import_modules_from_package at _utils.py of osprofiler has one bug
  when file's path is /opt/stack/venvs/openstack/lib/python2.7/site-
  packages/openstack_dashboard/wsgi/../../osprofiler/_notifier/base.py.

  In this case, below line will always create new_package = ... osprofiler, then cause the error.
        new_package = ".".join(root.split(os.sep)).split("....")[1]

  One possible solution is to find the first "...."  from right to left,
  then use that as module_name.

To manage notifications about this bug go to:
https://bugs.launchpad.net/horizon/+bug/1361235/+subscriptions