red-hat-storage / ocs-ci

https://ocs-ci.readthedocs.io/en/latest/
MIT License
108 stars 166 forks source link

TestNSFSSystem failed due bucket not found in IBM cloud #10016

Open nagendra202 opened 3 months ago

nagendra202 commented 3 months ago

Test case is failing because of the error

E ocs_ci.ocs.exceptions.CommandFailed: Error during execution of command: oc --kubeconfig /Users/nnagendravaraprasadreddy/cnv_bm/new/auth/kubeconfig -n openshift-storage get obc s3-bucket-53ce38f4fc094362ac3501f1a8a6ac -n openshift-storage -o yaml. E Error is Error from server (NotFound): objectbucketclaims.objectbucket.io "s3-bucket-53ce38f4fc094362ac3501f1a8a6ac" not found

ocs_ci/utility/utils.py:704: CommandFail

The below teardown issue expected because of the above failure in test case execution. Observed a failure in teardown of tests/cross_functional/system_test/test_nsfs_system.py

ERROR at teardown of TestNSFSSystem.test_nsfs __

def finalizer():
    # Get the statefulset replica count
    sst_obj = OCP(
        kind=constants.STATEFULSET,
        namespace=config.ENV_DATA["cluster_namespace"],
    )
    noobaa_db_sst_obj = sst_obj.get(resource_name=constants.NOOBAA_DB_STATEFULSET)
    if noobaa_db_sst_obj["spec"]["replicas"] != 1:
        modify_statefulset_replica_count(
            statefulset_name=constants.NOOBAA_DB_STATEFULSET, replica_count=1
        ), f"Failed to scale up the statefulset {constants.NOOBAA_DB_STATEFULSET}"

    try:
      restore_pvc_objs[0].delete()

E IndexError: list index out of range

tests/cross_functional/conftest.py:513: IndexError

nagendra202 commented 3 months ago

I ran this test case locally and attached execution logs here. Test_execution_log.txt

nagendra202 commented 3 weeks ago

Latest update on this issue after merging other PRs related to NSFS:

Script fails at getting the status of the "newly created bucket" https://github.com/red-hat-storage/ocs-ci/blob/master/tests/conftest.py#L5964

`

01:38:32 - MainThread - /Users/nnagendravaraprasadreddy/project/ocs-ci/ocs_ci/ocs/resources/objectbucket.py - INFO - s3-bucket-d055a442fcb446b9ac726ee01d1047 status is NO_RESOURCES 01:38:32 - MainThread - /Users/nnagendravaraprasadreddy/project/ocs-ci/ocs_ci/ocs/resources/objectbucket.py - INFO - s3-bucket-d055a442fcb446b9ac726ee01d1047 is unhealthy. Rechecking. 01:38:32 - MainThread - /Users/nnagendravaraprasadreddy/project/ocs-ci/ocs_ci/ocs/resources/objectbucket.py - ERROR - s3-bucket-d055a442fcb446b9ac726ee01d1047 did not reach a healthy state within 180 seconds. 01:38:32 - MainThread - ocs_ci.utility.utils - INFO - Executing command: oc --kubeconfig /Users/nnagendravaraprasadreddy/cnv_bm/new/auth/kubeconfig -n openshift-storage get obc s3-bucket-d055a442fcb446b9ac726ee01d1047 -n openshift-storage -o yaml 01:38:34 - MainThread - ocs_ci.utility.utils - WARNING - Command stderr: Error from server (NotFound): objectbucketclaims.objectbucket.io "s3-bucket-d055a442fcb446b9ac726ee01d1047" not found

01:38:34 - MainThread - ocs_ci.ocs.ocp - WARNING - Failed to get resource: s3-bucket-d055a442fcb446b9ac726ee01d1047 of kind: obc, selector: None, Error: Error during execution of command: oc --kubeconfig /Users/nnagendravaraprasadreddy/cnv_bm/new/auth/kubeconfig -n openshift-storage get obc s3-bucket-d055a442fcb446b9ac726ee01d1047 -n openshift-storage -o yaml. Error is Error from server (NotFound): objectbucketclaims.objectbucket.io "s3-bucket-d055a442fcb446b9ac726ee01d1047" not found

`

manually verified: Bucket creation is success in the cluster. Tested it manually by writing data to the buckets created by automation. It worked.

nagendra202 commented 3 weeks ago

Yet to debug more on it to identify the problem in the script, why it is failing to get the correct status of the bucket.