openstack-dashboard failed to upgrade with custom theme

Bug #1812148 reported by Alok G Singh
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
OpenStack Dashboard Charm
Fix Released
Undecided
Seyeong Kim

Bug Description

The error seen is:

Setting up openstack-dashboard (3:13.0.1-0ubuntu4~cloud0) ...
Collecting and compressing static assets...
CommandError: An error occurred during rendering /usr/share/openstack-dashboard/openstack_dashboard/templates/_stylesheets.html: Couldn't find anything to import: /themes/default/variables
 Extensions: <NamespaceAdapterExtension>, <DjangoExtension>, <CompassExtension>
 Search path:
 on line 3 of themes/custom/_variables.scss
 imported from line 1 of u'string:9f15978b0c3553cd:\n // My Themes\n@import "/themes/custom/variables";\n\n// Horizon\n@import "/dashboard/scss/horizon.s'
 dpkg: error processing package openstack-dashboard (--configure):

Removing the custom themeing bits from /etc/openstack-dashbaord/local_settings.py allowed the upgrade to complete but of course, this customer does not have a custom theme any more.

Tags: sts
affects: cloud-archive → horizon (Ubuntu)
Revision history for this message
Corey Bryant (corey.bryant) wrote :

Hi Alok,

Thanks for reporting this. Can you give some additional details to help me recreate this? If there is a specific theme and static assets that you can provide that we can test with that would be useful.

Thanks,
Corey

Revision history for this message
Alok G Singh (alephnull-b) wrote :

Hey, the theme file is available at https://private-fileshare.canonical.com/~aloksingh/theme.tgz

This is deployed by attaching it as a resource to the openstack-dashboard charm and setting the custom-theme config parameter to true.

Revision history for this message
Seyeong Kim (seyeongkim) wrote :

This issue is happening because there is no 'default' theme in AVAILABLE_THEME

when custom theme imports default theme's file(scss)

I uploaded patch for this in case someone want to import default theme rather than creating whole theme seperatly.

tags: added: sts
Revision history for this message
Seyeong Kim (seyeongkim) wrote :
Seyeong Kim (seyeongkim)
affects: horizon (Ubuntu) → charm-openstack-dashboard
Changed in charm-openstack-dashboard:
assignee: nobody → Seyeong Kim (xtrusia)
Changed in charm-openstack-dashboard:
status: New → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to charm-openstack-dashboard (master)

Reviewed: https://review.openstack.org/632886
Committed: https://git.openstack.org/cgit/openstack/charm-openstack-dashboard/commit/?id=1534accb10360d1a9792415577d60760fe7ee134
Submitter: Zuul
Branch: master

commit 1534accb10360d1a9792415577d60760fe7ee134
Author: Seyeong Kim <email address hidden>
Date: Thu Jan 24 11:48:21 2019 +0900

    Adding default theme on AVAILABLE_THEME even if custom is enabled.

    In case custom theme imports default theme's scss file, upgrading
    openstack-dashboard pkg causes compression error. By adding default
    theme to AVAILABLE_THEME list, collectstatic collects proper default
    theme files to /var/lib/openstack-dashboard/static/ and custom theme
    can import proper files.

    Importing default theme's files seems to be normal when someone wants
    to modify default theme a little not creating whole theme.

    Closes-Bug: #1812148

    Change-Id: Ic1aa03387814a57dde876aa6d95e64b555152b7c

Changed in charm-openstack-dashboard:
status: In Progress → Fix Committed
James Page (james-page)
Changed in charm-openstack-dashboard:
milestone: none → 19.04
David Ames (thedac)
Changed in charm-openstack-dashboard:
status: Fix Committed → Fix Released
Revision history for this message
Drew Freiberger (afreiberger) wrote :

We have been having a recurrence of this with Q->R and R->S where the openstack-dashboard package removal seems to perhaps remove the custom theme, or move the directory where the custom theme is unpacked?

https://pastebin.canonical.com/p/y7GGMRKNR9/

Openstack-dashboard units still in config-changed failed state, the log shows:

2021-06-30 06:20:34 ERROR juju-log FATAL ERROR: Could not determine version of uninstalled package: openstack-dashboard

Run manually to dist-upgrade in openstack-dashboard/17. Error msg:

https://pastebin.canonical.com/p/6xjrXDGYmH/

Push the theme tarball to the units:

  juju scp theme.tgz openstack-dashboard/X:~/
  juju scp theme.tgz openstack-dashboard/Y:~/
  juju scp theme.tgz openstack-dashboard/Z:~/

Run the following on all three units to unpack the theme:
  sudo mkdir /usr/share/openstack-dashboard/openstack_dashboard/themes/custom
  sudo tar -xf /home/ubuntu/theme.tgz -C /usr/share/openstack-dashboard/openstack_dashboard/themes/custom/

Then re-run the dist-upgrade to allow openstack-dashboard package to complete configuration:
sudo apt-get --assume-yes --option Dpkg::Options::=--force-confnew --option Dpkg::Options::=--force-confdef dist-upgrade

I think somehow we need to make sure before package installs that we unpack the custom theme resource if custom-theme=true, because the config file points to it as needing to be rendered by 'manage.py migrate', but it doesn't exist due to the py2->py3 upgrade process.

This failure of openstack-dashboard to not install also holds up all of the python3-django-horizon, and other py3 dashboard packages from properly installing during upgrade.

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.