Undercloud / Overcloud Heat stack fails on: YAQL list index out of range (includes upgrades cases)

Bug #1750032 reported by Dan Prince
22
This bug affects 3 people
Affects Status Importance Assigned to Milestone
YAQL
Fix Released
Undecided
Zane Bitter
tripleo
Fix Released
High
Thomas Herve

Bug Description

I rebased my undercloud-containers setup today (on a fresh VM) and found my stack creations were failing. Specifically the UndercloudHostsDeployment resource was failing in the heat stack.

This YAQL expression was failing:

dict($.data.where($ != null).flatten().selectMany($.items()).groupBy($[0], $[1], [$[0], $[1].flatten()]))

No recent changes in t-h-t around how we construct this expression or the data that gets passed in. On a hunch I downgraded the python yaql package and was able to resolve the issue.

---------

Removed:
  python2-yaql.noarch 0:1.1.3-2.el7

Installed:
  python2-yaql.noarch 0:1.1.0-3.el7

Dan Prince (dan-prince)
Changed in tripleo:
importance: Undecided → Medium
Changed in tripleo:
status: New → Triaged
milestone: none → queens-rc1
importance: Medium → High
Revision history for this message
Emilien Macchi (emilienm) wrote :
Changed in tripleo:
importance: High → Critical
summary: - Undercloud heat stack fails on: YAQL list index out of range
+ Undercloud / Overcloud Heat stack fails on: YAQL list index out of range
tags: added: alert ci promotion-blocker
Revision history for this message
Harald Jensås (harald-jensas) wrote : Re: Undercloud / Overcloud Heat stack fails on: YAQL list index out of range

Overcloud deploy fails with similar error. Ref: https://bugs.launchpad.net/tripleo/+bug/1749977

Probably same issue.

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

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

Changed in tripleo:
assignee: nobody → Emilien Macchi (emilienm)
status: Triaged → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to tripleo-heat-templates (master)

Reviewed: https://review.openstack.org/545498
Committed: https://git.openstack.org/cgit/openstack/tripleo-heat-templates/commit/?id=e897da3b690dd69883483d818e957fca85721622
Submitter: Zuul
Branch: master

commit e897da3b690dd69883483d818e957fca85721622
Author: Emilien Macchi <email address hidden>
Date: Fri Feb 16 17:27:24 2018 -0800

    Update YAQL queries with groupBy

    YAQL introduced a backward incompatible change in one of its minor
    versions:
    https://github.com/openstack/yaql/commit/3fb91784018de335440b01b3b069fe45dc53e025#diff-f36776b660e5fe4f88e3295e5b751396R215

    It changes the expected behavior of groupBy() aggregator, so we need to
    update our queries otherwise it fails with a "list index out of range"
    error.

    Change-Id: I2ca2ebb2c8d22aeedbcb6920072db5b6dba3311b
    Closes-Bug: #1750032
    Co-Authored-By: Alex Schultz <email address hidden>

Changed in tripleo:
status: In Progress → Fix Released
Revision history for this message
Dan Prince (dan-prince) wrote : Re: Undercloud / Overcloud Heat stack fails on: YAQL list index out of range

Would it be better for all projects using YAQL to revert the breaking change there instead. It seems like we shouldn't change how YAQL functions work and expect all projects to upgrade to this.

Also note the error here was really cryptic. I only pin-pointed the YAQL package by going in and adding LOG.debug statements to heat. I think several people were confused at the root cause of the issue because of the lack of logging around this...

Revision history for this message
Dan Prince (dan-prince) wrote :

sigh, it looks like that change was from 2016. Does it really take us a year to publish a new YAQL package?

Revision history for this message
Alan Pevec (apevec) wrote :

It was treated as a dependency in RDO rebuilt from Fedora and there were no updates there until update was pushed by Alfredo recently https://src.fedoraproject.org/rpms/python-yaql/pull-request/1
I'd suggest team(s) depending on yaql to take over ownership in Fedora and RDO.

tags: removed: alert
Alan Pevec (apevec)
tags: removed: promotion-blocker
Revision history for this message
Sofer Athlan-Guyot (sofer-athlan-guyot) wrote :

This needs backport:
 - for testing upgrade in mixed upgrade setup: In that case the undercloud is in queen with the new yaql and the overcloud fails to deploy[1]

 - support of operations on the overcloud after an upgrade of the overcloud.

[1] See this log with index failure: http://logs.openstack.org/62/545762/3/experimental/tripleo-ci-centos-7-scenario001-multinode-oc-upgrade/afc98a5/logs/undercloud/home/zuul/overcloud_deploy.log.txt.gz#_2018-02-19_09_48_54

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

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

Revision history for this message
Sofer Athlan-Guyot (sofer-athlan-guyot) wrote : Re: Undercloud / Overcloud Heat stack fails on: YAQL list index out of range

But then the original deployment will certainly fails ... not sure how to deal with both cases... Put the backport as WIP.

Revision history for this message
Sofer Athlan-Guyot (sofer-athlan-guyot) wrote :

Note, that it affect also mixed version for fast forward upgrade[1] (master undercloud/newton overcloud deployment)

[1] http://logs.openstack.org/86/525686/55/experimental/tripleo-ci-centos-7-scenario001-multinode-ffu-upgrade/5412555/logs/undercloud/home/zuul/overcloud_deploy.log.txt.gz

Revision history for this message
Bogdan Dobrelya (bogdando) wrote :

Shall we re-open it and put alert back then?

summary: Undercloud / Overcloud Heat stack fails on: YAQL list index out of range
+ (includes upgrades cases)
Changed in tripleo:
status: Fix Released → Triaged
importance: Critical → High
tags: added: upgrade
Revision history for this message
Bogdan Dobrelya (bogdando) wrote :

Cuz of remaining upgrades impact, I lowered it to high and re-opened with a new tag added. Hope that works and we need no to open another bug for the same issue.

Changed in tripleo:
assignee: Emilien Macchi (emilienm) → nobody
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Related fix proposed to tripleo-heat-templates (master)

Related fix proposed to branch: master
Review: https://review.openstack.org/545856

Revision history for this message
Zane Bitter (zaneb) wrote :

Proposed fix to YAQL itself for backwards compatibility: https://review.openstack.org/#/c/545996/

Changed in yaql:
status: New → In Progress
assignee: nobody → Zane Bitter (zaneb)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Related fix merged to tripleo-heat-templates (master)

Reviewed: https://review.openstack.org/545856
Committed: https://git.openstack.org/cgit/openstack/tripleo-heat-templates/commit/?id=0ddfff79ee5a5f62bb6de55b873bd16b811905f3
Submitter: Zuul
Branch: master

commit 0ddfff79ee5a5f62bb6de55b873bd16b811905f3
Author: Thomas Herve <email address hidden>
Date: Mon Feb 19 16:32:42 2018 +0100

    Do not use the 3rd argument of yaql groupBy

    Due to an incompatible change in yaql, it's hard to use the aggregration
    of groupBy as the behavior is completely different depending on the
    version. Let's try to not rely on it.

    Change-Id: I2887011f6baf4867d422579b116b5e143acf5679
    Related-Bug: #1750032

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Related fix proposed to tripleo-heat-templates (stable/pike)

Related fix proposed to branch: stable/pike
Review: https://review.openstack.org/546094

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Related fix proposed to tripleo-heat-templates (stable/ocata)

Related fix proposed to branch: stable/ocata
Review: https://review.openstack.org/546113

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Related fix proposed to tripleo-heat-templates (stable/newton)

Related fix proposed to branch: stable/newton
Review: https://review.openstack.org/546118

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Change abandoned on tripleo-heat-templates (stable/pike)

Change abandoned by Athlan-Guyot sofer (<email address hidden>) on branch: stable/pike
Review: https://review.openstack.org/545817
Reason: In favor of https://review.openstack.org/#/q/I2887011f6baf4867d422579b116b5e143acf5679

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Related fix merged to tripleo-heat-templates (stable/pike)

Reviewed: https://review.openstack.org/546094
Committed: https://git.openstack.org/cgit/openstack/tripleo-heat-templates/commit/?id=677c4c221696b16d10ac80709af4be49e6e334c2
Submitter: Zuul
Branch: stable/pike

commit 677c4c221696b16d10ac80709af4be49e6e334c2
Author: Thomas Herve <email address hidden>
Date: Mon Feb 19 16:32:42 2018 +0100

    Do not use the 3rd argument of yaql groupBy

    Due to an incompatible change in yaql, it's hard to use the aggregration
    of groupBy as the behavior is completely different depending on the
    version. Let's try to not rely on it.

    Change-Id: I2887011f6baf4867d422579b116b5e143acf5679
    Related-Bug: #1750032
    (cherry picked from commit 0ddfff79ee5a5f62bb6de55b873bd16b811905f3)

tags: added: in-stable-pike
Changed in tripleo:
status: Triaged → In Progress
assignee: nobody → Thomas Herve (therve)
status: In Progress → Fix Released
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Related fix merged to tripleo-heat-templates (stable/ocata)

Reviewed: https://review.openstack.org/546113
Committed: https://git.openstack.org/cgit/openstack/tripleo-heat-templates/commit/?id=dcd8a695bedad86f111cf38d204c84ce8d5bfb62
Submitter: Zuul
Branch: stable/ocata

commit dcd8a695bedad86f111cf38d204c84ce8d5bfb62
Author: Thomas Herve <email address hidden>
Date: Mon Feb 19 16:32:42 2018 +0100

    Do not use the 3rd argument of yaql groupBy

    Due to an incompatible change in yaql, it's hard to use the aggregration
    of groupBy as the behavior is completely different depending on the
    version. Let's try to not rely on it.

    Change-Id: I2887011f6baf4867d422579b116b5e143acf5679
    Related-Bug: #1750032
    (cherry picked from commit 0ddfff79ee5a5f62bb6de55b873bd16b811905f3)
    (cherry picked from commit 677c4c221696b16d10ac80709af4be49e6e334c2)

tags: added: in-stable-ocata
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Related fix merged to tripleo-heat-templates (stable/newton)

Reviewed: https://review.openstack.org/546118
Committed: https://git.openstack.org/cgit/openstack/tripleo-heat-templates/commit/?id=997475c9f545f2b2cee3647c75567d07699da3b4
Submitter: Zuul
Branch: stable/newton

commit 997475c9f545f2b2cee3647c75567d07699da3b4
Author: Thomas Herve <email address hidden>
Date: Mon Feb 19 16:32:42 2018 +0100

    Do not use the 3rd argument of yaql groupBy

    Due to an incompatible change in yaql, it's hard to use the aggregration
    of groupBy as the behavior is completely different depending on the
    version. Let's try to not rely on it.

    Change-Id: I2887011f6baf4867d422579b116b5e143acf5679
    Related-Bug: #1750032
    (cherry picked from commit 0ddfff79ee5a5f62bb6de55b873bd16b811905f3)
    (cherry picked from commit 677c4c221696b16d10ac80709af4be49e6e334c2)
    (cherry picked from commit dcd8a695bedad86f111cf38d204c84ce8d5bfb62)

tags: added: in-stable-newton
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/tripleo-heat-templates 8.0.0.0rc1

This issue was fixed in the openstack/tripleo-heat-templates 8.0.0.0rc1 release candidate.

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

Reviewed: https://review.openstack.org/545996
Committed: https://git.openstack.org/cgit/openstack/yaql/commit/?id=74cb81b28053ebe41e1e0031cfcb30f3039f0857
Submitter: Zuul
Branch: master

commit 74cb81b28053ebe41e1e0031cfcb30f3039f0857
Author: Zane Bitter <email address hidden>
Date: Mon Feb 19 17:00:22 2018 -0500

    Make changes to groupBy() backward-compatible

    The behaviour of the groupBy() function was fixed in 1.1.2 by
    3fb91784018de335440b01b3b069fe45dc53e025 to pass only the list of values
    to be aggregated to the aggregator function, instead of passing both the
    key and the list of values (and expecting both the key and the
    aggregated value to be returned). This fix was incompatible with
    existing expressions that used the aggregator argument to groupBy().

    In the event of an error, fall back trying the previous syntax and see
    if something plausible gets returned. If not, re-raise the original error.
    This should mean that pre-existing expressions will continue to work,
    while most outright bogus expressions should fail in a manner consistent
    with the correct definition of the function.

    Change-Id: Ic6c54be4ed99003fe56cf1a5329f3f1d84fd43c8
    Closes-Bug: #1750032

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

This issue was fixed in the openstack/yaql 2.0.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.