Subcloud error_description field being included in the output of backup create and restore commands

Bug #1997023 reported by Gustavo Herzmann
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
StarlingX
Fix Released
Low
Gustavo Herzmann

Bug Description

Brief Description
-----------------
The error_description field is currently being returned by the subcloud-backup create and subcloud-backup restore command (which differs from the output generated by the 'subcloud show' command). This makes the output hard to read because the error message can have up to 2048 characters and it displays the error description from the last executed command, which might confuse the user. The user should instead use the 'dcmanager subcloud errors <subcloud>' to view the error description.

Severity
--------
Minor: System/Feature is usable with minor issue

Steps to Reproduce
------------------
Create a subcloud backup with the following command and notice the error_description field in the returned output.

dcmanager subcloud-backup create --subcloud subcloud1

Try to restore the backup with the following command and notice the error_description field in the returned output.

dcmanager subcloud-backup restore --with-install --registry-images --restore-values restore_values.yml --subcloud subcloud1

Expected Behavior
------------------
The output returned from the backup create and restore commands should not contain the error_description field.

Actual Behavior
----------------
The output returned from the backup commands contains the error_description field.

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

System Configuration
--------------------
Distributed cloud system

Branch/Pull Time/Commit
-----------------------
2022-11-09 master

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

Timestamp/Logs
--------------
Example of the output when there was an install failure before executing the command:

[sysadmin@controller-0 ~(keystone_admin)]$ dcmanager subcloud-backup restore --with-install --local-only --registry-images --restore-values restore_values.yml --subcloud subcloud6
Enter the sysadmin password for the subcloud:
Re-enter sysadmin password to confirm:
+-----------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| Field | Value |
+-----------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| id | 9 |
| name | subcloud6 |
| description | None |
| location | None |
| software_version | 22.12 |
| management | unmanaged |
| availability | offline |
| deploy_status | install-failed |
| error_description | FAILED installing playbook of (subcloud6). |
| | detail: fatal: [subcloud6]: FAILED! => changed=true |
| | cmd: |
| | msg: non-zero return code |
| | stderr: |- |
| | stderr_lines: <omitted> |
| | skipping: [localhost] => (item={"changed": False, "stat": {"exists": False}, "invocation": {"module_args": {"path": "/root/secrets.yml", "follow": False, "get_md5": False, "get_checksum": True, "get_mime": True, "get_attributes": True, "checksum_algorithm": "sha1"}}, "failed": False, "item": "/root/secrets.yml", "ansible_loop_var": "item"}) |
| | skipping: [localhost] => (item={"changed": False, "stat": {"exists": False}, "invocation": {"module_args": {"path": "/root/localhost_secrets.yml", "follow": False, "get_md5": False, "get_checksum": True, "get_mime": True, "get_attributes": True, "checksum_algorithm": "sha1"}}, "failed": False, "item": "/root/localhost_secrets.yml", "ansible_loop_var": "item"}) |
| | skipping: [localhost] => (item={"changed": False, "stat": {"exists": False}, "invocation": {"module_args": {"path": "/root/site.yml", "follow": False, "get_md5": False, "get_checksum": True, "get_mime": True, "get_attributes": True, "checksum_algorithm": "sha1"}}, "failed": False, "item": "/root/site.yml", "ansible_loop_var": "item"}) |
| | skipping: [localhost] => (item={"changed": False, "stat": {"exists": False}, "invocation": {"module_args": {"path": "/root/localhost.yml", "follow": False, "get_md5": False, "get_checksum": True, "get_mime": True, "get_attributes": True, "checksum_algorithm": "sha1"}}, "failed": False, "item": "/root/localhost.yml", "ansible_loop_var": "item"}) |
| | TASK [common/prepare-env : Fail if host is unreachable] ************************ |
| | FAILED TASK: TASK [Waiting 3600 seconds for port 22 become open on 2620:10a:a001:a103::1129] Monday 14 November 2022 03:19:59 +0000 (0:00:00.014) 0:00:22.824 |
| management_subnet | fd01:15::0/64 |
| management_start_ip | fd01:15::2 |
| management_end_ip | fd01:15::11 |
| management_gateway_ip | fd01:15::1 |
| systemcontroller_gateway_ip | fd01:1::1 |
| group_id | 1 |
| created_at | 2022-11-10 23:34:35.659963 |
| updated_at | 2022-11-14 03:21:41.462675 |
| backup_status | complete |
| backup_datetime | 2022-11-11 01:23:29.371694 |
+-----------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+

Test Activity
-------------
Developer Testing

Workaround
----------
NA.

Changed in starlingx:
status: New → In Progress
assignee: nobody → Gustavo Herzmann (gherzman)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to distcloud-client (master)
description: updated
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to distcloud-client (master)

Reviewed: https://review.opendev.org/c/starlingx/distcloud-client/+/865019
Committed: https://opendev.org/starlingx/distcloud-client/commit/6da141267ea01fb3bed7a383b9584d4f5c0e705b
Submitter: "Zuul (22348)"
Branch: master

commit 6da141267ea01fb3bed7a383b9584d4f5c0e705b
Author: Gustavo Herzmann <email address hidden>
Date: Fri Nov 18 09:52:34 2022 -0300

    Remove error_description field from B&R CLI outputs

    Stops the error_description field from being returned as part of the
    subcloud-backup create/restore command output.

    Test plan:
    PASS: Execute 'dcmanager subcloud-backup create ...' and verify that
    the error_description is not part of the output message;
    PASS: Execute 'dcmanager subcloud-backup restore ...' and verify that
    the error_description is not part of the output message;
    PASS: Execute 'dcmanager subcloud errors <subcloud>' and verify that
    the error_description is still returned correctly.

    Closes-Bug: #1997023

    Signed-off-by: Gustavo Herzmann <email address hidden>
    Change-Id: Ic70c42d9d107b4f6fb3be8c33c58f0f19b88e5aa

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