Bug 1506272

Summary: octavia-db-manage upgrade head crashes
Product: Red Hat OpenStack Reporter: Or Idgar <oidgar>
Component: puppet-tripleoAssignee: Or Idgar <oidgar>
Status: CLOSED ERRATA QA Contact: Alexander Stafeyev <astafeye>
Severity: high Docs Contact:
Priority: high    
Version: 12.0 (Pike)CC: ihrachys, jjoyce, jlibosva, jschluet, lpeer, majopela, nyechiel, oidgar, slinaber, tvignaud
Target Milestone: rcKeywords: TechPreview, Triaged
Target Release: 12.0 (Pike)   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: puppet-tripleo-7.4.3-0.20171025110206.el7ost Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2017-12-13 22:18:18 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 Or Idgar 2017-10-25 14:32:43 UTC
Description of problem:
when running octavia-db-manage upgrade head in order to build the db, the command line fails and crashes. function trace is printed out.

Version-Release number of selected component (if applicable):


How reproducible:
Installing director with octavia. you'll see the logs by connecting to the controller and run "docker logs octavia_db_sync".

Steps to Reproduce:
1.setup deployed with jenkins job https://rhos-qe-jenkins.rhev-ci-vms.eng.rdu2.redhat.com/job/OSPD-Customized-Deployment-virt/1337/ 
2. connect to the controller with root user
3. type "docker logs octavia_db_sync"

Actual results:
Traceback (most recent call last):
  File "/usr/bin/octavia-db-manage", line 10, in <module>
    sys.exit(main())
  File "/usr/lib/python2.7/site-packages/octavia/db/migration/cli.py", line 132, in main
    CONF.command.func(config, CONF.command.name)
  File "/usr/lib/python2.7/site-packages/octavia/db/migration/cli.py", line 62, in do_upgrade
    do_alembic_command(config, cmd, revision, sql=CONF.command.sql)
  File "/usr/lib/python2.7/site-packages/octavia/db/migration/cli.py", line 30, in do_alembic_command
    getattr(alembic_cmd, cmd)(config, *args, **kwargs)
  File "/usr/lib/python2.7/site-packages/alembic/command.py", line 174, in upgrade
    script.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/octavia/db/migration/alembic_migrations/env.py", line 92, in <module>
    run_migrations_online()
  File "/usr/lib/python2.7/site-packages/octavia/db/migration/alembic_migrations/env.py", line 76, in run_migrations_online
    poolclass=pool.NullPool)
  File "/usr/lib64/python2.7/site-packages/sqlalchemy/engine/__init__.py", line 387, in create_engine
    return strategy.create(*args, **kwargs)
  File "/usr/lib64/python2.7/site-packages/sqlalchemy/engine/strategies.py", line 52, in create
    plugins = u._instantiate_plugins(kwargs)
AttributeError: 'NoneType' object has no attribute '_instantiate_plugins'


Expected results:
The output should be similar to this -
INFO  [alembic.runtime.migration] Context impl MySQLImpl.
INFO  [alembic.runtime.migration] Will assume non-transactional DDL.
INFO  [alembic.runtime.migration] Running upgrade  -> 35dee79d5865, initial_create
INFO  [alembic.runtime.migration] Running upgrade 35dee79d5865 -> 4c094013699a, update load balancer amphora relationship
INFO  [alembic.runtime.migration] Running upgrade 4c094013699a -> 13500e2e978d, update url and name size
.
.
.
.


Additional info:
In the undercloud machine you can find under /home/stack/overcloud_deploy.sh the overcloud's deployment script.

Comment 1 Nir Magnezi 2017-10-31 10:31:47 UTC
Or and myself looked at this issue and it seems like there was a problem with the DB creation during the installation process.

So in a similar concept to the what happens in the devstack plugin[1], it seems like it tried to populate the database but it never got created.

Or, please check and report how we can get more details here (debug level logs etc). we need to understand why that DB never got created.

[1] https://github.com/openstack/octavia/blob/master/devstack/plugin.sh#L281-L282

Comment 6 Alexander Stafeyev 2017-11-12 07:53:38 UTC
Or, 

Could you please let me know hen you have the setup deployed inorder to verify this bug ? 

tnx

Comment 8 Or Idgar 2017-11-22 09:49:08 UTC
Patch is included in the latest puddle. feel free to test it.

Comment 12 errata-xmlrpc 2017-12-13 22:18:18 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:3462