Bug 2028776

Summary: Upload to MCG bucket with set quota fails
Product: [Red Hat Storage] Red Hat OpenShift Data Foundation Reporter: Filip Balák <fbalak>
Component: Multi-Cloud Object GatewayAssignee: Nimrod Becker <nbecker>
Status: CLOSED NOTABUG QA Contact: Raz Tamir <ratamir>
Severity: high Docs Contact:
Priority: unspecified    
Version: 4.9CC: etamir, ocs-bugs, odf-bz-bot, rayalon
Target Milestone: ---Keywords: Regression, TestBlocker
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2021-12-06 13:34:33 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Filip Balák 2021-12-03 09:38:02 UTC
Description of problem (please be detailed as possible and provide log
snippests):
Due to a change done between versions v4.9.0-158.ci and 4.9.0-202.ci upload to MCG S3 bucket with set quota is failing with error:

E           ocs_ci.ocs.exceptions.CommandFailed: Error during execution of command: oc -n openshift-storage rsh function-awscli-relay-pod-ad064b4ca8c14d sh -c "AWS_CA_BUNDLE=/cert/service-ca.crt AWS_ACCESS_KEY_ID=* AWS_SECRET_ACCESS_KEY=* AWS_DEFAULT_REGION=us-east-2 aws s3 --endpoint=https://s3.openshift-storage.svc:443 cp /tmp/testfile s3://s3-bucket-1f61188d79b34bb9b6fc64a83c1f0c/testfile1".
E           Error is Error in configuration:
E           * context was not found for specified context: default/api-j-103vuf1cs36-t4a-qe-rh-ocs-com:6443/kube:admin
E           * cluster has no server defined

Version of all relevant components (if applicable):
OCS 4.9.0-249.ci
OCP 4.9.0-0.nightly-2021-11-29-233413

Does this issue impact your ability to continue to work with the product
(please explain in detail what is the user impact)?
Automated test test_noobaa_bucket_quota (https://github.com/red-hat-storage/ocs-ci/blob/master/tests/manage/monitoring/prometheus/test_noobaa.py#L23) is failing

Can this issue reproducible?
Yes

If this is a regression, please provide more details to justify this:
In previous OCS versions the test passes.

Steps to Reproduce:
1. Create MCG S3 bucket
2. Update bucket quota with RPC call containing data:
(
        "bucket_api",
        "update_bucket",
        {"name": <bucket name>, "quota": {"unit": "GIGABYTE", "size": 2}},
)
3. Upload file to the bucket.
$ aws s3 --endpoint=https://s3.openshift-storage.svc:443 cp /tmp/testfile s3://<bucket name>/testfile1

Actual results:
Upload fails with error:
Error is Error in configuration:
* context was not found for specified context: default/api-j-103vuf1cs36-t4a-qe-rh-ocs-com:6443/kube:admin
* cluster has no server defined

Expected results:
Upload works as in previous instances.

Additional info:
Test logs: http://magna002.ceph.redhat.com/ocsci-jenkins/openshift-clusters/j-103vuf1cs36-t4a/j-103vuf1cs36-t4a_20211125T120728/logs/ocs-ci-logs-1637846152/by_outcome/failed/tests/manage/monitoring/prometheus/test_noobaa.py/test_noobaa_bucket_quota/logs