Reject collect command where --name value has a name longer than 239 char

Bug #1990533 reported by Girish Subramanya
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
StarlingX
Fix Released
Low
Girish Subramanya

Bug Description

Brief Description

Suggest reject/check collect command where --name value has lenthyname ie. >239 characters

Severity

Minor

Steps to Reproduce

$ collect --name <lengthyname> --subcloud subcloud1

or from a standalone system controller

$collect --list controller-0 --verbose --name <lengthyname>

Where the lenthyname is 239 characters or more (resulting in final tgz file name of 255 char)

Expected Behavior

Suggest the <lengthyname> should not exceed 239 char (ie would not result in a tarball name more than 255 char, with appropriate failure code.

Actual Behavior

Error in log collection from subclouds (reason 11)

$ collect all --name Longname33980938509438250943850493543589438250483209584309258049325830495830498250934850934hjkhjkhjkhjkhjkhjhjhkhjkhjk8fdsfdsfsdfsdfdsfdsafdsa2059fdsakfdsafjdsalkfjdsklafjdklskfdasjfdksajfkdsajfdklsafjkldsajfkldjsafkldjsaklfjdsklafjdklfds112
[sudo] password for sysadmin:
collecting data from 2 host(s)
monitoring host collect ; please standby .....
Error: operation timeout ; failed to get file from controller-1 (reason:11)
Error: operation timeout ; failed to collect from controller-1 [get file] (reason:11)
stats error)
collected from 3 hosts
Error: /scratch/Longname33980938509438250943850493543589438250483209584309258049325830495830498250934850934hjkhjkhjkhjkhjkhjhjhkhjkhjk8fdsfdsfsdfsdfdsfdsafdsa2059fdsakfdsafjdsalkfjdsklafjdklskfdasjfdksajfkdsajfdklsafjkldsajfkldjsafkldjsaklfjdsklafjdklfds112_20210916.172027 not present ; refusing to create empty /scratch/Longname33980938509438250943850493543589438250483209584309258049325830495830498250934850934hjkhjkhjkhjkhjkhjhjhkhjkhjk8fdsfdsfsdfsdfdsfdsafdsa2059fdsakfdsafjdsalkfjdsklafjdklskfdasjfdksajfkdsajfdklsafjkldsajfkldjsafkldjsaklfjdsklafjdklfds112_20210916.172027.tar

On standalone system, the result is an Error in creating empty <lengthyname>.tar file

2021-09-21T16:56:39.000 controller-0 COLLECT: notice collected from 1 hosts
2021-09-21T16:56:39.000 controller-0 COLLECT: notice Error: /scratch/testsfdasjkjhsdafhdjksafhdjksahfdjkshafjkdshafjkdshafjkdhsafjkdhsjkafhdasjkfhdsjkafhdksjafhjkasfhdjksahfsdjkahfjkdsahfjkdshafjkdshafjksdhafjkdfjjkfdklsgfjklsgjdfklsgjfkldsjgfkldjgkldfsjgkldfjsgklfjdslgkjdfsgjdfkljgdfklsdhfjksdafdsafsdfjdkfjdlkfjdsklfjdsklfjdkfjdlskjfdjfdjfdlkjafkldsjafkldjsfkljdsklafjdklfjsdklajfkldsjfklds1_20210921.165259 not present ; refusing to create empty /scratch/testsfdasjkjhsdafhdjksafhdjksahfdjkshafjkdshafjkdshafjkdhsafjkdhsjkafhdasjkfhdsjkafhdksjafhjkasfhdjksahfsdjkahfjkdsahfjkdshafjkdshafjksdhafjkdfjjkfdklsgfjklsgjdfklsgjfkldsjgfkldjgkldfsjgkldfjsgklfjdslgkjdfsgjdfkljgdfklsdhfjksdafdsafsdfjdkfjdlkfjdsklfjdsklfjdkfjdlskjfdjfdjfdlkjafkldsjafkldjsfkljdsklafjdklfjsdklajfkldsjfklds1_20210921.165259.tar

Reproducibility
---------------
The issue is 100% reproducible.

System Configuration
DC and standalone

Branch/Pull Time/Commit
2021-09-15_00-00-06

Last Pass
This is a new test scenario

Test Activity
Feature testing

Workaround
specify short value for --name

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/+/858920

Changed in starlingx:
assignee: nobody → Girish Subramanya (gisubram)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Change abandoned on utilities (master)

Change abandoned by "Girish Subramanya <email address hidden>" on branch: master
Review: https://review.opendev.org/c/starlingx/utilities/+/858920
Reason: Already review exists for Bug #1990533

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/+/858970

Changed in starlingx:
status: New → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Change abandoned on utilities (master)

Change abandoned by "Girish Subramanya <email address hidden>" on branch: master
Review: https://review.opendev.org/c/starlingx/utilities/+/858970
Reason: This review shall not Overwrite existing submission under review

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/+/858972

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Change abandoned on utilities (master)

Change abandoned by "Girish Subramanya <email address hidden>" on branch: master
Review: https://review.opendev.org/c/starlingx/utilities/+/858972
Reason: Use original review - https://review.opendev.org/c/starlingx/utilities/+/858824

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/+/859089

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Change abandoned on utilities (master)

Change abandoned by "Girish Subramanya <email address hidden>" on branch: master
Review: https://review.opendev.org/c/starlingx/utilities/+/859089
Reason: Using original review https://review.opendev.org/c/starlingx/utilities/+/858824

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

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

commit 2d92fcea17411d8e53e4e2967e37f0f190e9124b
Author: Girish Subramanya <email address hidden>
Date: Wed Sep 21 17:55:54 2022 -0400

    Reject input name with collect utility when name length exceeds 235

    When using the collect utility and where the user provides a bundle
    name with --name that is 236 characters or longer:
    An inappropriate error "no space left on device" is reported;

    An "operation timeout" error is reported when name length exceeds 239
    On a standalone system, the Error reported is:
    "refusing to creating empty <name>.tar file".

    This update validates the name length and fixes the inappropriate Error
    indicating the maximum allowed length for the bundle name.

    Test Plan:

    Verify collector package build with iso build in CentOS
    Verify log name within limit is accepted and collect bundle is created
    Verify name length 1 over max-length fails
    Verify log name is rejected with the error code 55 with name_length 236
    Verify log name is rejected with the error code 55 with name_length 240
    Verify log name is rejected with the error code 55 without timeout error
    Verify boundary condition with name length equal to max-length succeeds

    Regression:
    Verify named collect bundle tar under scratch with name length under 236

    Signed-off-by: Girish Subramanya <email address hidden>

    Closes-Bug:1990533

    Change-Id: Iee8f918e19ed431a19209e19dc73fc28b9624027

Changed in starlingx:
status: In Progress → Fix Released
Changed in starlingx:
status: Fix Released → Confirmed
status: Confirmed → Fix Committed
status: Fix Committed → Confirmed
status: Confirmed → In Progress
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/+/859727

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/+/859727
Committed: https://opendev.org/starlingx/utilities/commit/f4dbc8a5d43f6a97cadf731b2a7f06634aefefb0
Submitter: "Zuul (22348)"
Branch: master

commit f4dbc8a5d43f6a97cadf731b2a7f06634aefefb0
Author: Girish Subramanya <email address hidden>
Date: Wed Sep 28 19:04:43 2022 -0400

    Reject input name with collect utility when name length exceeds 235

    When using the collect utility and where the user provides a bundle
    name with --name that is 236 characters or longer:

    An error log to notify the max size of log name shall have the allowed
    limit defined in the collect utility - without bad substitution error
    An inappropriate error "no space left on device" was being reported;
    An "operation timeout" error was reported when name length exceeds 239
    On a standalone system, the Error reported is:
    "refusing to creating empty <name>.tar file".

    This update rectifies the bad substitution with new Max length error log
    This update validates the name length and fixes the inappropriate Error
    indicating the maximum allowed length for the bundle name.

    Test Plan:

    Verify long name error has no bad substitution in max_length error log
    Verify collector package build with iso build in CentOS
    Verify log name within limit is accepted and collect bundle is created
    Verify name length 1 over max-length fails
    Verify log name is rejected with the error code 55 with name_length 236
    Verify log name is rejected with the error code 55 with name_length 240
    Verify log name is rejected with the error code 55 without timeout error
    Verify boundary condition with name length equal to max-length succeeds

    Regression:
    Verify named collect bundle tar under scratch with name length under 236

    Signed-off-by: Girish Subramanya <email address hidden>

    Closes-Bug: 1990533
    Change-Id: Ia55d759773af666e64f687b0f203740dbda8e309

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