zun-ui install collectstatic

Bug #1829871 reported by fatis
24
This bug affects 3 people
Affects Status Importance Assigned to Milestone
Zun UI
Invalid
Undecided
Unassigned

Bug Description

I have this problem trying to install zun-ui on rocky openstack at the step collectstatic:
importError: No module named xstatic.pkg.jquery

Revision history for this message
fatis (mohamed-el-amine) wrote :
description: updated
Revision history for this message
hongbin (hongbin034) wrote :
fatis (mohamed-el-amine)
affects: zun → zun-ui
Revision history for this message
hongbin (hongbin034) wrote :

@fatis,

Please provide the following information:

* Which version of OpenStack you installed (i.e. master, stable/stein, stable/rocky, etc.)
* Your output of this command: pip freeze

Revision history for this message
hongbin (hongbin034) wrote :
Revision history for this message
hongbin (hongbin034) wrote :

@fatis,

You could try the following command and let me know if it still doesn't resolve the problem.

  $ sudo pip install -r /opt/stack/horizon/requirements.txt

Revision history for this message
hongbin (hongbin034) wrote :

Note: replace '/opt/stack/horizon' with your horizon directory.

Revision history for this message
Beholder101 (vandensteen) wrote :

I can confirm the same error upon trying several clean installs. I am using OpenStack/Horizon stable:Rocky on Ubuntu 18/04 from the repositories. As such there is no requirements.txt file in the Horizon install directory.

Attached the 'pip freeze' from after the zun-ui install. If needed i can also provide a 'before' export.

Install process used:

git clone https://github.com/openstack/zun-ui
cd zun-ui
sudo pip install .

#### at this point the error starts to occur.

sudo cp zun_ui/enabled/* /usr/share/openstack-dashboard/openstack_dashboard/local/enabled/

sudo python /usr/share/openstack-dashboard/manage.py collectstatic
sudo python /usr/share/openstack-dashboard/manage.py compress

Revision history for this message
hongbin (hongbin034) wrote : Re: [Bug 1829871] Re: zun-ui install collectstatic

Perhaps, you can try the following:

  $ sudo pip install -c
https://git.openstack.org/cgit/openstack/requirements/plain/upper-constraints.txt?h=stable/rocky
-r
https://raw.githubusercontent.com/openstack/horizon/stable/rocky/requirements.txt

On Sun, May 26, 2019 at 1:25 PM Beholder101 <email address hidden> wrote:

> I can confirm the same error upon trying several clean installs. I am
> using OpenStack/Horizon stable:Rocky on Ubuntu 18/04 from the
> repositories. As such there is no requirements.txt file in the Horizon
> install directory.
>
> Attached the 'pip freeze' from after the zun-ui install. If needed i can
> also provide a 'before' export.
>
> Install process used:
>
> git clone https://github.com/openstack/zun-ui
> cd zun-ui
> sudo pip install .
>
> #### at this point the error starts to occur.
>
> sudo cp zun_ui/enabled/* /usr/share/openstack-
> dashboard/openstack_dashboard/local/enabled/
>
> sudo python /usr/share/openstack-dashboard/manage.py collectstatic
> sudo python /usr/share/openstack-dashboard/manage.py compress
>
> ** Attachment added: "Freeze-after.txt"
>
> https://bugs.launchpad.net/zun-ui/+bug/1829871/+attachment/5266817/+files/Freeze-after.txt
>
> --
> You received this bug notification because you are subscribed to Zun UI.
> Matching subscriptions: zun-ui
> https://bugs.launchpad.net/bugs/1829871
>
> Title:
> zun-ui install collectstatic
>
> Status in Zun UI:
> New
>
> Bug description:
> I have this problem trying to install zun-ui on rocky openstack at the
> step collectstatic:
> importError: No module named xstatic.pkg.jquery
>
> To manage notifications about this bug go to:
> https://bugs.launchpad.net/zun-ui/+bug/1829871/+subscriptions
>

Revision history for this message
Beholder101 (vandensteen) wrote :

I executed your suggested command and it changed/installed a few modules. Mostly downgrades on XStatic modules. Xstatic-jquery downgraded from 3.3.1.1 to 1.10.2.1.

The results afterwards are the same:

sudo python /usr/share/openstack-dashboard/manage.py collectstatic
Traceback (most recent call last):
  File "/usr/share/openstack-dashboard/manage.py", line 25, in <module>
    execute_from_command_line(sys.argv)
  File "/usr/local/lib/python2.7/dist-packages/django/core/management/__init__.py", line 364, in execute_from_command_line
    utility.execute()
  File "/usr/local/lib/python2.7/dist-packages/django/core/management/__init__.py", line 308, in execute
    settings.INSTALLED_APPS
  File "/usr/local/lib/python2.7/dist-packages/django/conf/__init__.py", line 56, in __getattr__
    self._setup(name)
  File "/usr/local/lib/python2.7/dist-packages/django/conf/__init__.py", line 41, in _setup
    self._wrapped = Settings(settings_module)
  File "/usr/local/lib/python2.7/dist-packages/django/conf/__init__.py", line 110, in __init__
    mod = importlib.import_module(self.SETTINGS_MODULE)
  File "/usr/lib/python2.7/importlib/__init__.py", line 37, in import_module
    __import__(name)
  File "/usr/share/openstack-dashboard/openstack_dashboard/settings.py", line 487, in <module>
    XSTATIC_MODULES, HORIZON_CONFIG)
  File "/usr/share/openstack-dashboard/openstack_dashboard/utils/settings.py", line 260, in get_xstatic_dirs
    module = import_module(module_name)
  File "/usr/lib/python2.7/importlib/__init__.py", line 37, in import_module
    __import__(name)
ImportError: No module named xstatic.pkg.jquery

Revision history for this message
hongbin (hongbin034) wrote :

OK. You might need to checkout the stable/rocky branch of the zun-ui. So, the installation steps should be:

  git clone -b stable/rocky https://github.com/openstack/zun-ui
  cd zun-ui
  sudo pip install .

If you already check the master branch, you might want to correct it:

  cd zun-ui
  sudo pip uninstall -r requirements.txt
  git checkout stable/rocky
  sudo pip install .
  rm /usr/share/openstack-dashboard/openstack_dashboard/local/enabled/*
  cp zun_ui/enabled/* /usr/share/openstack-dashboard/openstack_dashboard/local/enabled/

Revision history for this message
Beholder101 (vandensteen) wrote :

That did it. The Horizon/zun-ui combo is working now. Here is was thinking that the master branch would suffice. I hope this will also apply to fatis (the op)

This is what i did, per your suggestions:

cd zun-ui
sudo pip uninstall -r requirements.txt
git checkout stable/rocky
sudo pip install .
sudo rm /usr/share/openstack-dashboard/openstack_dashboard/local/enabled/*
sudo cp zun_ui/enabled/* /usr/share/openstack-dashboard/openstack_dashboard/local/enabled/

sudo python /usr/share/openstack-dashboard/manage.py collectstatic
sudo python /usr/share/openstack-dashboard/manage.py compress
sudo service apache2 restart

Revision history for this message
hongbin (hongbin034) wrote :

Cool. I am going to close this bug. Feel free to re-open it if it is still a problem.

Changed in zun-ui:
status: New → Invalid
Revision history for this message
tomas cribb (tomascribb) wrote :

Hi, I have the same problem. I'm using Ubuntu 18.04 with Openstack stein.
I've tried the post's workaround. but always i have the same error.

This is the error:

root@control01s:~/zun-ui# sudo python /usr/share/openstack-dashboard/manage.py collectstatic
Traceback (most recent call last):
  File "/usr/share/openstack-dashboard/manage.py", line 23, in <module>
    execute_from_command_line(sys.argv)
  File "/usr/local/lib/python2.7/dist-packages/django/core/management/__init__.py", line 364, in execute_from_command_line
    utility.execute()
  File "/usr/local/lib/python2.7/dist-packages/django/core/management/__init__.py", line 308, in execute
    settings.INSTALLED_APPS
  File "/usr/local/lib/python2.7/dist-packages/django/conf/__init__.py", line 56, in __getattr__
    self._setup(name)
  File "/usr/local/lib/python2.7/dist-packages/django/conf/__init__.py", line 41, in _setup
    self._wrapped = Settings(settings_module)
  File "/usr/local/lib/python2.7/dist-packages/django/conf/__init__.py", line 110, in __init__
    mod = importlib.import_module(self.SETTINGS_MODULE)
  File "/usr/lib/python2.7/importlib/__init__.py", line 37, in import_module
    __import__(name)
  File "/usr/local/lib/python2.7/dist-packages/zun_ui/test/settings.py", line 14, in <module>
    from horizon.test.settings import * # noqa: F403,H303
  File "/usr/local/lib/python2.7/dist-packages/horizon/test/settings.py", line 126, in <module>
    settings_utils.BASE_XSTATIC_MODULES, HORIZON_CONFIG
  File "/usr/share/openstack-dashboard/openstack_dashboard/utils/settings.py", line 260, in get_xstatic_dirs
    module = import_module(module_name)
  File "/usr/lib/python2.7/importlib/__init__.py", line 37, in import_module
    __import__(name)
ImportError: No module named xstatic.pkg.jquery

Revision history for this message
Oxyash (oxyash1) wrote :

have the same problem @ Ubuntu 18.04 Train Openstack

  File "/usr/share/openstack-dashboard/manage.py", line 25, in <module>
    execute_from_command_line(sys.argv)
  File "/usr/local/lib/python2.7/dist-packages/django/core/management/__init__.py", line 364, in execute_from_command_line
    utility.execute()
  File "/usr/local/lib/python2.7/dist-packages/django/core/management/__init__.py", line 308, in execute
    settings.INSTALLED_APPS
  File "/usr/local/lib/python2.7/dist-packages/django/conf/__init__.py", line 56, in __getattr__
    self._setup(name)
  File "/usr/local/lib/python2.7/dist-packages/django/conf/__init__.py", line 41, in _setup
    self._wrapped = Settings(settings_module)
  File "/usr/local/lib/python2.7/dist-packages/django/conf/__init__.py", line 110, in __init__
    mod = importlib.import_module(self.SETTINGS_MODULE)
  File "/usr/lib/python2.7/importlib/__init__.py", line 37, in import_module
    __import__(name)
  File "/usr/share/openstack-dashboard/openstack_dashboard/settings.py", line 366, in <module>
    XSTATIC_MODULES, HORIZON_CONFIG)
  File "/usr/share/openstack-dashboard/openstack_dashboard/utils/settings.py", line 288, in get_xstatic_dirs
    module = import_module(module_name)
  File "/usr/lib/python2.7/importlib/__init__.py", line 37, in import_module
    __import__(name)

Revision history for this message
Oxyash (oxyash1) wrote :

ImportError: No module named xstatic.pkg.jquery

Revision history for this message
Oxyash (oxyash1) wrote :

ok find it.

ll services use python 2.7 and Horizon use 3.6 you need to install dashboard via pip3 instead of pip to make it run with horizon

Revision history for this message
samos667 (samos667) wrote :

I having the same error.
some information of my environnement:
-openstack version: stein
-os: ubuntu 18.04 TLS

What i did for resolve the issue (Made from a snapshot previous the installation that caused the error):
# git clone https://github.com/openstack/zun-ui
# cd zun-ui/
# git checkout
# apt install python3-pip
# pip3 install .
# cp zun_ui/enabled/* /usr/share/openstack-dashboard/openstack_dashboard/local/enabled/
# python3 /usr/share/openstack-dashboard/manage.py collectstatic
# python3 /usr/share/openstack-dashboard/manage.py compress
# service apache2 restart

I think that necessary to update the installation instructions in the official docs and github.

Revision history for this message
samos667 (samos667) wrote :

I almost forgot to thank @oxyash1 for directing me on the right road.

Revision history for this message
samos667 (samos667) wrote :

edit for command "git chekout", i have forgot to specified the branch in my awnser, the correct command is:

# git checkout stable/stein

Revision history for this message
hongbin (hongbin034) wrote :

@samos667,

Thanks for the information. I will update the document accordingly.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Related fix proposed to zun-ui (master)

Related fix proposed to branch: master
Review: https://review.opendev.org/695886

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Related fix merged to zun-ui (master)

Reviewed: https://review.opendev.org/695886
Committed: https://git.openstack.org/cgit/openstack/zun-ui/commit/?id=020e9ad7dd9a8ab0f3bb91034d5b8f9b34ecc09b
Submitter: Zuul
Branch: master

commit 020e9ad7dd9a8ab0f3bb91034d5b8f9b34ecc09b
Author: Hongbin Lu <email address hidden>
Date: Mon Nov 25 11:44:03 2019 +0000

    Update installation docs

    * Add a note about python3 installation
    * Fix the order of install steps

    Change-Id: Ia5c1b3eae55196a3bc2cc38d90890985cd41ecea
    Related-Bug: #1829871

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

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