neutron-db-manage python importerror

asked 2014-05-01 16:39:43 -0500

geterdone gravatar image

updated 2016-02-18 07:16:12 -0500

Centos 6.5; following: http://docs.openstack.org/havana/inst...

It seems I need to create the schema in the empty neutron database, however when I run:

neutron-db-manage --config-file /etc/neutron/neutron.conf stamp head

I get the error:

No handlers could be found for logger "neutron.common.legacy"
Traceback (most recent call last):
  File "/usr/bin/neutron-db-manage", line 10, in <module>
    sys.exit(main())
  File "/usr/lib/python2.6/site-packages/neutron/db/migration/cli.py", line 143, in main
    CONF.command.func(config, CONF.command.name)
  File "/usr/lib/python2.6/site-packages/neutron/db/migration/cli.py", line 86, in do_stamp
    sql=CONF.command.sql)
  File "/usr/lib/python2.6/site-packages/neutron/db/migration/cli.py", line 59, in do_alembic_command
    getattr(alembic_command, cmd)(config, *args, **kwargs)
  File "/usr/lib/python2.6/site-packages/alembic/command.py", line 214, in stamp
    script.run_env()
  File "/usr/lib/python2.6/site-packages/alembic/script.py", line 191, in run_env
    util.load_python_file(self.dir, 'env.py')
  File "/usr/lib/python2.6/site-packages/alembic/util.py", line 186, in load_python_file
    module = imp.load_source(module_id, path, open(path, 'rb'))
  File "/usr/lib/python2.6/site-packages/neutron/db/migration/alembic_migrations/env.py", line 44, in <module>
    importutils.import_class(class_path)
  File "/usr/lib/python2.6/site-packages/neutron/openstack/common/importutils.py", line 35, in import_class
    traceback.format_exception(*sys.exc_info())))
ImportError: Class  cannot be found (['Traceback (most recent call last):\n', '  File "/usr/lib/python2.6/site-packages/neutron/openstack/common/importutils.py", line 30, in import_class\n    __import__(mod_str)\n', 'ValueError: Empty module name\n'])

I have a correct and tested database string in /etc/neutron/neutron.conf , along with the keystore auth, qpid section, etc/neutron/api-paste.ini authtoken, etc.

Any ideas on what it's looking for that's missing? All references to this error are people who did not have neutron.conf in a --config-file statement.

edit retag flag offensive close merge delete

Comments

Contents of neutron.conf: [DEFAULT]

rpc_backend = neutron.openstack.common.rpc.impl_qpid qpid_hostname = localhost qpid_port = 5672 qpid_username = guest qpid_password = guest

[quotas]

[agent] root_helper = sudo neutron-rootwrap /etc/neutron/rootwrap.conf

[keystone_authtoken] auth_host = localhost auth_protocol = http auth_port = 35357 admin_tenant_name = service admin_user = neutron admin_password = neutronpassword auth_url = http://localhost:35357/v2.0 auth_strategy = keystone signing_dir = $state_path/keystone-signing

[database] connection = postgresql://neutron:neutronpassword@localhost/neutron

[service_providers] api_paste_config = /etc/neutron/api-paste.ini

geterdone gravatar imagegeterdone ( 2014-05-01 16:45:57 -0500 )edit

5 answers

Sort by ยป oldest newest most voted
1

answered 2014-06-04 00:17:30 -0500

Venu Murthy gravatar image

updated 2014-06-04 00:28:53 -0500

We had the following error when starting the neutron-server on the Controller Node (we have a 3 node setup, one for Controller, Compute and Networking) The error was

neutron-db-check: ERROR: neutron database does not have version information. You must run the "neutron-db-manage stamp" command before starting neutron services.

This was fixed by using the below command and as was done by author of the first post. I am posting more details

neutron-db-manage --config-file /usr/share/neutron/neutron-dist.conf --config-file /etc/neutron/neutron.conf --config-file /etc/neutron/plugin.ini stamp head

This resulted in the following error

[root@controller ~]# service neutron-server start
**neutron-db-check: ERROR: you must upgrade the neutron database before starting neutron services.**

Solution to sort this was:

There are several "RPC_BACKEND" parameters throughout the config files and in the neutron.conf the value for the QPID (AMQP we had used) should be entered for the RPC_backend which is right below the #QPID comment if you are using QPID.

edit flag offensive delete link more
1

answered 2014-05-01 17:22:07 -0500

geterdone gravatar image

In IRC Sam-I-Am was helpful to point out core_plugin needed to be defined.

Thanks Sam!

edit flag offensive delete link more

Comments

Hi, Geterdone, can you share what steps you do a correct your issue? Some people can face the same issue and it would be helpful. Regards

Eduardo Gonzalez gravatar imageEduardo Gonzalez ( 2016-02-29 15:20:08 -0500 )edit
0

answered 2015-01-08 09:45:15 -0500

grkim gravatar image

how did you solve that problem?

edit flag offensive delete link more
0

answered 2014-05-03 06:16:30 -0500

akhil gravatar image

Hi ,

I am also facing the same error did you able to get solution.

edit flag offensive delete link more

Comments

Double-triple check your neutron.conf configuration. Make sure you have all the entries in my original question (qpid (centos) or rabbit (debian) info. Make sure you have keystore_authtoken info. Make sure you have database connection info. Make sure core_plugin is defined (with qpid or rabibit).

geterdone gravatar imagegeterdone ( 2014-05-04 08:51:51 -0500 )edit

In theory, the database should initialize the schema when you start neutron_server, you should not be REQUIRED to run neutron-db-manage unless maybe your running dev install.

geterdone gravatar imagegeterdone ( 2014-05-04 08:53:04 -0500 )edit
0

answered 2015-03-12 04:54:27 -0500

Diro_k gravatar image

Hi, i face the same problem, too. Did you fix it? how? thanks in advance...

edit flag offensive delete link more

Get to know Ask OpenStack

Resources for moderators

Question Tools

Stats

Asked: 2014-05-01 16:39:43 -0500

Seen: 5,445 times

Last updated: Feb 18 '16