[next][queens] Horizon Errors out on first login or first access to a given dashboard unit: TypeError: coercing to Unicode: need string or buffer, NoneType found

Bug #1754508 reported by Dmitrii Shcherbakov
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Dashboard Charm
Invalid
Critical
Liam Young
heat-dashboard (Ubuntu)
Fix Released
High
James Page

Bug Description

bundle:
https://paste.ubuntu.com/p/whdWff4KYy/

I am getting "something went wrong" page periodically while using Horizon with Queens:

https://paste.ubuntu.com/p/B8K8fv24RH/

[Thu Mar 08 22:16:41.491638 2018] [wsgi:error] [pid 68565:tid 140145296692992] No handlers could be found for logger "neutron_lbaas_dashboard.dashboards.project.ngloadbalancersv2.panel"
[Thu Mar 08 22:16:42.219735 2018] [wsgi:error] [pid 68563:tid 140145296692992] Internal Server Error: /identity/
[Thu Mar 08 22:16:42.219772 2018] [wsgi:error] [pid 68563:tid 140145296692992] Traceback (most recent call last):
[Thu Mar 08 22:16:42.219777 2018] [wsgi:error] [pid 68563:tid 140145296692992] File "/usr/lib/python2.7/dist-packages/django/core/handlers/base.py", line 132, in get_response
...

[Thu Mar 08 22:16:42.219855 2018] [wsgi:error] [pid 68563:tid 140145296692992] enforcer = _get_enforcer()
[Thu Mar 08 22:16:42.219859 2018] [wsgi:error] [pid 68563:tid 140145296692992] File "/usr/lib/python2.7/dist-packages/openstack_auth/policy.py", line 64, in _get_enforcer
[Thu Mar 08 22:16:42.219863 2018] [wsgi:error] [pid 68563:tid 140145296692992] if os.path.isfile(enforcer.policy_path):
[Thu Mar 08 22:16:42.219877 2018] [wsgi:error] [pid 68563:tid 140145296692992] File "/usr/lib/python2.7/genericpath.py", line 37, in isfile
[Thu Mar 08 22:16:42.219882 2018] [wsgi:error] [pid 68563:tid 140145296692992] st = os.stat(path)
[Thu Mar 08 22:16:42.219885 2018] [wsgi:error] [pid 68563:tid 140145296692992] TypeError: coercing to Unicode: need string or buffer, NoneType found

It seems painfully similar to this but with a different dashboard plugin: https://bugs.launchpad.net/charm-openstack-dashboard/+bug/1712617

This is reproducible on a fresh installation and after any apache2 restart.

The reason is that heat_policy.json is not present in horizon's conf directory:

# heat policy is not present in a conf dir
root@juju-98ec86-6-lxd-8:~# locate heat_policy.json
/usr/lib/python2.7/dist-packages/heat_dashboard/conf/heat_policy.json

# again, nothing here
root@juju-98ec86-6-lxd-8:~# ls /usr/share/openstack-dashboard/openstack_dashboard/conf/
cinder_policy.d glance_policy.json keystonev3_policy.json nova_policy.d
cinder_policy.json keystone_policy.json neutron_policy.json nova_policy.json

root@juju-98ec86-6-lxd-8:~# grep -iP -A5 policy_files /etc/openstack-dashboard/local_settings.py
#POLICY_FILES_PATH = os.path.join(ROOT_PATH, "conf")

# Map of local copy of service policy files.
# Please insure that your identity policy file matches the one being used on
# your keystone servers. There is an alternate policy file that may be used
# in the Keystone v3 multi-domain case, policy.v3cloudsample.json.
--
POLICY_FILES = {
    'identity': 'keystonev3_policy.json',
    'compute': 'nova_policy.json',
    'volume': 'cinder_policy.json',
    'image': 'glance_policy.json',
    'orchestration': 'heat_policy.json', # <--- this is a problem

See this asciinema for a live demo

https://asciinema.org/a/QJwm8xRpULwZgLVx0DN3Vpa0u

After heat_policy.json is commented out the exception disappears.

This policy file needs to be present to make sure things work as expected.

Tags: cpe-onsite
Revision history for this message
Dmitrii Shcherbakov (dmitriis) wrote :
Liam Young (gnuoy)
Changed in charm-openstack-dashboard:
assignee: nobody → Liam Young (gnuoy)
Liam Young (gnuoy)
Changed in charm-openstack-dashboard:
status: New → Confirmed
importance: Undecided → High
importance: High → Critical
milestone: none → 18.02
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to charm-openstack-dashboard (master)

Fix proposed to branch: master
Review: https://review.openstack.org/551213

Changed in charm-openstack-dashboard:
status: Confirmed → In Progress
Ryan Beisner (1chb1n)
Changed in charm-openstack-dashboard:
milestone: 18.02 → 18.05
Revision history for this message
James Page (james-page) wrote :

This is actually a problem with the way the split out of heat from horizon is being managed in the packaging - the heat-dashboard package needs some updates to support this.

Changed in heat-dashboard (Ubuntu):
status: New → Triaged
importance: Undecided → High
Revision history for this message
Liam Young (gnuoy) wrote :

Marking charm bug as invalid inlight of the packaging fix

Changed in charm-openstack-dashboard:
status: In Progress → Invalid
James Page (james-page)
Changed in heat-dashboard (Ubuntu):
assignee: nobody → James Page (james-page)
status: Triaged → In Progress
milestone: none → ubuntu-18.03
Revision history for this message
Corey Bryant (corey.bryant) wrote :

This should be fixed as of heat-dashboard 1.0.2-0ubuntu2.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Change abandoned on charm-openstack-dashboard (master)

Change abandoned by Liam Young (<email address hidden>) on branch: master
Review: https://review.openstack.org/551213
Reason: Fixed in heat plugin package

Revision history for this message
Ryan Beisner (1chb1n) wrote :

heat-dashboard 1.0.2-0ubuntu2.1~cloud0 is currently released in the Queens cloud archive

Changed in heat-dashboard (Ubuntu):
status: In Progress → Fix Released
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.