Legacy tasks adapter fails if run with graph without pre/post deployment stages

Bug #1635051 reported by Vladimir Kuklin
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Fuel for OpenStack
Fix Committed
High
Vladimir Kuklin
Mitaka
Fix Released
High
Vladimir Kuklin
Newton
Fix Committed
High
Vladimir Kuklin

Bug Description

2016-10-19 18:43:46.961 ERROR [7f2278c8e880] (manager) Transaction 261 failed.
Traceback (most recent call last):
  File "/usr/lib/python2.7/site-packages/nailgun/transactions/manager.py", line 333, in _execute_async
    self._execute_sync(sub_transaction)
  File "/usr/lib/python2.7/site-packages/nailgun/transactions/manager.py", line 364, in _execute_sync
    sub_transaction.cache.get('tasks'))
  File "/usr/lib/python2.7/site-packages/nailgun/transactions/manager.py", line 482, in _adjust_graph_tasks
    graph['tasks'], plugin_tasks, node_resolver
  File "/usr/lib/python2.7/site-packages/nailgun/task/legacy_tasks_adapter.py", line 120, in adapt_legacy_tasks
    start='post_deployment_start', end='post_deployment_end'
  File "/usr/lib/python2.7/site-packages/nailgun/orchestrator/orchestrator_graph.py", line 269, in find_subgraph
    working_graph.reverse(), end))
  File "/usr/lib/python2.7/site-packages/networkx/classes/digraph.py", line 1317, in subgraph
    for n in bunch:
  File "/usr/lib/python2.7/site-packages/networkx/classes/graph.py", line 1900, in bunch_iter
    for n in nlist:
  File "/usr/lib/python2.7/site-packages/networkx/algorithms/traversal/depth_first_search.py", line 207, in <genexpr>
    post=(v for u,v,d in nx.dfs_labeled_edges(G,source=source)
  File "/usr/lib/python2.7/site-packages/networkx/algorithms/traversal/depth_first_search.py", line 298, in dfs_labeled_edges
    stack = [(start,iter(G[start]))]
  File "/usr/lib/python2.7/site-packages/networkx/classes/graph.py", line 406, in __getitem__
    return self.adj[n]
KeyError: 'post_deployment_end'

in predicate one line earlier returns True while there is actually no such vertex in the graph. This breaks custom graphs without pre-/post- deployment stages running with legacy tasks adaptation for role-based deployment.

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

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

Changed in fuel:
status: Confirmed → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to fuel-web (stable/mitaka)

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

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to fuel-web (stable/newton)

Fix proposed to branch: stable/newton
Review: https://review.openstack.org/388910

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Change abandoned on fuel-web (stable/mitaka)

Change abandoned by Vladimir Kuklin (<email address hidden>) on branch: stable/mitaka
Review: https://review.openstack.org/388909

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Change abandoned on fuel-web (stable/newton)

Change abandoned by Vladimir Kuklin (<email address hidden>) on branch: stable/newton
Review: https://review.openstack.org/388910

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to fuel-web (master)

Reviewed: https://review.openstack.org/388907
Committed: https://git.openstack.org/cgit/openstack/fuel-web/commit/?id=efdd063170062d1bc881cd31c52bcee08bcdc9ee
Submitter: Jenkins
Branch: master

commit efdd063170062d1bc881cd31c52bcee08bcdc9ee
Author: Vladimir Kuklin <email address hidden>
Date: Thu Oct 20 00:30:09 2016 +0300

    Change predicate to detect legacy stages for role-based emulation

    Legacy tasks adapter checks if there are pre- and post- deployment
    stages for role-based emulation using in predicate. Unfortunately,
    it is broken due to legacy orchestrator graph constructor
    implementation and retunrs false positive results.
    Instead we should use safe get that works properly.

    Change-Id: I22d216af9933250c473c1ccfaa931d0b41cfb1f2
    Closes-bug: #1635051

Changed in fuel:
status: In Progress → Fix Committed
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to fuel-web (stable/newton)

Reviewed: https://review.openstack.org/388910
Committed: https://git.openstack.org/cgit/openstack/fuel-web/commit/?id=799c9c41f8300db6b905a091582ec53b702c92a7
Submitter: Jenkins
Branch: stable/newton

commit 799c9c41f8300db6b905a091582ec53b702c92a7
Author: Vladimir Kuklin <email address hidden>
Date: Thu Oct 20 00:30:09 2016 +0300

    Change predicate to detect legacy stages for role-based emulation

    Legacy tasks adapter checks if there are pre- and post- deployment
    stages for role-based emulation using in predicate. Unfortunately,
    it is broken due to legacy orchestrator graph constructor
    implementation and retunrs false positive results.
    Instead we should use safe get that works properly.

    Change-Id: I22d216af9933250c473c1ccfaa931d0b41cfb1f2
    Closes-bug: #1635051
    (cherry picked from commit efdd063170062d1bc881cd31c52bcee08bcdc9ee)

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

Reviewed: https://review.openstack.org/388909
Committed: https://git.openstack.org/cgit/openstack/fuel-web/commit/?id=5eaf7606d67d5890ff6838aec7a647393265b0de
Submitter: Jenkins
Branch: stable/mitaka

commit 5eaf7606d67d5890ff6838aec7a647393265b0de
Author: Vladimir Kuklin <email address hidden>
Date: Thu Oct 20 00:30:09 2016 +0300

    Change predicate to detect legacy stages for role-based emulation

    Legacy tasks adapter checks if there are pre- and post- deployment
    stages for role-based emulation using in predicate. Unfortunately,
    it is broken due to legacy orchestrator graph constructor
    implementation and retunrs false positive results.
    Instead we should use safe get that works properly.

    Change-Id: I22d216af9933250c473c1ccfaa931d0b41cfb1f2
    Closes-bug: #1635051

tags: added: on-verification
Revision history for this message
TatyanaGladysheva (tgladysheva) wrote :

Verified on 9.2 snapshot #801.

tags: removed: on-verification
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/fuel-web 11.0.0.0rc1

This issue was fixed in the openstack/fuel-web 11.0.0.0rc1 release candidate.

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.