wmjie / ibm-db

Automatically exported from code.google.com/p/ibm-db
0 stars 0 forks source link

Problem found while neutron-db-manage after upgrading alembic from 0.6 to 0.7.2 #166

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Prepare for the environment: 
   RHEL 7.0 + DB2 10.5 FP5 + OSEE kilo build (alembic 0.7.2)
2. Reproduce the problem by the following command:
/usr/bin/neutron-db-manage --config-file /etc/neutron/neutron.conf 
--config-file /etc/neutron/plugin.ini --config-file 
/etc/neutron/plugins/ml2/ml2_conf.ini upgrade head

What is the expected output? What do you see instead?
1) Expected output: The neutron-db-manage command should succeed.
2) Failed with the following error:
+ /usr/bin/neutron-db-manage --config-file /etc/neutron/neutron.conf 
--config-file /etc/neutron/plugin.ini --config-file 
/etc/neutron/plugins/ml2/ml2_conf.ini upgrade head
INFO  [alembic.migration] Context impl IbmDbImpl.
INFO  [alembic.migration] Will assume transactional DDL.
INFO  [alembic.migration] Running upgrade  -> havana, havana_initial
INFO  [alembic.migration] Running upgrade havana -> e197124d4b9, add unique 
constraint to members
Traceback (most recent call last):
  File "/usr/bin/neutron-db-manage", line 10, in <module>
    sys.exit(main())
  File "/usr/lib/python2.7/site-packages/neutron/db/migration/cli.py", line 200, in main
    CONF.command.func(config, CONF.command.name)
  File "/usr/lib/python2.7/site-packages/neutron/db/migration/cli.py", line 93, in do_upgrade_downgrade
    do_alembic_command(config, cmd, revision, sql=CONF.command.sql)
  File "/usr/lib/python2.7/site-packages/neutron/db/migration/cli.py", line 71, in do_alembic_command
    getattr(alembic_command, cmd)(config, *args, **kwargs)
  File "/usr/lib/python2.7/site-packages/alembic/command.py", line 165, in upgrade
    script.run_env()
  File "/usr/lib/python2.7/site-packages/alembic/script.py", line 382, in run_env
    util.load_python_file(self.dir, 'env.py')
  File "/usr/lib/python2.7/site-packages/alembic/util.py", line 241, in load_python_file
    module = load_module_py(module_id, path)
  File "/usr/lib/python2.7/site-packages/alembic/compat.py", line 79, in load_module_py
    mod = imp.load_source(module_id, path, fp)
  File "/usr/lib/python2.7/site-packages/neutron/db/migration/alembic_migrations/env.py", line 116, in <module>
    run_migrations_online()
  File "/usr/lib/python2.7/site-packages/neutron/db/migration/alembic_migrations/env.py", line 107, in run_migrations_online
    context.run_migrations()
  File "<string>", line 7, in run_migrations
  File "/usr/lib/python2.7/site-packages/alembic/environment.py", line 742, in run_migrations
    self.get_context().run_migrations(**kw)
  File "/usr/lib/python2.7/site-packages/alembic/migration.py", line 312, in run_migrations
    head_maintainer.update_to_step(step)
  File "/usr/lib/python2.7/site-packages/alembic/migration.py", line 494, in update_to_step
    self._update_version(from_, to_)
  File "/usr/lib/python2.7/site-packages/alembic/migration.py", line 456, in _update_version
    if not self.context.as_sql and ret.rowcount != 1:
AttributeError: 'NoneType' object has no attribute 'rowcount'
+ RET=1
+ '[' 1 -ne 0 ']'
+ echo 'Neutron database migration failed.'
Neutron database migration failed.
+ exit 1
+ '[' 1 -ne 0 ']'
+ echo 'HALT: step090.neutron.sh failed.'
HALT: step090.neutron.sh failed.

What version of the product are you using? On what operating system?
RHEL 7.0 + DB2 10.5 FP5 + OSEE kilo build (alembic 0.7.2)

Please provide any additional information below.
N/A

Original issue reported on code.google.com by gekun0...@gmail.com on 22 Dec 2014 at 11:20

GoogleCodeExporter commented 9 years ago
Thanks for opening this issue, This regression is due to overridden _exec() 
method in ibm_db_alembic is not returns any value but Alembic-0.7.x requires it.

Original comment by rahul.pr...@in.ibm.com on 22 Dec 2014 at 11:30

GoogleCodeExporter commented 9 years ago
I have committed the changes requires for this in git branch with change log 
https://code.google.com/p/ibm-db/source/detail?r=2af95a9ad70403042faec7d25b54434
811a3b714&repo=ibm-db-alembic.

Original comment by rahul.pr...@in.ibm.com on 22 Dec 2014 at 11:31