config global.yml to install lbaas plugin into neutron server,and it crash on bootstrap(upgrading neutron database)

Bug #1642940 reported by Chao Guo on 2016-11-18
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
kolla
Medium
Unassigned

Bug Description

I'm using ubuntu-source and the stable/newton branch of kolla (version 3.0.1).
Wanna use lbaas, following the guide doc in the source, I edit kolla-build.yml like this:

[neutron-server-plugin-neutron-lbaas]
type = url
location = http://tarballs.openstack.org/neutron-lbaas/neutron-lbaas-9.0.0.tar.gz

this should be the correct package that I gonna use,and all images built successfully.

everything works, except the neutron_server container. It crashed on bootstrap(upgrading neutron database) and yielded the error log as follows:(it cause by the bootstrap command 'neutron-db-manage --config-file /etc/neutron/neutron.conf --config-file /etc/neutron/plugins/ml2/ml2_conf.ini upgrade head')

Traceback (most recent call last):
  File "/var/lib/kolla/venv/bin/neutron-db-manage", line 10, in <module>
    sys.exit(main())
  File "/var/lib/kolla/venv/local/lib/python2.7/site-packages/neutron/db/migration/cli.py", line 686, in main
    return_val |= bool(CONF.command.func(config, CONF.command.name))
  File "/var/lib/kolla/venv/local/lib/python2.7/site-packages/neutron/db/migration/cli.py", line 205, in do_upgrade
    run_sanity_checks(config, revision)
  File "/var/lib/kolla/venv/local/lib/python2.7/site-packages/neutron/db/migration/cli.py", line 670, in run_sanity_checks
    script_dir.run_env()
  File "/var/lib/kolla/venv/local/lib/python2.7/site-packages/alembic/script/base.py", line 407, in run_env
    util.load_python_file(self.dir, 'env.py')
  File "/var/lib/kolla/venv/local/lib/python2.7/site-packages/alembic/util/pyfiles.py", line 93, in load_python_file
    module = load_module_py(module_id, path)
  File "/var/lib/kolla/venv/local/lib/python2.7/site-packages/alembic/util/compat.py", line 79, in load_module_py
    mod = imp.load_source(module_id, path, fp)
  File "/var/lib/kolla/venv/local/lib/python2.7/site-packages/neutron/db/migration/alembic_migrations/env.py", line 24, in <module>
    from neutron.db.migration.models import head # noqa
  File "/var/lib/kolla/venv/local/lib/python2.7/site-packages/neutron/db/migration/models/head.py", line 65, in <module>
    utils.import_modules_recursively(os.path.dirname(models.__file__))
  File "/var/lib/kolla/venv/local/lib/python2.7/site-packages/neutron/common/utils.py", line 865, in import_modules_recursively
    modules.extend(import_modules_recursively(dir_))
  File "/var/lib/kolla/venv/local/lib/python2.7/site-packages/neutron/common/utils.py", line 861, in import_modules_recursively
    importlib.import_module(module)
  File "/usr/lib/python2.7/importlib/__init__.py", line 37, in import_module
    __import__(name)
ImportError: No module named setup

without the lbaas plugin, the neutron-db-manage command works fine,but crash after install lbaas plugin.
If there is any workaround, please let me know.

Chao Guo (jimmygc) wrote :

I'm sorry that i made a mistake on the title.
It must be "config kolla-build.yml to install lbaas plugin into neutron server,and it crash on bootstrap(upgrading neutron database) "

Chao Guo (jimmygc) wrote :

There is a review that fixes the installation of lbaas plugin when building from source,I applied this fix,but the result is the same.

It seems like that there is a missing module,but I looked into the kolla source code and learned that it's installed by pip,so it shouldn't have any missing module.

https://review.openstack.org/#/c/393435/

Chao Guo (jimmygc) wrote :

I find out the cause! It's sort of a python cache problem.

Figure out a workaround:
add this lines between before neutron-db-manage command in /usr/local/bin/kolla_neutron_extend_start script in the neutron_server image:
--------------------------------------------------
cd /home/neutron/; \
touch /home/neutron/patch.py; \
rm -f /home/neutron/patch.py; \
--------------------------------------------------

It works like a black magic.
Any one knows how to clean up this kind of cache, please let me know,thank you!

Jeffrey Zhang (jeffrey4l) wrote :

does the patch work?

and i do not your black magic works. ;(

Changed in kolla:
milestone: none → ocata-3
milestone: ocata-3 → ocata-2
Chao Guo (jimmygc) wrote :

I'm sorry,i didn't say it clearly.

the neutron-db-manage command is between touch and rm command。

It works for me on ububtu source image version 3.0.1,with both vpnaas and lbaas plugins installed on neutron-server image.
I tested both vpnaas and lbaas,and they both works.

Paul Bourke (pauldbourke) wrote :

I can't reproduce this.

Changed in kolla:
status: New → Triaged
importance: Undecided → Medium
Chao Guo (jimmygc) wrote :

Maybe it's due to difference of environment,My openstack nodes are ubuntu 16.04.

Changed in kolla:
milestone: ocata-2 → ocata-3
Jeffrey Zhang (jeffrey4l) wrote :

I saw this issue when backport neutron vpnaas patch into newton branch. https://review.openstack.org/419977

Changed in kolla:
milestone: ocata-3 → ocata-rc1
Jeffrey Zhang (jeffrey4l) wrote :

This is a know issue. bump to neutron 9.2 will fix this issue.

newton master has been fixed and it will be released soon.

Changed in kolla:
milestone: ocata-rc1 → 3.0.3
status: Triaged → Fix Committed
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers