Closed guillemmayolramis1 closed 3 weeks ago
I think I found the issue. It's attempting to run "oc cp" inside the db2 container which its wrong. The issue happens due to wrongly placed quote character (').
Now
shell: >- oc exec {{ masbr_cf_pod_name }} -c {{ masbr_cf_container_name }} -n {{ masbr_cf_namespace }} -- bash -c 'mkdir -p {{ item.dest_folder }} && oc cp --retries=50 -c {{ masbr_cf_container_name }} {{ [masbr_storage_job_folder, item.src_file] | path_join }} {{ masbr_cf_namespace }}/{{ masbr_cf_pod_name }}:{{ item.dest_folder }}'
After
shell: >- oc exec {{ masbr_cf_pod_name }} -c {{ masbr_cf_container_name }} -n {{ masbr_cf_namespace }} -- bash -c 'mkdir -p {{ item.dest_folder }}' && oc cp --retries=50 -c {{ masbr_cf_container_name }} {{ [masbr_storage_job_folder, item.src_file] | path_join }} {{ masbr_cf_namespace }}/{{ masbr_cf_pod_name }}:{{ item.dest_folder }}
I have manually changed this locally and now playbook completes successfully.
Note that the issue appears to be present in the other Conditions of the same yaml. This only fixes condition 2. Please review.
Task result after the change
TASK [ibm.mas_devops.db2 : Copy file from local storage folder to pod folder] ************************************************* changed: [localhost] => (item={'src_file': 'database/db2-mas-masbrtest-prod-manage-full-20240919094347.tar.gz', 'dest_folder': '/mnt/backup/db2-mas-masbrtest-prod-manage-full-20240919094347-20240923083656/database'}) => changed=true ansible_loop_var: item cmd: oc exec c-mas-masbrtest-prod-manage-db2u-0 -c db2u -n db2u -- bash -c 'mkdir -p /mnt/backup/db2-mas-masbrtest-prod-manage-full-20240919094347-20240923083656/database' && oc cp --retries=50 -c db2u /mnt/home/backup/backups/db2-mas-masbrtest-prod-manage-full-20240919094347/database/db2-mas-masbrtest-prod-manage-full-20240919094347.tar.gz db2u/c-mas-masbrtest-prod-manage-db2u-0:/mnt/backup/db2-mas-masbrtest-prod-manage-full-20240919094347-20240923083656/database delta: '0:03:14.607793' end: '2024-09-23 08:40:41.874926' item: dest_folder: /mnt/backup/db2-mas-masbrtest-prod-manage-full-20240919094347-20240923083656/database src_file: database/db2-mas-masbrtest-prod-manage-full-20240919094347.tar.gz msg: '' rc: 0 start: '2024-09-23 08:37:27.267133' stderr: '' stderr_lines: <omitted> stdout: '' stdout_lines: <omitted>
Playbook result after the change
`
TASK [ibm.mas_devops.db2 : Summary] ***
ok: [localhost] =>
msg:
Collection version
ibmmas/cli:10.9.2
Environment information
What happened?
So, mongo DB and Core get fully recovered (Users, api keys,core configs, etc...) but DB2 is not. The relevant logs have been attached.
Relevant log output