← Back to team overview

yahoo-eng-team team mailing list archive

[Bug 1847210] [NEW] '--sql' option of neutron-db-manage does not work

 

Public bug reported:

Version: stable/stein

Log below.

(.stein) root@krane-pgstage-api1:~# neutron-db-manage upgrade 804a3c76314c --sql
  Running upgrade for neutron ...
INFO  [alembic.runtime.migration] Context impl MySQLImpl.
INFO  [alembic.runtime.migration] Generating static SQL
INFO  [alembic.runtime.migration] Will assume non-transactional DDL.
CREATE TABLE alembic_version (
    version_num VARCHAR(32) NOT NULL,
    CONSTRAINT alembic_version_pkc PRIMARY KEY (version_num)
)ENGINE=InnoDB;

INFO  [alembic.runtime.migration] Running upgrade  -> kilo
-- Running upgrade  -> kilo

Traceback (most recent call last):
  File "/opt/openstack/src/neutron/.stein/bin/neutron-db-manage", line 11, in <module>
    sys.exit(main())
  File "/opt/openstack/src/neutron/.stein/lib/python3.5/site-packages/neutron/db/migration/cli.py", line 656, in main
    return_val |= bool(CONF.command.func(config, CONF.command.name))
  File "/opt/openstack/src/neutron/.stein/lib/python3.5/site-packages/neutron/db/migration/cli.py", line 180, in do_upgrade
    desc=branch, sql=CONF.command.sql)
  File "/opt/openstack/src/neutron/.stein/lib/python3.5/site-packages/neutron/db/migration/cli.py", line 81, in do_alembic_command
    getattr(alembic_command, cmd)(config, *args, **kwargs)
  File "/opt/openstack/src/neutron/.stein/lib/python3.5/site-packages/alembic/command.py", line 276, in upgrade
    script.run_env()
  File "/opt/openstack/src/neutron/.stein/lib/python3.5/site-packages/alembic/script/base.py", line 475, in run_env
    util.load_python_file(self.dir, "env.py")
  File "/opt/openstack/src/neutron/.stein/lib/python3.5/site-packages/alembic/util/pyfiles.py", line 90, in load_python_file
    module = load_module_py(module_id, path)
  File "/opt/openstack/src/neutron/.stein/lib/python3.5/site-packages/alembic/util/compat.py", line 156, in load_module_py
    spec.loader.exec_module(module)
  File "<frozen importlib._bootstrap_external>", line 665, in exec_module
  File "<frozen importlib._bootstrap>", line 222, in _call_with_frames_removed
  File "/opt/openstack/src/neutron/.stein/lib/python3.5/site-packages/neutron/db/migration/alembic_migrations/env.py", line 118, in <module>
    run_migrations_offline()
  File "/opt/openstack/src/neutron/.stein/lib/python3.5/site-packages/neutron/db/migration/alembic_migrations/env.py", line 88, in run_migrations_offline
    context.run_migrations()
  File "<string>", line 8, in run_migrations
  File "/opt/openstack/src/neutron/.stein/lib/python3.5/site-packages/alembic/runtime/environment.py", line 839, in run_migrations
    self.get_context().run_migrations(**kw)
  File "/opt/openstack/src/neutron/.stein/lib/python3.5/site-packages/alembic/runtime/migration.py", line 361, in run_migrations
    step.migration_fn(**kw)
  File "/opt/openstack/src/neutron/.stein/lib/python3.5/site-packages/neutron/db/migration/alembic_migrations/versions/kilo_initial.py", line 52, in upgrade
    migration.pk_on_alembic_version_table()
  File "/opt/openstack/src/neutron/.stein/lib/python3.5/site-packages/neutron/db/migration/__init__.py", line 266, in pk_on_alembic_version_table
    inspector = reflection.Inspector.from_engine(op.get_bind())
  File "/opt/openstack/src/neutron/.stein/lib/python3.5/site-packages/sqlalchemy/engine/reflection.py", line 136, in from_engine
    return Inspector(bind)
  File "/opt/openstack/src/neutron/.stein/lib/python3.5/site-packages/sqlalchemy/engine/reflection.py", line 110, in __init__
    bind.connect().close()
AttributeError: 'NoneType' object has no attribute 'close'

** Affects: neutron
     Importance: Undecided
         Status: New

-- 
You received this bug notification because you are a member of Yahoo!
Engineering Team, which is subscribed to neutron.
https://bugs.launchpad.net/bugs/1847210

Title:
  '--sql' option of neutron-db-manage does not work

Status in neutron:
  New

Bug description:
  Version: stable/stein

  Log below.

  (.stein) root@krane-pgstage-api1:~# neutron-db-manage upgrade 804a3c76314c --sql
    Running upgrade for neutron ...
  INFO  [alembic.runtime.migration] Context impl MySQLImpl.
  INFO  [alembic.runtime.migration] Generating static SQL
  INFO  [alembic.runtime.migration] Will assume non-transactional DDL.
  CREATE TABLE alembic_version (
      version_num VARCHAR(32) NOT NULL,
      CONSTRAINT alembic_version_pkc PRIMARY KEY (version_num)
  )ENGINE=InnoDB;

  INFO  [alembic.runtime.migration] Running upgrade  -> kilo
  -- Running upgrade  -> kilo

  Traceback (most recent call last):
    File "/opt/openstack/src/neutron/.stein/bin/neutron-db-manage", line 11, in <module>
      sys.exit(main())
    File "/opt/openstack/src/neutron/.stein/lib/python3.5/site-packages/neutron/db/migration/cli.py", line 656, in main
      return_val |= bool(CONF.command.func(config, CONF.command.name))
    File "/opt/openstack/src/neutron/.stein/lib/python3.5/site-packages/neutron/db/migration/cli.py", line 180, in do_upgrade
      desc=branch, sql=CONF.command.sql)
    File "/opt/openstack/src/neutron/.stein/lib/python3.5/site-packages/neutron/db/migration/cli.py", line 81, in do_alembic_command
      getattr(alembic_command, cmd)(config, *args, **kwargs)
    File "/opt/openstack/src/neutron/.stein/lib/python3.5/site-packages/alembic/command.py", line 276, in upgrade
      script.run_env()
    File "/opt/openstack/src/neutron/.stein/lib/python3.5/site-packages/alembic/script/base.py", line 475, in run_env
      util.load_python_file(self.dir, "env.py")
    File "/opt/openstack/src/neutron/.stein/lib/python3.5/site-packages/alembic/util/pyfiles.py", line 90, in load_python_file
      module = load_module_py(module_id, path)
    File "/opt/openstack/src/neutron/.stein/lib/python3.5/site-packages/alembic/util/compat.py", line 156, in load_module_py
      spec.loader.exec_module(module)
    File "<frozen importlib._bootstrap_external>", line 665, in exec_module
    File "<frozen importlib._bootstrap>", line 222, in _call_with_frames_removed
    File "/opt/openstack/src/neutron/.stein/lib/python3.5/site-packages/neutron/db/migration/alembic_migrations/env.py", line 118, in <module>
      run_migrations_offline()
    File "/opt/openstack/src/neutron/.stein/lib/python3.5/site-packages/neutron/db/migration/alembic_migrations/env.py", line 88, in run_migrations_offline
      context.run_migrations()
    File "<string>", line 8, in run_migrations
    File "/opt/openstack/src/neutron/.stein/lib/python3.5/site-packages/alembic/runtime/environment.py", line 839, in run_migrations
      self.get_context().run_migrations(**kw)
    File "/opt/openstack/src/neutron/.stein/lib/python3.5/site-packages/alembic/runtime/migration.py", line 361, in run_migrations
      step.migration_fn(**kw)
    File "/opt/openstack/src/neutron/.stein/lib/python3.5/site-packages/neutron/db/migration/alembic_migrations/versions/kilo_initial.py", line 52, in upgrade
      migration.pk_on_alembic_version_table()
    File "/opt/openstack/src/neutron/.stein/lib/python3.5/site-packages/neutron/db/migration/__init__.py", line 266, in pk_on_alembic_version_table
      inspector = reflection.Inspector.from_engine(op.get_bind())
    File "/opt/openstack/src/neutron/.stein/lib/python3.5/site-packages/sqlalchemy/engine/reflection.py", line 136, in from_engine
      return Inspector(bind)
    File "/opt/openstack/src/neutron/.stein/lib/python3.5/site-packages/sqlalchemy/engine/reflection.py", line 110, in __init__
      bind.connect().close()
  AttributeError: 'NoneType' object has no attribute 'close'

To manage notifications about this bug go to:
https://bugs.launchpad.net/neutron/+bug/1847210/+subscriptions


Follow ups