Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DB2 recovery from S3 is not working. #1482

Open
guillemmayolramis1 opened this issue Sep 20, 2024 · 0 comments
Open

DB2 recovery from S3 is not working. #1482

guillemmayolramis1 opened this issue Sep 20, 2024 · 0 comments
Labels
Bug Report Something isn't working

Comments

@guillemmayolramis1
Copy link

Collection version

ibmmas/cli:10.9.2

Environment information

# Local working dir
cd /Users/gcmr/techzone

# download container
podman run -dit -v  /Users/gcmr/techzone:/mnt/home:z --pull always --name mascli quay.io/ibmmas/cli:latest bash

# execute
podman exec -it mascli bash

What happened?

oc login cluster SRC

vi /mnt/home/rclone.conf
[ibm-mas-br]
type = s3
provider = IBMCOS
endpoint = s3.eu-es.cloud-object-storage.appdomain.cloud
access_key_id = xxxx
secret_access_key = xxxx
location_constraint = eu-standard
acl = private

Full backup all manage data for the MAS_INSTANCE_ID instance and MAS_WORKSPACE_ID workspace

export ANSIBLE_LOG_PATH=/tmp/ansible.log
export MASBR_CONFIRM_CLUSTER=false
export MASBR_CREATE_TASK_JOB=true
export MASBR_MASCLI_IMAGE_TAG=10.9.2

export MASBR_ACTION=backup
export MASBR_STORAGE_TYPE=cloud
export MASBR_STORAGE_CLOUD_RCLONE_FILE=/mnt/home/rclone.conf
export MASBR_STORAGE_CLOUD_RCLONE_NAME=ibm-mas-br
export MASBR_STORAGE_CLOUD_BUCKET=masbrdemo
export MAS_INSTANCE_ID=masbrtest
export MAS_WORKSPACE_ID=prod
export DB2_INSTANCE_NAME=mas-masbrtest-prod-manage
ansible-playbook ibm.mas_devops.br_manage

successful backup in S3 bucket.

[ibmmas/cli:10.9.2]mascli$ rclone lsd --no-check-certificate --config /mnt/home/rclone.conf ibm-mas-br:masbrdemo/backups
0 2000-01-01 00:00:00 -1 core-masbrtest-full-20240920113059
0 2000-01-01 00:00:00 -1 db2-mas-masbrtest-prod-manage-full-20240920113059
0 2000-01-01 00:00:00 -1 manage-masbrtest-full-20240920113059
0 2000-01-01 00:00:00 -1 mongodb-masbrtest-full-20240920113059
[ibmmas/cli:10.9.2]mascli$

oc login cluster DST

fresh mas install with same MAS_INSTANCE_ID and MAS_WORKSPACE_ID

db2 recovery from S3

export ANSIBLE_LOG_PATH=/tmp/ansible.log
export MASBR_CONFIRM_CLUSTER=false
export MASBR_CREATE_TASK_JOB=true
export MASBR_MASCLI_IMAGE_TAG=10.9.2

export MASBR_ACTION=restore
export MASBR_STORAGE_TYPE=cloud
export MASBR_STORAGE_CLOUD_RCLONE_FILE=/mnt/home/rclone.conf
export MASBR_STORAGE_CLOUD_RCLONE_NAME=ibm-mas-br
export MASBR_RESTORE_FROM_VERSION=20240920113059
export MASBR_STORAGE_CLOUD_BUCKET=masbrdemo
export MAS_INSTANCE_ID=masbrtest
export MAS_WORKSPACE_ID=prod
export DB2_INSTANCE_NAME=mas-masbrtest-prod-manage
ansible-playbook ibm.mas_devops.br_db2

the recovery job is not even launched to the Openshift because there is an error creating the configmap storing rclone config.
Basically the logic in ansible to build the config map creates a too long name which is not supported by OpenShift.
The relevant logs have been attached.

Relevant log output

TASK [Create configmap to save rclone config] *********************************************************************************
fatal: [localhost]: FAILED! => changed=false 
  error: 422
  msg: 'ConfigMap restore-full-20240920113059-20240920125549: Failed to create object: b''{"kind":"Status","apiVersion":"v1","metadata":{},"status":"Failure","message":"ConfigMap \\"restore-full-20240920113059-20240920125549\\" is invalid: metadata.labels: Invalid value: \\"db2-mas-masbrtest-prod-manage-full-20240920113059-20240920125549\\": must be no more than 63 characters","reason":"Invalid","details":{"name":"restore-full-20240920113059-20240920125549","kind":"ConfigMap","causes":[{"reason":"FieldValueInvalid","message":"Invalid value: \\"db2-mas-masbrtest-prod-manage-full-20240920113059-20240920125549\\": must be no more than 63 characters","field":"metadata.labels"}]},"code":422}\n'''
  reason: Unprocessable Entity
  status: 422
@guillemmayolramis1 guillemmayolramis1 added the Bug Report Something isn't working label Sep 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Report Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant