ImportError: No module named api

Bug #1600281 reported by Derek Higgins
16
This bug affects 2 people
Affects Status Importance Assigned to Milestone
neutron
Fix Released
Medium
Doug Wiegley
Mitaka
Fix Released
Medium
Doug Wiegley
tripleo
Fix Released
Critical
Unassigned

Bug Description

The mitaka ci job is currently failing during the undercloud install with the following error

Stage[main]/Ceilometer::Keystone::Auth/Keystone::Resource::Service_identity[ceilometer]/Keystone_endpoint[regionOne/ceilometer::metering]/ensure: created^[[0m
Stage[main]/Neutron::Keystone::Auth/Keystone::Resource::Service_identity[neutron]/Keystone_endpoint[regionOne/neutron::network]/ensure: created^[[0m
Stage[main]/Neutron::Db::Sync/Exec[neutron-db-sync]/returns: No handlers could be found for logger "oslo_config.cfg"^[[0m
Stage[main]/Neutron::Db::Sync/Exec[neutron-db-sync]/returns: Traceback (most recent call last):^[[0m
Stage[main]/Neutron::Db::Sync/Exec[neutron-db-sync]/returns: File "/usr/bin/neutron-db-manage", line 10, in <module>^[[0m
Stage[main]/Neutron::Db::Sync/Exec[neutron-db-sync]/returns: sys.exit(main())^[[0m
Stage[main]/Neutron::Db::Sync/Exec[neutron-db-sync]/returns: File "/usr/lib/python2.7/site-packages/neutron/db/migration/cli.py", line 749, in main^[[0m
Stage[main]/Neutron::Db::Sync/Exec[neutron-db-sync]/returns: return_val |= bool(CONF.command.func(config, CONF.command.name))^[[0m
Stage[main]/Neutron::Db::Sync/Exec[neutron-db-sync]/returns: File "/usr/lib/python2.7/site-packages/neutron/db/migration/cli.py", line 223, in do_upgrade^[[0m
Stage[main]/Neutron::Db::Sync/Exec[neutron-db-sync]/returns: run_sanity_checks(config, revision)^[[0m
Stage[main]/Neutron::Db::Sync/Exec[neutron-db-sync]/returns: File "/usr/lib/python2.7/site-packages/neutron/db/migration/cli.py", line 731, in run_sanity_checks^[[0m
Stage[main]/Neutron::Db::Sync/Exec[neutron-db-sync]/returns: script_dir.run_env()^[[0m
Stage[main]/Neutron::Db::Sync/Exec[neutron-db-sync]/returns: File "/usr/lib/python2.7/site-packages/alembic/script/base.py", line 397, in run_env^[[0m
Stage[main]/Neutron::Db::Sync/Exec[neutron-db-sync]/returns: util.load_python_file(self.dir, 'env.py')^[[0m
Stage[main]/Neutron::Db::Sync/Exec[neutron-db-sync]/returns: File "/usr/lib/python2.7/site-packages/alembic/util/pyfiles.py", line 81, in load_python_file^[[0m
Stage[main]/Neutron::Db::Sync/Exec[neutron-db-sync]/returns: module = load_module_py(module_id, path)^[[0m
Stage[main]/Neutron::Db::Sync/Exec[neutron-db-sync]/returns: File "/usr/lib/python2.7/site-packages/alembic/util/compat.py", line 79, in load_module_py^[[0m
Stage[main]/Neutron::Db::Sync/Exec[neutron-db-sync]/returns: mod = imp.load_source(module_id, path, fp)^[[0m
Stage[main]/Neutron::Db::Sync/Exec[neutron-db-sync]/returns: File "/usr/lib/python2.7/site-packages/neutron/db/migration/alembic_migrations/env.py", line 25, in <module>^[[0m
Stage[main]/Neutron::Db::Sync/Exec[neutron-db-sync]/returns: from neutron.db.migration.models import head # noqa^[[0m
Stage[main]/Neutron::Db::Sync/Exec[neutron-db-sync]/returns: File "/usr/lib/python2.7/site-packages/neutron/db/migration/models/head.py", line 28, in <module>^[[0m
Stage[main]/Neutron::Db::Sync/Exec[neutron-db-sync]/returns: from neutron.db import bgp_db # noqa^[[0m
Stage[main]/Neutron::Db::Sync/Exec[neutron-db-sync]/returns: File "/usr/lib/python2.7/site-packages/neutron/db/bgp_db.py", line 26, in <module>^[[0m
Stage[main]/Neutron::Db::Sync/Exec[neutron-db-sync]/returns: from neutron_lib.api import validators^[[0m
Stage[main]/Neutron::Db::Sync/Exec[neutron-db-sync]/returns: ImportError: No module named api^[[0m
Stage[main]/Neutron::Db::Sync/Exec[neutron-db-sync]: Failed to call refresh: neutron-db-manage --config-file /etc/neutron/neutron.conf --config-file /etc/neutron/plugin.ini upgrade head returned 1 instead of one of [0]^[[0m
Stage[main]/Neutron::Db::Sync/Exec[neutron-db-sync]: neutron-db-manage --config-file /etc/neutron/neutron.conf --config-file /etc/neutron/plugin.ini upgrade head returned 1 instead of one of [0]^[[0m
Stage[main]/Swift::Keystone::Auth/Keystone::Resource::Service_identity[swift]/Keystone_user[swift]/ensure: created^[[0m

Revision history for this message
Derek Higgins (derekh) wrote :

Packages instal(from http://logs.openstack.org/63/339463/2/check-tripleo/gate-tripleo-ci-centos-7-ovb-ha-mitaka/3fedf6a/ )

python-neutronclient-4.1.3-0.20160613212515.eba0c38.el7.centos.noarch
python-neutron-8.1.3-0.20160707111454.c6c8284.el7.centos.noarch
openstack-neutron-openvswitch-8.1.3-0.20160707111454.c6c8284.el7.centos.noarch
python-neutron-lbaas-tests-8.1.3-0.20160630174842.ea61436.el7.centos.noarch
python-neutron-vpnaas-tests-8.1.3-0.20160614123905.fd203ab.el7.centos.noarch
openstack-neutron-common-8.1.3-0.20160707111454.c6c8284.el7.centos.noarch
python-neutron-lbaas-8.1.3-0.20160630174842.ea61436.el7.centos.noarch
python-neutron-fwaas-tests-8.1.3-0.20160615121817.cbe18b5.el7.centos.noarch
python-neutron-vpnaas-8.1.3-0.20160614123905.fd203ab.el7.centos.noarch
openstack-neutron-8.1.3-0.20160707111454.c6c8284.el7.centos.noarch
python-neutron-fwaas-8.1.3-0.20160615121817.cbe18b5.el7.centos.noarch
python-neutron-tests-8.1.3-0.20160707111454.c6c8284.el7.centos.noarch
python-neutron-lib-0.0.2-0.20160613195929.5b7bf43.el7.centos.noarch
openstack-neutron-ml2-8.1.3-0.20160707111454.c6c8284.el7.centos.noarch

Revision history for this message
Derek Higgins (derekh) wrote :

This patch introduced the line that is throwing the exception
from neutron_lib.api import validators

https://review.openstack.org/#/c/335324/3

Revision history for this message
Alfredo Moralejo (amoralej) wrote :

Note that this review in neutron passed the gate jobs because u-c for neutron-lib in stable/mitaka is 0.0.2 while last actual version of neutron-lib in stable/mitaka in https://github.com/openstack/neutron-lib is 0.0.1 , so this is an error in u-c that must be fixed also.

Revision history for this message
Alfredo Moralejo (amoralej) wrote :

Reproduce it in standalone (without tripleo):

# neutron-db-manage --config-file /etc/neutron/neutron.conf --config-file /etc/neutron/plugins/ml2/ml2_conf.ini upgrade head
No handlers could be found for logger "oslo_config.cfg"
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 749, 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 223, in do_upgrade
    run_sanity_checks(config, revision)
  File "/usr/lib/python2.7/site-packages/neutron/db/migration/cli.py", line 731, in run_sanity_checks
    script_dir.run_env()
  File "/usr/lib/python2.7/site-packages/alembic/script/base.py", line 397, in run_env
    util.load_python_file(self.dir, 'env.py')
  File "/usr/lib/python2.7/site-packages/alembic/util/pyfiles.py", line 81, 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/neutron/db/migration/alembic_migrations/env.py", line 25, in <module>
    from neutron.db.migration.models import head # noqa
  File "/usr/lib/python2.7/site-packages/neutron/db/migration/models/head.py", line 28, in <module>
    from neutron.db import bgp_db # noqa
  File "/usr/lib/python2.7/site-packages/neutron/db/bgp_db.py", line 26, in <module>
    from neutron_lib.api import validators
ImportError: No module named api

Alan Pevec (apevec)
Changed in neutron:
importance: Undecided → Critical
Revision history for this message
Alan Pevec (apevec) wrote :

neutron-lib 0.0.2 from master must be removed from stable/mitaka upper-constraints.txt
but before that this Neutron patch which depends on it must be reverted or required feature backported to neutron-lib stable/mitaka branch.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to neutron (stable/mitaka)

Fix proposed to branch: stable/mitaka
Review: https://review.openstack.org/340271

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to neutron (stable/mitaka)

Reviewed: https://review.openstack.org/340271
Committed: https://git.openstack.org/cgit/openstack/neutron/commit/?id=cda226b9da1d4e4b1c045609e3a8352674b772df
Submitter: Jenkins
Branch: stable/mitaka

commit cda226b9da1d4e4b1c045609e3a8352674b772df
Author: Derek Higgins <email address hidden>
Date: Mon Jul 11 10:38:10 2016 +0100

    Revert "Fix _get_id_for"

    This reverts commit 873ae308d02e1f3d4be53405b1d56960d9cb4565.

    This patch was using an api in neutron-lib that isn't present
    in the mitaka branch.

    Change-Id: Ie34a4fcd90f2c397868dc532aee9b19beb0a68b8
    Closes-Bug: #1600281

tags: added: in-stable-mitaka
tags: added: gate-failure
Revision history for this message
Ben Nemec (bnemec) wrote :

Dropping alert tag because I see the reverted package in the mitaka dlrn repo, so this should be fixed. In fact, I see a passed Mitaka job in the zuul status so I'm going to mark this fixed.

tags: removed: alert
Changed in tripleo:
status: Triaged → Fix Released
no longer affects: neutron
Revision history for this message
Doug Hellmann (doug-hellmann) wrote :

I've added neutron back to this bug report, because we need to sort out which version of neutron-lib is correct for mitaka. 0.0.2 was marked as part of the mitaka release, but its contents do not appear on the stable branch. Should we change the constraints list to only allow 0.0.1, or do we need 0.0.2 and therefore need to back port its contents into the correct branch?

Changed in neutron:
importance: Undecided → Medium
Revision history for this message
Armando Migliaccio (armando-migliaccio) wrote :
Changed in neutron:
status: New → Confirmed
assignee: nobody → Doug Wiegley (dougwig)
Changed in neutron:
status: Confirmed → Fix Released
Revision history for this message
Doug Hellmann (doug-hellmann) wrote : Fix included in openstack/neutron 8.2.0

This issue was fixed in the openstack/neutron 8.2.0 release.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.