Bug 1412153

Summary: OSP10 -> OSP11 upgrade fails during neutron-db-manage upgrade head
Product: Red Hat OpenStack Reporter: Marius Cornea <mcornea>
Component: rhosp-directorAssignee: mathieu bultel <mbultel>
Status: CLOSED ERRATA QA Contact: Marius Cornea <mcornea>
Severity: urgent Docs Contact:
Priority: unspecified    
Version: 11.0 (Ocata)CC: augol, dbecker, emacchi, jcoufal, mbultel, mburns, morazi, rhel-osp-director-maint, sathlang, yprokule
Target Milestone: Upstream M3Keywords: TestOnly, Triaged
Target Release: 11.0 (Ocata)   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2017-05-17 19:56:24 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 Marius Cornea 2017-01-11 12:07:19 UTC
Description of problem:
OSP10 -> OSP11 upgrade fails during neutron-db-manage upgrade head:

root@overcloud-serviceapi-0 heat-admin]# neutron-db-manage --config-file /etc/neutron/neutron.conf --config-file /etc/neutron/plugin.ini upgrade head
INFO  [alembic.runtime.migration] Context impl MySQLImpl.
INFO  [alembic.runtime.migration] Will assume non-transactional DDL.
  Running upgrade for neutron ...
INFO  [alembic.runtime.migration] Context impl MySQLImpl.
INFO  [alembic.runtime.migration] Will assume non-transactional DDL.
  OK
Traceback (most recent call last):
  File "/bin/neutron-db-manage", line 10, in <module>
    sys.exit(main())
  File "/usr/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 "/usr/lib/python2.7/site-packages/neutron/db/migration/cli.py", line 205, in do_upgrade
    run_sanity_checks(config, revision)
  File "/usr/lib/python2.7/site-packages/neutron/db/migration/cli.py", line 670, in run_sanity_checks
    script_dir.run_env()
  File "/usr/lib/python2.7/site-packages/alembic/script/base.py", line 407, in run_env
    util.load_python_file(self.dir, 'env.py')
  File "/usr/lib/python2.7/site-packages/alembic/util/pyfiles.py", line 93, in load_python_file
    module = load_module_py(module_id, path)
  File "/usr/lib/python2.7/site-packages/alembic/util/compat.py", line 79, in load_module_py
    mod = imp.load_source(module_id, path, fp)
  File "/usr/lib/python2.7/site-packages/bsnstacklib/plugins/bigswitch/db/migration/alembic_migrations/env.py", line 20, in <module>
    from neutron.db import model_base
ImportError: cannot import name model_base

This is most probably related to https://review.openstack.org/#/c/409809/

Version-Release number of selected component (if applicable):
python-networking-bigswitch-9.40.0-1.1.el7ost.noarch
openstack-neutron-bigswitch-lldp-9.40.0-1.1.el7ost.noarch
openstack-neutron-bigswitch-agent-9.40.0-1.1.el7ost.noarch

How reproducible:
100%

Steps to Reproduce:
1. Upgrade from OSP10 to OSP11

Actual results:
Upgrade fails.

Expected results:
Upgrade succeeds.

Comment 1 Sofer Athlan-Guyot 2017-01-11 12:17:27 UTC
By the look of the review, it looks like

      - python-UcsSdk
      - python-networking-bigswitch
      - openstack-neutron-bigswitch-lldp
      - openstack-neutron-bigswitch-agent

Sould be removed during the upgrade.   Going to check, but the problem should be upstream as well.

Comment 2 Sofer Athlan-Guyot 2017-01-11 12:52:12 UTC
We need a way to detect if bigswitch plugin is used to be able to conditionally delete it.

Comment 3 mathieu bultel 2017-01-11 16:14:48 UTC
The issue upstream is not related to the package above ^
It's related to the python-networking-odl package.

I'll fill a LP bug on it, maybe i'll try to submit a fix to the networking-old project

Comment 4 mathieu bultel 2017-01-12 11:32:27 UTC
I add a fix in the bigswitch code:
https://review.openstack.org/419422

The networking-odl is already fix but not in the dlrn repo, we need to get the latest release (from dec 8) 3.2.

For now to workaround the issue we can add in the UpgradeInitCommand:
yum remove -y python-UcsSdk openstack-neutron-bigswitch-agent python-networking-bigswitch openstack-neutron-bigswitch-lldp python-networking-odl

Comment 6 Amit Ugol 2017-01-25 08:48:21 UTC
*** Bug 1416124 has been marked as a duplicate of this bug. ***

Comment 7 errata-xmlrpc 2017-05-17 19:56:24 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHEA-2017:1245