Neutron fails to initialize with a core plugin not based on the Neutron DB model

Bug #1700651 reported by Édouard Thuleau
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
neutron
Fix Released
High
Édouard Thuleau

Bug Description

Since patch [1], Neutron server load a default service plugins list which all of them depends on the Neutron DB model. So for a core plugin which implements only the NeutronPluginBaseV2 interface [2] and not the NeutronDbPluginV2 interface [3], most of the service plugins of that list will be initialized without any errors (only the timestamp plugin fails to initialize because it tries to do DB stuff in its constructor [4] on master (future Pike release)).
And all API extensions of that service plugins are listed as supported but none of them works. Resources are not extended (tag, revision, auto-allocate) or some API extensions returns 404 (network-ip-availability or flavors).

[1] https://github.com/openstack/neutron/commit/aadf2f30f84dff3d85f380a7ff4e16dbbb0c6bb0#diff-9169a6595980d19b2649d5bedfff05ce
[2] https://github.com/openstack/neutron/blob/master/neutron/neutron_plugin_base_v2.py#L30
[3] https://github.com/openstack/neutron/blob/master/neutron/db/db_base_plugin_v2.py#L124
[4] https://github.com/openstack/neutron/blob/master/neutron/services/timestamp/timestamp_plugin.py#L32

Revision history for this message
Akihiro Motoki (amotoki) wrote :
Revision history for this message
Armando Migliaccio (armando-migliaccio) wrote :

Can you provide steps to repro so that we can get a snapshot of the stacktrace you observe, and better assess a solution to the issue you're facing?

Changed in neutron:
status: New → Incomplete
importance: Undecided → High
Revision history for this message
Édouard Thuleau (ethuleau) wrote :

As I explained, I get a stacktrace [0] only when Neutron tries to initialize the service plugin 'timestamp'. If I remove the 'timestamp' plugin from the list all other service plugins are loaded correctly but does not work.

I see that when I use the Contrail Neutron core plugin [1].
Installing/deploying Contrail is not a simple task but there is a devstack plugin [2] that permits to deploy it in a test/dev environment. That needs time because it needs to compile all Contrail code. You can find a local.conf I use to deploy it [3] (it should fail as Neutron fails to initialize the 'tiemstamp' service plugin).

[0] http://paste.openstack.org/show/614437/
[1] https://github.com/Juniper/contrail-neutron-plugin
[2] https://github.com/zioc/contrail-devstack-plugin
[3] http://paste.openstack.org/show/614435/

Revision history for this message
Armando Migliaccio (armando-migliaccio) wrote :

Thanks for the extra information. When you say "If I remove the 'timestamp' plugin from the list all other service plugins are loaded correctly but does not work", what do you mean exactly? The Neutron server fails to fulfill API requests (e.g. net-create/net-list)? Can you provide a stack trace for those too? Thanks.

Changed in neutron:
status: Incomplete → Confirmed
assignee: nobody → Armando Migliaccio (armando-migliaccio)
Revision history for this message
Armando Migliaccio (armando-migliaccio) wrote :

There was a patch I worked on to gracefully fail in case of unmet dependencies [1]. I wonder if we can tweak it a little bit to make sure that plugins like timestamp don't get in the way of loading something like the contrail plugin in case things don't work as they should. Let me put something up for review to see if you can get past the issues you're facing.

[1] https://review.openstack.org/#/c/351959

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

Fix proposed to branch: master
Review: https://review.openstack.org/518788

Changed in neutron:
status: Confirmed → In Progress
Revision history for this message
Armando Migliaccio (armando-migliaccio) wrote :

@Eduard: please check out the patch. This is based on our conversation at the Summit.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote :

Fix proposed to branch: master
Review: https://review.openstack.org/519078

Changed in neutron:
assignee: Armando Migliaccio (armando-migliaccio) → Édouard Thuleau (ethuleau)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to neutron (master)

Reviewed: https://review.openstack.org/518788
Committed: https://git.openstack.org/cgit/openstack/neutron/commit/?id=69d0047cfe969da02d44c036fc3c97a1bfdffc19
Submitter: Zuul
Branch: master

commit 69d0047cfe969da02d44c036fc3c97a1bfdffc19
Author: Armando Migliaccio <email address hidden>
Date: Thu Nov 9 12:24:04 2017 -0800

    Do not load default service plugins if core plugin is not DB based

    Some service plugins make the assumption that Neutron is running
    with a datastore (e.g. revision and timestamps). As the datastore
    setup is a responsibility of the Neutron core plugin, checking
    that this is indeed true avoids errors for those plugins that do
    not implement any DB backend (e.g. monolithic OpenContrail plugin).

    Change-Id: I872fa6e3c3925e521150d79bba864101d9a5f648
    Closes-bug: #1700651

Changed in neutron:
status: In Progress → Fix Released
Revision history for this message
OpenStack Infra (hudson-openstack) wrote :

Reviewed: https://review.openstack.org/519078
Committed: https://git.openstack.org/cgit/openstack/neutron/commit/?id=bcc57a4aed0b050c4d37fb73ced0c43aaabdc1a6
Submitter: Zuul
Branch: master

commit bcc57a4aed0b050c4d37fb73ced0c43aaabdc1a6
Author: Édouard Thuleau <email address hidden>
Date: Sun Nov 12 21:52:10 2017 +1100

    Add unit test to validate non DB base core plugin can be loaded

    Thanks to the patch I872fa6e3c3925e521150d79bba864101d9a5f648, if a core
    plugin is not based on the Neutron DB model, Neutron Manager does not
    fail anymore to initialize DB dependent default service plugins.

    Change-Id: I948876a7ea7acb0953f622c399dada2148f57571
    Partial-Bug: #1700651

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

Fix proposed to branch: stable/pike
Review: https://review.openstack.org/521561

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

Reviewed: https://review.openstack.org/521561
Committed: https://git.openstack.org/cgit/openstack/neutron/commit/?id=3985aec1f377f1e5b4edbd2dddab770dd0e66a3c
Submitter: Zuul
Branch: stable/pike

commit 3985aec1f377f1e5b4edbd2dddab770dd0e66a3c
Author: Armando Migliaccio <email address hidden>
Date: Thu Nov 9 12:24:04 2017 -0800

    Do not load default service plugins if core plugin is not DB based

    Some service plugins make the assumption that Neutron is running
    with a datastore (e.g. revision and timestamps). As the datastore
    setup is a responsibility of the Neutron core plugin, checking
    that this is indeed true avoids errors for those plugins that do
    not implement any DB backend (e.g. monolithic OpenContrail plugin).

    Change-Id: I872fa6e3c3925e521150d79bba864101d9a5f648
    Closes-bug: #1700651
    (cherry picked from commit 69d0047cfe969da02d44c036fc3c97a1bfdffc19)

tags: added: in-stable-pike
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/neutron 12.0.0.0b2

This issue was fixed in the openstack/neutron 12.0.0.0b2 development milestone.

tags: added: neutron-proactive-backport-potential
tags: removed: neutron-proactive-backport-potential
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/neutron 11.0.3

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

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

Other bug subscribers

Remote bug watches

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