Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.

Bug 1784897

Summary: Horizon container fails to start with "OSError: No translation files found for default language en."
Product: Red Hat OpenStack Reporter: Matthew Secaur <msecaur>
Component: python-django-horizonAssignee: RHOS Maint <rhos-maint>
Status: CLOSED DUPLICATE QA Contact: Beth White <beth.white>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 16.0 (Train)CC: athomas, jrist, kejones, rdopiera
Target Milestone: ---   
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2020-01-06 08:20:31 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Matthew Secaur 2019-12-18 15:48:53 UTC
Description of problem:

After building a RHOSP16-beta All-in-One environment, the dashboard is unavailable. The horizon container constantly restarts and the container logs show an error.


Version-Release number of selected component (if applicable): 
16-beta


How reproducible:
Build a RHOSP 16-beta all-in-one environment and examine the container logs for horizon.


Steps to Reproduce:
1. Install all-in-one RHOSP 16-beta
2. Validate that the dashboard is not available
3. Run 'podman logs horizon' and view the errors.

Actual results:
Dashboard is not available.


Expected results:
Should be able to access the dashboard.


Additional info:
Here is the exception from the horizon container:

Traceback (most recent call last):
  File "/usr/bin/manage.py", line 23, in <module>
    execute_from_command_line(sys.argv)
  File "/usr/lib/python3.6/site-packages/django/core/management/__init__.py", line 371, in execute_from_command_line
    utility.execute()
  File "/usr/lib/python3.6/site-packages/django/core/management/__init__.py", line 347, in execute
    django.setup()
  File "/usr/lib/python3.6/site-packages/django/__init__.py", line 24, in setup
    apps.populate(settings.INSTALLED_APPS)
  File "/usr/lib/python3.6/site-packages/django/apps/registry.py", line 112, in populate
    app_config.import_models()
  File "/usr/lib/python3.6/site-packages/django/apps/config.py", line 198, in import_models
    self.models_module = import_module(models_module_name)
  File "/usr/lib64/python3.6/importlib/__init__.py", line 126, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 994, in _gcd_import
  File "<frozen importlib._bootstrap>", line 971, in _find_and_load
  File "<frozen importlib._bootstrap>", line 955, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 665, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 678, in exec_module
  File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
  File "/usr/lib/python3.6/site-packages/django/contrib/auth/models.py", line 94, in <module>
    class Group(models.Model):
  File "/usr/lib/python3.6/site-packages/django/db/models/base.py", line 152, in __new__
    new_class.add_to_class(obj_name, obj)
  File "/usr/lib/python3.6/site-packages/django/db/models/base.py", line 315, in add_to_class
    value.contribute_to_class(cls, name)
  File "/usr/lib/python3.6/site-packages/django/db/models/fields/related.py", line 1586, in contribute_to_class
    self.remote_field.through = create_many_to_many_intermediary_model(self, cls)
  File "/usr/lib/python3.6/site-packages/django/db/models/fields/related.py", line 1051, in create_many_to_many_intermediary_model
    'verbose_name': _('%(from)s-%(to)s relationship') % {'from': from_, 'to': to},
  File "/usr/lib/python3.6/site-packages/django/utils/functional.py", line 148, in __mod__
    return str(self) % rhs
  File "/usr/lib/python3.6/site-packages/django/utils/functional.py", line 112, in __text_cast
    return func(*self.__args, **self.__kw)
  File "/usr/lib/python3.6/site-packages/django/utils/translation/__init__.py", line 77, in gettext
    return _trans.gettext(message)
  File "/usr/lib/python3.6/site-packages/django/utils/translation/trans_real.py", line 312, in gettext
    _default = _default or translation(settings.LANGUAGE_CODE)
  File "/usr/lib/python3.6/site-packages/django/utils/translation/trans_real.py", line 221, in translation
    _translations[language] = DjangoTranslation(language)
  File "/usr/lib/python3.6/site-packages/django/utils/translation/trans_real.py", line 127, in __init__
    raise IOError("No translation files found for default language %s." % settings.LANGUAGE_CODE)
OSError: No translation files found for default language en.

Comment 1 Matthew Secaur 2019-12-18 17:57:38 UTC
Horizon container information:

registry.redhat.io/rhosp-beta/openstack-horizon:16.0-57

Comment 2 Kevin Jones 2019-12-29 02:28:45 UTC
Seeing this as well in a full 3 controller 4 compute RHOSP 16-beta overcloud.

WARNING:root:"dashboards" and "default_dashboard" in (local_)settings is DEPRECATED now and may be unsupported in some future release. The preferred way to specify the order of dashboards and the default dashboard is the pluggable dashboard mechanism (in /usr/lib/python3.6/site-packages/openstack_dashboard/enabled, /usr/lib/python3.6/site-packages/openstack_dashboard/local/enabled).
Traceback (most recent call last):
  File "/usr/bin/manage.py", line 23, in <module>
    execute_from_command_line(sys.argv)
  File "/usr/lib/python3.6/site-packages/django/core/management/__init__.py", line 371, in execute_from_command_line
    utility.execute()
  File "/usr/lib/python3.6/site-packages/django/core/management/__init__.py", line 347, in execute
    django.setup()
  File "/usr/lib/python3.6/site-packages/django/__init__.py", line 24, in setup
    apps.populate(settings.INSTALLED_APPS)
  File "/usr/lib/python3.6/site-packages/django/apps/registry.py", line 112, in populate
    app_config.import_models()
  File "/usr/lib/python3.6/site-packages/django/apps/config.py", line 198, in import_models
    self.models_module = import_module(models_module_name)
  File "/usr/lib64/python3.6/importlib/__init__.py", line 126, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 994, in _gcd_import
  File "<frozen importlib._bootstrap>", line 971, in _find_and_load
  File "<frozen importlib._bootstrap>", line 955, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 665, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 678, in exec_module
  File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
  File "/usr/lib/python3.6/site-packages/django/contrib/auth/models.py", line 94, in <module>
    class Group(models.Model):
  File "/usr/lib/python3.6/site-packages/django/db/models/base.py", line 152, in __new__
    new_class.add_to_class(obj_name, obj)
  File "/usr/lib/python3.6/site-packages/django/db/models/base.py", line 315, in add_to_class
    value.contribute_to_class(cls, name)
  File "/usr/lib/python3.6/site-packages/django/db/models/fields/related.py", line 1586, in contribute_to_class
    self.remote_field.through = create_many_to_many_intermediary_model(self, cls)
  File "/usr/lib/python3.6/site-packages/django/db/models/fields/related.py", line 1051, in create_many_to_many_intermediary_model
    'verbose_name': _('%(from)s-%(to)s relationship') % {'from': from_, 'to': to},
  File "/usr/lib/python3.6/site-packages/django/utils/functional.py", line 148, in __mod__
    return str(self) % rhs
  File "/usr/lib/python3.6/site-packages/django/utils/functional.py", line 112, in __text_cast
    return func(*self.__args, **self.__kw)
  File "/usr/lib/python3.6/site-packages/django/utils/translation/__init__.py", line 77, in gettext
    return _trans.gettext(message)
  File "/usr/lib/python3.6/site-packages/django/utils/translation/trans_real.py", line 312, in gettext
    _default = _default or translation(settings.LANGUAGE_CODE)
  File "/usr/lib/python3.6/site-packages/django/utils/translation/trans_real.py", line 221, in translation
    _translations[language] = DjangoTranslation(language)
  File "/usr/lib/python3.6/site-packages/django/utils/translation/trans_real.py", line 127, in __init__
    raise IOError("No translation files found for default language %s." % settings.LANGUAGE_CODE)
OSError: No translation files found for default language en.

Comment 3 Kevin Jones 2019-12-29 02:29:19 UTC
[root@overcloud-controller-1 containers]# podman ps | grep horizon
fde875664458  dir16.ctlplane.ccoe.lab:8787/rhosp-beta/openstack-horizon:16.0-57                 dumb-init --singl...  2 hours ago  Up Less than a second ago         horizon

Comment 4 Kevin Jones 2019-12-29 04:34:58 UTC
I pulled and ran the 15.0-62 and 16.0-57 openstack-horizon images. Admittedly not really knowing what I'm looking for. I see these differences in locale directories between the two.

[root@kj-t470s ~]# podman exec -it horizon-15 bash
()[root@be4d222d9477 /]# find / -name locale                                
/usr/share/locale
/usr/share/openstack-dashboard/openstack_dashboard/locale
/usr/share/puppet/locale
/usr/lib/locale
/usr/lib/python3.6/site-packages/heat_dashboard/locale
/usr/lib/python3.6/site-packages/ironic_ui/locale
/usr/lib/python3.6/site-packages/django/contrib/admin/locale
/usr/lib/python3.6/site-packages/django/contrib/flatpages/locale
/usr/lib/python3.6/site-packages/django/contrib/sites/locale
/usr/lib/python3.6/site-packages/django/contrib/humanize/locale
/usr/lib/python3.6/site-packages/django/contrib/gis/locale
/usr/lib/python3.6/site-packages/django/contrib/contenttypes/locale
/usr/lib/python3.6/site-packages/django/contrib/sessions/locale
/usr/lib/python3.6/site-packages/django/contrib/auth/locale
/usr/lib/python3.6/site-packages/django/contrib/redirects/locale
/usr/lib/python3.6/site-packages/django/contrib/admindocs/locale
/usr/lib/python3.6/site-packages/django/contrib/postgres/locale
/usr/lib/python3.6/site-packages/django/conf/locale
/usr/lib/python3.6/site-packages/horizon/locale
/usr/lib/python3.6/site-packages/oslo_service/locale
/usr/lib/python3.6/site-packages/neutron_lbaas_dashboard/locale
/usr/lib/python3.6/site-packages/keystonemiddleware/locale
/usr/lib/python3.6/site-packages/sahara_dashboard/locale
/usr/lib/python3.6/site-packages/openstack_auth/locale
/usr/lib/python3.6/site-packages/oslo_reports/locale
/usr/lib/python3.6/site-packages/octavia_dashboard/locale
/usr/lib/python3.6/site-packages/manila_ui/locale
/usr/bin/locale
()[root@be4d222d9477 /]# ls /usr/lib/python3.6/site-packages/horizon/locale
ar  ca	cs  de	en_AU  en_GB  eo  es  es_MX  fi_FI  fil  fr  hi  hu  id  it  ja  ko_KR	nl_NL  pa_IN  pl_PL  pt  pt_BR	ru  sl_SI  sr  tr_TR  zh_CN  zh_TW

[root@kj-t470s ~]# podman exec -it horizon-16 bash
()[root@e1354f42c3cd /]# ls /usr/lib/python3.6/site-packages/horizon/locale
ls: cannot access '/usr/lib/python3.6/site-packages/horizon/locale': No such file or directory
()[root@e1354f42c3cd /]# find / -name locale
/usr/share/locale
/usr/share/puppet/locale
/usr/lib/locale
/usr/lib/python3.6/site-packages/django/conf/locale
/usr/lib/python3.6/site-packages/oslo_service/locale
/usr/lib/python3.6/site-packages/keystonemiddleware/locale
/usr/lib/python3.6/site-packages/openstack_auth/locale
/usr/lib/python3.6/site-packages/oslo_reports/locale
/usr/lib/python3.6/site-packages/octavia_dashboard/locale
/usr/lib/python3.6/site-packages/manila_ui/locale
/usr/bin/locale

Comment 5 Kevin Jones 2019-12-29 19:17:13 UTC
I switched back to the openstack-horizon:15.0-62 image and now it is running stable. Has the old theme and Shadowman, but is stable.

(undercloud) [stack@dir16 ~]$ cat containers-prepare-parameter.yaml
# Generated with the following on 2019-12-26T12:16:46.319529
#
#   openstack tripleo container image prepare default --local-push-destination --output-env-file /home/stack/containers-prepare-parameter.yaml
#

parameter_defaults:
  ContainerImagePrepare:
  - push_destination: true
    excludes:
    - openstack-horizon
    set:
      ceph_alertmanager_image: alertmanager
      ceph_alertmanager_namespace: docker.io/prom
      ceph_alertmanager_tag: v0.16.2
      ceph_grafana_image: grafana
      ceph_grafana_namespace: docker.io/grafana
      ceph_grafana_tag: 5.2.4
      ceph_image: rhceph-4-rhel8
      ceph_namespace: registry.redhat.io/rhceph-beta
      ceph_node_exporter_image: node-exporter
      ceph_node_exporter_namespace: docker.io/prom
      ceph_node_exporter_tag: v0.17.0
      ceph_prometheus_image: prometheus
      ceph_prometheus_namespace: docker.io/prom
      ceph_prometheus_tag: v2.7.2
      ceph_tag: 4-8
      name_prefix: openstack-
      name_suffix: ''
      namespace: registry.redhat.io/rhosp-beta
      neutron_driver: ovn
      rhel_containers: false
      tag: 16.0
    tag_from_label: '{version}-{release}'
  - push_destination: true
    includes:
    - openstack-horizon
    set:
      namespace: registry.redhat.io/rhosp-beta
      tag: 15.0-62
  ContainerImageRegistryCredentials:
    registry.redhat.io:

[root@overcloud-controller-0 ~]# podman ps
CONTAINER ID  IMAGE                                                                             COMMAND               CREATED            STATUS                PORTS  NAMES
...
af90f4b64c8f  dir16.ctlplane.ccoe.lab:8787/rhosp-beta/openstack-horizon:15.0-62                 dumb-init --singl...  2 hours ago        Up 2 hours ago               horizon
...

Comment 6 Radomir Dopieralski 2020-01-06 08:20:31 UTC

*** This bug has been marked as a duplicate of bug 1784425 ***