Canonical-pike setup: cinder-api broken, fails to import _LE from i18n

Bug #1717891 reported by Noopur Shukla
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
cinder (Ubuntu)
Expired
Undecided
Unassigned

Bug Description

Not able to access cinder api,
Logs: /var/log/apache2/cinder_error.log
ImportError: cannot import name _LE
2017-09-18 12:58:38.182724 mod_wsgi (pid=13764): Target WSGI script '/usr/bin/cinder-wsgi' cannot be loaded as Python module.
2017-09-18 12:58:38.182750 mod_wsgi (pid=13764): Exception occurred processing WSGI script '/usr/bin/cinder-wsgi'.
2017-09-18 12:58:38.182811 Traceback (most recent call last):
2017-09-18 12:58:38.182859 File "/usr/bin/cinder-wsgi", line 6, in <module>
2017-09-18 12:58:38.182908 from cinder.wsgi.wsgi import initialize_application
2017-09-18 12:58:38.182916 File "/usr/lib/python2.7/dist-packages/cinder/wsgi/wsgi.py", line 32, in <module>
2017-09-18 12:58:38.182948 from cinder import rpc
2017-09-18 12:58:38.182953 File "/usr/lib/python2.7/dist-packages/cinder/rpc.py", line 36, in <module>
2017-09-18 12:58:38.182965 import cinder.context
2017-09-18 12:58:38.182970 File "/usr/lib/python2.7/dist-packages/cinder/context.py", line 29, in <module>
2017-09-18 12:58:38.182978 from cinder import policy
2017-09-18 12:58:38.182982 File "/usr/lib/python2.7/dist-packages/cinder/policy.py", line 23, in <module>
2017-09-18 12:58:38.182989 from cinder import exception
2017-09-18 12:58:38.183004 File "/usr/lib/python2.7/dist-packages/cinder/exception.py", line 35, in <module>
2017-09-18 12:58:38.183012 from cinder.i18n import _, _LE

When took a look at /usr/lib/python2.7/dist-packages/cinder/i18n.py, found that _LE is missing over here.

import oslo_i18n as i18n

DOMAIN = 'cinder'

_translators = i18n.TranslatorFactory(domain=DOMAIN)

# The primary translation function using the well-known name "_"
_ = _translators.primary

def enable_lazy(enable=True):
    return i18n.enable_lazy(enable)

def translate(value, user_locale=None):
    return i18n.translate(value, user_locale)

def get_available_languages():
    return i18n.get_available_languages(DOMAIN)

affects: software-properties (Ubuntu) → cinder (Ubuntu)
Revision history for this message
Corey Bryant (corey.bryant) wrote :

Hello Noopur,

Thank you for taking time to report this issue. It appears that the version of /usr/lib/python2.7/dist-packages/cinder/exception.py that you have is from Ocata. Can you please paste the results of 'dpkg -l | grep cinder' to the bug?

Thanks,
Corey

Changed in cinder (Ubuntu):
status: New → Incomplete
Revision history for this message
Akshay Ranade (akshaysr) wrote :

Hi Corey, We are also facing the same issue pasting here the requested result:

ubuntu@vm6:~$ dpkg -l | grep cinder
ii cinder-api 2:11.0.0-0ubuntu2~cloud0 all Cinder storage service - API server
ii cinder-backup 2:11.0.0-0ubuntu2~cloud0 all Cinder storage service - Scheduler server
ii cinder-common 2:11.0.0-0ubuntu2~cloud0 all Cinder storage service - common files
ii cinder-scheduler 2:11.0.0-0ubuntu2~cloud0 all Cinder storage service - Scheduler server
ii cinder-volume 2:11.0.0-0ubuntu2~cloud0 all Cinder storage service - Volume server
ii python-cinder 2:11.0.0-0ubuntu2~cloud0 all Cinder Python libraries

Revision history for this message
Corey Bryant (corey.bryant) wrote :

Hi Akshay,

I'm unable to recreate this, unfortunately. Are there any more details that you can share to help me reproduce this?

The following line of code in cinder/exception.py changed from this in ocata:
  from cinder.i18n import _, _LE
to this in pike:
  from cinder.i18n import _

And the following line of code in cinder/i18n.py existed in ocata but was removed in pike:
  _LE = _translators.log_error

I just tested an install of cinder-api from ocata, that I then upgraded to pike, these files are updated correctly as described above.

Is there any chance that you had an upgrade from ocata->pike that failed?

Thanks,
Corey

Revision history for this message
Launchpad Janitor (janitor) wrote :

[Expired for cinder (Ubuntu) because there has been no activity for 60 days.]

Changed in cinder (Ubuntu):
status: Incomplete → Expired
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.