TASK [ceph : set jq osd percentage filter] fails with: "error: try is not defined"

Bug #1889279 reported by Francesco Pantano
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
tripleo
Fix Released
Undecided
Francesco Pantano

Bug Description

After applying the patch submitted as a fix for https://bugs.launchpad.net/tripleo/+bug/1882387 in the FFU testing, it failed with the error in $subject.
The problem is that during this stage we have train code in the undercloud, but the overcloud (controllers) are still in queens and ceph is not updated yet (it's still ceph3): we have jq <1.5 and the "try-catch" mechanism is not available.
For this reason the validation failed with the following:

TASK [ceph : set jq osd percentage filter] *************************************
Tuesday 28 July 2020 10:22:16 -0400 (0:00:00.270) 0:01:11.723 **********
ok: [undercloud -> 192.168.24.15] => {"ansible_facts": {"jq_osd_percentage_filter": "( (try .osdmap.num_in_osds + try .num_in_osds) / (try .osdmap.num_osds + try .num_osds))
 * 100"}, "changed": false}

TASK [ceph : Get OSD stat percentage] ******************************************

Tuesday 28 July 2020 10:22:17 -0400 (0:00:00.272) 0:01:11.996 **********
fatal: [undercloud -> 192.168.24.15]: FAILED! => {"changed": true, "cmd": "\"docker\" exec \"ceph-mon-controller-0\" ceph --cluster \"ceph\" osd stat -f json | jq '( (try .o
sdmap.num_in_osds + try .num_in_osds) / (try .osdmap.num_osds + try .num_osds)) * 100'", "delta": "0:00:00.404082", "end": "2020-07-27 15:43:28.260232", "msg": "non-zero return code", "rc": 1, "start": "2020-07-27 15:43:27.856150", "stderr": "error: try is not defined\n( (try .osdmap.num_in_osds + try .num_in_osds) / (try .osdmap.num_osds + try .num_osds)) * 100\n ^^^\nerror: try is not defined\n( (try .osdmap.num_in_osds + try .num_in_osds) / (try .osdmap.num_osds + try .num_osds)) * 100\n
       ^^^\nerror: try is not defined\n( (try .osdmap.num_in_osds + try .num_in_osds) / (try .osdmap.num_osds + try .num_osds)) * 100\n
            ^^^\nerror: try is not defined\n( (try .osdmap.num_in_osds + try .num_in_osds) / (try .osdmap.num_osds + try .num_osds)) * 100\n
                                        ^^^\n4 compile errors", "stderr_lines": ["error: try is not defined", "( (try .osdmap.num_in_osds + try .num_in_osds) / (try .osdmap.num_osds + try .num_osds)) * 100", " ^^^", "error: try is not defined", "( (try .osdmap.num_in_osds + try .num_in_osds) / (try .osdmap.num_osds + try .num_osds)) * 100", "
                             ^^^", "error: try is not defined", "( (try .osdmap.num_in_osds + try .num_in_osds) / (try .osdmap.num_osds + try .num_osds)) * 100", "
                                        ^^^", "error: try is not defined", "( (try .osdmap.num_in_osds + try .num_in_osds) / (try .osdmap.num_osds + try .num_osds)) * 100",
" ^^^", "4 compile errors"], "stdout": "", "stdout_lines": []}

NO MORE HOSTS LEFT *************************************************************

The jq package version found in the controller is:

[root@controller-0 ~]# rpm -qa | grep jq
python-XStatic-jquery-ui-1.10.4.1-1.el7ost.1.noarch
jq-1.3-4.el7ost.x86_64

Revision history for this message
Francesco Pantano (fmount) wrote :

In master it's ok because we're in V and jq >=1.5 so that change will work, but in in queens => train upgrade we should fix this code.

Changed in tripleo:
assignee: nobody → Francesco Pantano (fmount)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to tripleo-validations (master)

Fix proposed to branch: master
Review: https://review.opendev.org/743592

Changed in tripleo:
status: New → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to tripleo-validations (stable/ussuri)

Fix proposed to branch: stable/ussuri
Review: https://review.opendev.org/743598

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

Reviewed: https://review.opendev.org/743592
Committed: https://git.openstack.org/cgit/openstack/tripleo-validations/commit/?id=6c19d1bcdfc67ae3894959441684e62221ef620f
Submitter: Zuul
Branch: master

commit 6c19d1bcdfc67ae3894959441684e62221ef620f
Author: Francesco Pantano <email address hidden>
Date: Tue Jul 28 18:44:54 2020 +0200

    Make Get OSD stat percentage compatible with jq < 1.5

    On upgrades we're using validations (from train) against controller that
    are still on queens. On queens jq package is <1.5 and the "try" keyword
    is not available.
    This purpose of this change is to fix this validations getting rid of
    "try-catch" in favour of "if-else" which works for 1.3+ < jq < 1.5.

    Change-Id: Id16ccf69888ceb03cc33e0627de5270f9c8f4b95
    Closes-Bug: #1889279

Changed in tripleo:
status: In Progress → Fix Released
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to tripleo-validations (stable/train)

Reviewed: https://review.opendev.org/743572
Committed: https://git.openstack.org/cgit/openstack/tripleo-validations/commit/?id=5dcaa10e894438fbc3b0cd6ba48a2407081d8613
Submitter: Zuul
Branch: stable/train

commit 5dcaa10e894438fbc3b0cd6ba48a2407081d8613
Author: Francesco Pantano <email address hidden>
Date: Tue Jul 28 18:44:54 2020 +0200

    Make Get OSD stat percentage compatible with jq < 1.5

    On upgrades we're using validations (from train) against controller that
    are still on queens. On queens jq package is <1.5 and the "try" keyword
    is not available.
    This purpose of this change is to fix this validations getting rid of
    "try-catch" in favour of "if-else" which works for 1.3+ < jq < 1.5.

    Change-Id: Iddea0c21da194ef7cbe781d4fc4ad932f6fc2c14
    Closes-Bug: #1889279
    (cherry picked from commit 436671832b0ee8aed87ebd6c5ce45e18ec00710c)

tags: added: in-stable-train
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to tripleo-validations (stable/ussuri)

Reviewed: https://review.opendev.org/743598
Committed: https://git.openstack.org/cgit/openstack/tripleo-validations/commit/?id=1de1854bed64df83746f39a642a59d020e73820a
Submitter: Zuul
Branch: stable/ussuri

commit 1de1854bed64df83746f39a642a59d020e73820a
Author: Francesco Pantano <email address hidden>
Date: Mon Aug 3 09:21:50 2020 +0200

    Make Get OSD stat percentage compatible with jq < 1.5

    On upgrades we're using validations (from train) against controller that
    are still on queens. On queens jq package is <1.5 and the "try" keyword
    is not available.
    This purpose of this change is to fix this validations getting rid of
    "try-catch" in favour of "if-else" which works for 1.3+ < jq < 1.5.

    Change-Id: Id16ccf69888ceb03cc33e0627de5270f9c8f4b95
    Closes-Bug: #1889279
    (cherry picked from commit 436671832b0ee8aed87ebd6c5ce45e18ec00710c)

tags: added: in-stable-ussuri
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/tripleo-validations 11.4.0

This issue was fixed in the openstack/tripleo-validations 11.4.0 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.