Maximo Open Forum

 View Only

 Unable to create backup for MAS Manage using ansible script

Jump to  Best Answer
  • Maximo Application Suite
Vincent Yap's profile image
Vincent Yap posted 08-06-2025 00:25

Hi experts,

I am using below ansible script to backup our MAS Manage instance

export MASBR_ACTION=backup
export MASBR_STORAGE_LOCAL_FOLDER=/tmp
export MAS_INSTANCE_ID=mas9qa
export MAS_WORKSPACE_ID=masqa
export MAS_WORKSPACE_NAME=masqa
export DB2_INSTANCE_NAME=mas9qa
export DB2_NAMESPACE=db2u
oc login --token=xxxxxx
ansible-playbook ibm.mas_devops.br_manage

However am getting error below:

TASK [ibm.mas_devops.suite_backup_restore : Run backup namespace resource script] *********************
fatal: [localhost]: FAILED! => {"changed": true, "cmd": "/tmp/masbr/core-mas9qa-full-20250806041927/backup-namespace-resources.sh\n", "delta": "0:00:00.004497", "end": "2025-08-06 04:22:32.132936", "msg": "non-zero return code", "rc": 126, "start": "2025-08-06 04:22:32.128439", "stderr": "/bin/sh: line 1: /tmp/masbr/core-mas9qa-full-20250806041927/backup-namespace-resources.sh: Permission denied", "stderr_lines": ["/bin/sh: line 1: /tmp/masbr/core-mas9qa-full-20250806041927/backup-namespace-resources.sh: Permission denied"], "stdout": "", "stdout_lines": []}

TASK [ibm.mas_devops.suite_app_backup_restore : Run backup namespace resource script] *****************
fatal: [localhost]: FAILED! => {"changed": true, "cmd": "/tmp/masbr/manage-mas9qa-full-20250806041927/backup-namespace-resources.sh\n", "delta": "0:00:00.004909", "end": "2025-08-06 04:22:47.786532", "msg": "non-zero return code", "rc": 126, "start": "2025-08-06 04:22:47.781623", "stderr": "/bin/sh: line 1: /tmp/masbr/manage-mas9qa-full-20250806041927/backup-namespace-resources.sh: Permission denied", "stderr_lines": ["/bin/sh: line 1: /tmp/masbr/manage-mas9qa-full-20250806041927/backup-namespace-resources.sh: Permission denied"], "stdout": "", "stdout_lines": []}

I have no errors when running the ansible backup for mongodb and db2

  • ansible-playbook ibm.mas_devops.br_mongodb
  • ansible-playbook ibm.mas_devops.br_db2

Only errors permission denied errors are encountered while running backup for core and manage:

  • ansible-playbook ibm.mas_devops.br_core
  • ansible-playbook ibm.mas_devops.br_manage

Tried to force reinstall ansible mas devops collection below but same errors encountered:

[xxx-xxx@xx-xx-xx-xx-xx backups]$ ansible-galaxy collection install ibm.mas_devops --force
Starting galaxy collection install process
[WARNING]: Collection kubernetes.core does not support Ansible version 2.15.13
[WARNING]: Collection ansible.utils does not support Ansible version 2.15.13
[WARNING]: Collection community.general does not support Ansible version 2.15.13
[WARNING]: Collection ibm.cloudcollection does not support Ansible version 2.15.13
Process install dependency map
Starting collection install process
Downloading https://galaxy.ansible.com/api/v3/plugin/ansible/content/published/collections/artifacts/ibm-mas_devops-29.1.1.tar.gz to /home/ec2-user/.ansible/tmp/ansible-local-86242ufbqca51/tmpx87pk2xp/ibm-mas_devops-29.1.1-hz5fteqp
Installing 'ibm.mas_devops:29.1.1' to '/home/ec2-user/.ansible/collections/ansible_collections/ibm/mas_devops'
ibm.mas_devops:29.1.1 was installed successfully
'ansible.utils:6.0.0' is already installed, skipping.
'kubernetes.core:6.0.0' is already installed, skipping.
'community.general:11.1.0' is already installed, skipping.
'ibm.cloudcollection:1.51.0' is already installed, skipping.

Please advise.

Thanks.

Shauna Gilbert's profile image
Shauna Gilbert  Best Answer

The error you are seeing is Permission denied", "stderr_lines": ["/bin/sh: line 1: /tmp/masbr/core-mas9qa-full-20250806041927/backup-namespace-resources.sh
is most definitely pointing to missing execute permissions on that generated backup script. 

You can try running something like: 
chmod +x /tmp/masbr/core-mas9qa-full-*/backup-namespace-resources.sh
chmod +x /tmp/masbr/manage-mas9qa-full-*/backup-namespace-resources.sh

I use a slightly different method to backup core and manage namespaces. It's documented here:
Manage:   https://www.ibm.com/docs/en/masv-and-l/cd?topic=namespace-backing-up-maximo-manage-script
Core:    https://www.ibm.com/docs/en/masv-and-l/cd?topic=namespace-using-script
You basically create the scripts and run them with the following switches. 

Ex: 
/data/scripts/mascore-backup-restore.sh -i <mas_instance_id> -f ./ -m backup
/data/scripts/mascore-backup-restore.sh -i <mas_instance_id> -f ./ -m backup

Then you can use the same scripts to restore when needed. 
Ex. 
/data/scripts/mascore-backup-restore.sh -i a<mas_instance_id> -f <backup_folder_location> -m restore

Vincent Yap's profile image
Vincent Yap

Hi Shauna,

I have tried to include the chmod +x but still having error. Thanks for sharing this will try this.

Also I tried running the ansible script on our openshift management console bastion instead and had no errors encountered and backup is able to complete.