Restore stx-openstack fails due to application-apply not supported mode

Bug #1961435 reported by Thales Elero Cervi
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
StarlingX
Fix Released
Medium
Thales Elero Cervi

Bug Description

Brief Description
-----------------
After performing a platform backup with stx-openstack applied, when trying to restore the application it fails due to an unsupported apply mode.

Severity
--------
Critical: stx-openstack can not be restored after a backup.

Steps to Reproduce
------------------
* Apply the stx-openstack application to your system (system application-apply)
* Perform a platform backup: ansible-playbook /usr/share/ansible/stx-ansible/playbooks/backup.yml -e "ansible_become_pass=<sysadmin password> admin_password=<sysadmin password>"
* Remove the stx-openstack application from your system (system application-remove) for enabling the backup restore
* Restore the stx-openstack application backup: ansible-playbook /usr/share/ansible/stx-ansible/playbooks/restore_openstack.yml -e 'initial_backup_dir=/opt/backups ansible_become_pass=<sysadmin password> admin_password=<sysadmin password> backup_filename=localhost_openstack_backup_2019_12_13_12_43_17.tgz

Expected Behavior
------------------
stx-openstack application should be restored successfully.

Actual Behavior
----------------
stx-openstack application fails to be restored due to a not supported application-apply mode.

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

System Configuration
--------------------
Tested on One node system but should apply to any system configuration.

Branch/Pull Time/Commit
-----------------------
Branch: master

COMPILER_OS="centos"
COMPILER_JOB="STX_build_layer_compiler_master_master"
<email address hidden>"
COMPILER_BUILD_NUMBER="822"
COMPILER_BUILD_HOST="starlingx_mirror"
COMPILER_BUILD_DATE="2022-01-21 02:30:00 +0000"

app_name: stx-openstack
app_version: 1.0-173-centos-stable-versioned
build_date: 2022-02-17 06:27:39 +0000

Last Pass
---------
N/A

Timestamp/Logs
--------------
TASK [restore-openstack/restore : Bring up MariaDB and its prerequisite services] ***********************************************************************************************************************************
Friday 18 February 2022 16:28:51 +0000 (0:00:03.867) 0:00:19.002 *******
fatal: [localhost]: FAILED! => changed=true
  cmd: source /etc/platform/openrc; system application-apply --mode restore_db stx-openstack
  delta: '0:00:01.824747'
  end: '2022-02-18 16:28:53.940805'
  msg: non-zero return code
  rc: 1
  start: '2022-02-18 16:28:52.116058'
  stderr: 'Application-apply rejected: Mode is not supported for app stx-openstack.'
  stderr_lines:
  - 'Application-apply rejected: Mode is not supported for app stx-openstack.'
  stdout: ''
  stdout_lines: <omitted>

TASK [restore-openstack/restore : Remove restore_openstack_in_progress flag file] ***********************************************************************************************************************************
Friday 18 February 2022 16:28:53 +0000 (0:00:02.012) 0:00:21.014 *******
changed: [localhost]

PLAY RECAP **********************************************************************************************************************************************************************************************************
localhost : ok=23 changed=14 unreachable=0 failed=1

Friday 18 February 2022 16:28:54 +0000 (0:00:00.180) 0:00:21.195 *******
===============================================================================

Test Activity
-------------
Feature Testing

Workaround
----------
None.
This was probably introduced after the Story: https://storyboard.openstack.org/#!/story/2009669 when sysinv client code was changed (https://review.opendev.org/c/starlingx/config/+/814670)

Changed in starlingx:
assignee: nobody → Thales Elero Cervi (tcervi)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to config (master)

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

Changed in starlingx:
status: New → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to config (master)

Reviewed: https://review.opendev.org/c/starlingx/config/+/829972
Committed: https://opendev.org/starlingx/config/commit/c53d555e2df7c9126b7c129562542761d4fc1884
Submitter: "Zuul (22348)"
Branch: master

commit c53d555e2df7c9126b7c129562542761d4fc1884
Author: Thales Elero Cervi <email address hidden>
Date: Fri Feb 18 14:22:30 2022 -0300

    Fixing app name when searching for apply modes

    After performing a platform backup with stx-openstack application
    applied, when trying to restore the application it fails due to an
    unsupported application-apply mode (--mode restore_db).

    This issue was probably introduced after changing code on sysinv to use
    general naming for Openstack application [1]. It is probably a remaining
    work that was left behind on that time. Now when the app name is checked
    to be valid inside HELM_APP_APPLY_MODES it is never validated since the
    mode is now referring to HELM_APP_OPENSTACK='openstack'.

    This change is simply checking if the app being patched has a name that
    ends with the constant HELM_APP_OPENSTACK. If it is the case, then we
    are handling an Openstack application and the mode_name to be searched
    can simply be the constat it self. Otherwise we consider the mode_name
    as the name argument and the function behaves as it is behaving now.

    TEST PLAN:
    PASS: Build & Install on an AIO-SX system
    PASS: Execute stx-openstack application backup procedure [2]
    successfully
    PASS: Execute stx-openstack application restore procedure [2]
    successfully

    [1] https://review.opendev.org/c/starlingx/config/+/814670
    [2] https://docs.starlingx.io/developer_resources/backup_restore.html

    Closes-bug: 1961435

    Signed-off-by: Thales Elero Cervi <email address hidden>
    Change-Id: I9423da249ddc74228111ba2b954afe7b93c505d7

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