B&R with encryption or remote execution fails with OS_REGION_NAME not found

Bug #2074094 reported by Michel Thebeau [WIND]
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
StarlingX
In Progress
Undecided
Michel Thebeau [WIND]

Bug Description

Brief Description
-----------------
When running backup restore procedure the ansible task "Extract OS_REGION_NAME from openrc file" fails with either missing file or due to encrypted file when remote playbook execution or encryption are selected.

Severity
--------
Major: those two features are not usable

Steps to Reproduce
------------------
Perform backup procedure with ansible-playbook option backup_encryption_enabled=true
Restore the platform with remote playbook execution, and/or
Restore the platform with backup_encryption_enabled=true

Remote playbook execution example:

ansible-playbook /home/sysadmin/playbooks/restore_platform.yml \
  -i backup/hosts \
  --ask-vault-pass \
  -e "override_files_dir=/home/sysadmin/overrides" \
  -e "wipe_ceph_osds=false" \
  -e "on_box_data=false" \
  -e "ansible_remote_tmp=/home/sysadmin" \
  -e "initial_backup_dir=/home/sysadmin/LabG_platform-backups" \
  -e "backup_filename=localhost_platform_backup_2024_07_24_13_30_33.tgz" \
  --verbose

Local playbook execution example with encryption:

ansible-playbook /usr/share/ansible/stx-ansible/playbooks/restore_platform.yml \
  --ask-vault-pass \
  -e "override_files_dir=/home/sysadmin/overrides" \
  -e "wipe_ceph_osds=false" \
  -e "initial_backup_dir=/opt/platform-backup" \
  -e "backup_filename=localhost_platform_backup_2024_07_24_13_34_23.tgz.gpg" \
  -e "backup_encryption_enabled=true" \
  --verbose

* required passphrases hidden in override_files_dir
** 'verbose' required for commandline error messages.

Expected Behavior
------------------
Successful restore of the platform

Actual Behavior
----------------
The restore playbook fails with error "Cannot open: No such file or directory" when the playbook runs remotely, or with error "stdin: not in gzip format" due to the file being encrypted.

Reproducibility
---------------
Yes, when running the playbook remotely or when encrytion option is selected

System Configuration
--------------------
Testing was performed on standard controller storage 2+1

Branch/Pull Time/Commit
-----------------------
Developer load repo sync July 22

Last Pass
---------
Before July 17

Timestamp/Logs
--------------
Example ansible playbook log for remote playbook execution:

TASK [backup-restore/validate-input : Extract OS_REGION_NAME from openrc file] ***
Thursday 25 July 2024 15:23:44 +0000 (0:00:00.031) 0:00:08.471 *********
changed: [controller-0] => changed=true
  cmd: |-
    os_region_name=$(tar -xOzf /home/sysadmin/LabG_platform-backups/localhost_platform_backup_2024_07_24_13_30_33.tgz etc/platform/openrc | grep 'OS_REGION_NAME=')
    echo "$os_region_name"
  delta: '0:00:00.012973'
  end: '2024-07-25 15:23:44.856438'
  rc: 0
  start: '2024-07-25 15:23:44.843465'
  stderr: |-
    tar (child): /home/sysadmin/LabG_platform-backups/localhost_platform_backup_2024_07_24_13_30_33.tgz: Cannot open: No such file or directory
    tar (child): Error is not recoverable: exiting now
    tar: Child returned status 2
    tar: Error is not recoverable: exiting now
  stderr_lines: <omitted>
  stdout: ''
  stdout_lines: <omitted>

Example ansible playbook for encyption:

2024-07-24 18:33:31,008 p=4596 u=sysadmin n=ansible | TASK [backup-restore/validate-input : Extract OS_REGION_NAME from openrc file] ***
2024-07-24 18:33:31,009 p=4596 u=sysadmin n=ansible | Wednesday 24 July 2024 18:33:31 +0000 (0:00:00.033) 0:00:05.434 ********
2024-07-24 18:33:31,417 p=4596 u=sysadmin n=ansible | changed: [localhost] => changed=true
  cmd: |-
    os_region_name=$(tar -xOzf /opt/platform-backup/localhost_platform_backup_2024_07_24_13_34_23.tgz.gpg etc/platform/openrc | grep 'OS_REGION_NAME=')
    echo "$os_region_name"
  delta: '0:00:00.011582'
  end: '2024-07-24 18:33:31.368460'
  rc: 0
  start: '2024-07-24 18:33:31.356878'
  stderr: |2-

    gzip: stdin: not in gzip format
    tar: Child returned status 1
    tar: Error is not recoverable: exiting now
  stderr_lines: <omitted>
  stdout: ''
  stdout_lines: <omitted>

Test Activity
-------------
Feature validation

Workaround
----------
No workaround for those features; use local playbook execution and omit encyption option.

Changed in starlingx:
assignee: nobody → Michel Thebeau [WIND] (mthebeau)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to ansible-playbooks (master)
Changed in starlingx:
status: New → In Progress
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.