collect logs with date range should warn if range is invalid (and not just revert to collecting all)

Bug #2003791 reported by Victor Romano
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
StarlingX
Fix Released
Low
Victor Romano

Bug Description

Brief Description
-----------------
Currently, no feedback or warning provided in the case the collection date range is invalid.

Severity
--------
standard

Steps to Reproduce
------------------
System has been running for multiple days for this test
Performed a collect operation specifying a start and end date where the dates specified would be an invalid range...

For example the start date and end date values are reversed

$ collect controller-0 --start-date 20210914 --end-date 20210913

Expected Behavior
------------------
At minimum a warning should be given to the admin as it will not actually be using the range specified

Actual Behavior
----------------
No feedback or warning provided in the case the range is invalid.

Reproducibility
---------------
100% reproducible

System Configuration
--------------------
It was tested on DC standalone, but all systems have this behavior.

Branch/Pull Time/Commit
-----------------------
NA

Last Pass
---------
NA

Timestamp/Logs
--------------
2021-09-16T16:24:38.000 controller-0 COLLECT: notice collecting data from 2 subcloud(s)
2021-09-16T16:26:34.000 controller-0 COLLECT: notice collect /scratch/subcloud1_20210916.162430.tar succeeded
2021-09-16T16:26:34.000 controller-0 COLLECT: notice collected subcloud1_20210916.162430 ... done (00:01:56 39M 3%)
2021-09-16T16:26:36.000 controller-0 COLLECT: notice collect /scratch/subcloud2_20210916.162430.tar succeeded
2021-09-16T16:26:36.000 controller-0 COLLECT: notice collected subcloud2_20210916.162430 ... done (00:01:58 39M 3%)
2021-09-16T16:26:36.000 controller-0 COLLECT: notice collected from 2 subclouds
2021-09-16T16:26:37.000 controller-0 COLLECT: notice collected /scratch/ALL_SUBCLOUDS_20210916.162430.tar ... done (00:01:59 78M 3%)
2021-09-16T16:26:37.000 controller-0 COLLECT: notice created all-subclouds tarball /scratch/ALL_SUBCLOUDS_20210916.162430.tar

Test Activity
-------------
NA

Workaround
----------
No workaround. If the user entered an invalid date or invalid date range, the system will revert to collect all.

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

Fix proposed to branch: master
Review: https://review.opendev.org/c/starlingx/utilities/+/871634

Changed in starlingx:
status: New → In Progress
Ghada Khalil (gkhalil)
Changed in starlingx:
importance: Undecided → Low
tags: added: stx.tools
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to utilities (master)

Reviewed: https://review.opendev.org/c/starlingx/utilities/+/871634
Committed: https://opendev.org/starlingx/utilities/commit/59450af179bb67c3784b916b5eba38fc08531a05
Submitter: "Zuul (22348)"
Branch: master

commit 59450af179bb67c3784b916b5eba38fc08531a05
Author: Victor Romano <email address hidden>
Date: Tue Jan 24 12:11:59 2023 -0300

    Warn about invalid date when collecting logs

    If the user entered an invalid start-date, invalid end-date and/or
    the start-date is greater than the end-date during the collect logs
    process, the system will warn the user about the error, instead of
    just reverting to collect all.

    Test plan:
    PASS - Install and bootstrap SX and test if the warnings are
    presented if an invalid start-date, end-date and/or date range
    are passed by the user, as well as collecting logs if correct
    parameters are provided.
    PASS - Install and bootstrap Standard and test if the warnings are
    presented if an invalid start-date, end-date and/or date range
    are passed by the user, as well as collecting logs if correct
    parameters are provided.

    Closes-bug: 2003791

    Signed-off-by: Victor Romano <email address hidden>
    Change-Id: Iab35b1d92f4471e2713fabe5d7a6ef8b611ea240

Changed in starlingx:
status: In Progress → Fix Released
Revision history for this message
Ghada Khalil (gkhalil) wrote :

Re-opening as the above commit was reverted by: https://review.opendev.org/c/starlingx/utilities/+/872300
The code will need to be re-worked and re-submitted

Changed in starlingx:
status: Fix Released → In Progress
assignee: nobody → Victor Romano (vgluzrom)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to utilities (master)

Fix proposed to branch: master
Review: https://review.opendev.org/c/starlingx/utilities/+/872978

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

Reviewed: https://review.opendev.org/c/starlingx/utilities/+/872978
Committed: https://opendev.org/starlingx/utilities/commit/db7144f1cf83176266c6dbed89f01fd738df10bf
Submitter: "Zuul (22348)"
Branch: master

commit db7144f1cf83176266c6dbed89f01fd738df10bf
Author: Victor Romano <email address hidden>
Date: Tue Feb 7 12:56:14 2023 -0300

    Warn about invalid date when collecting logs

    If the user entered an invalid start-date, invalid end-date and/or
    the start-date is greater than the end-date during the collect logs
    process, the system will warn the user about the error, instead of
    just reverting to collect all.

    Test plan:
    PASS - Install and bootstrap SX and test if the warnings are
    presented if an invalid start-date, end-date and/or date range
    are passed by the user, as well as collecting logs if correct
    parameters are provided.
    PASS - Install and bootstrap Standard and test if the warnings are
    presented if an invalid start-date, end-date and/or date range
    are passed by the user, as well as collecting logs if correct
    parameters are provided.

    Test with correct parameters:
    PASS: collect --start-date any --end-date any
    PASS: collect
    PASS: collect --all
    PASS: collect --list controller-0 controller-1
    PASS: collect controller-0 controller-1
    PASS: collect --all --subcloud

    Closes-bug: 2003791

    Signed-off-by: Victor Romano <email address hidden>
    Change-Id: Iab872d2cbf02e1e6b6feef931375d05345c844e8

Changed in starlingx:
status: In Progress → Fix Released
Ghada Khalil (gkhalil)
tags: added: stx.9.0
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.