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

Fixed issue when bucket exists, but 'usage' is empty due RGW bug #27

Merged
merged 1 commit into from
Dec 28, 2020

Conversation

k0ste
Copy link
Contributor

@k0ste k0ste commented Dec 21, 2020

Traceback (most recent call last):
  File "./check_ceph_rgw_api", line 116, in <module>
    sys.exit(main())
  File "./check_ceph_rgw_api", line 95, in main
    bucket_usage_kb = usage_dict['rgw.main']['size_kb_actual']
KeyError: 'rgw.main'

This possible with old RGW's due multipart bugs, for example
this bucket impossible to delete, because multiparts objects
is not exits. So better just skip this bucket.

{
    "object": "_multipart_obj_tag.txt.2~KFWA-rRXHsFLc45G3-rDFimIM4yD1aU.meta"
}
{
    "existing_header": {
        "usage": {
            "rgw.multimeta": {
                "size": 0,
                "size_actual": 0,
                "size_utilized": 0,
                "size_kb": 0,
                "size_kb_actual": 0,
                "size_kb_utilized": 0,
                "num_objects": 1
            }
        }
    },
    "calculated_header": {
        "usage": {
            "rgw.multimeta": {
                "size": 0,
                "size_actual": 0,
                "size_utilized": 0,
                "size_kb": 0,
                "size_kb_actual": 0,
                "size_kb_utilized": 0,
                "num_objects": 1
            }
        }
    }
}

```
Traceback (most recent call last):
  File "./check_ceph_rgw_api", line 116, in <module>
    sys.exit(main())
  File "./check_ceph_rgw_api", line 95, in main
    bucket_usage_kb = usage_dict['rgw.main']['size_kb_actual']
KeyError: 'rgw.main'
```

This possible with old RGW's due multipart bugs, for example
this bucket impossible to delete, because multiparts objects
is not exits. So better just skip this bucket.

```
{
    "object": "_multipart_obj_tag.txt.2~KFWA-rRXHsFLc45G3-rDFimIM4yD1aU.meta"
}
{
    "existing_header": {
        "usage": {
            "rgw.multimeta": {
                "size": 0,
                "size_actual": 0,
                "size_utilized": 0,
                "size_kb": 0,
                "size_kb_actual": 0,
                "size_kb_utilized": 0,
                "num_objects": 1
            }
        }
    },
    "calculated_header": {
        "usage": {
            "rgw.multimeta": {
                "size": 0,
                "size_actual": 0,
                "size_utilized": 0,
                "size_kb": 0,
                "size_kb_actual": 0,
                "size_kb_utilized": 0,
                "num_objects": 1
            }
        }
    }
}
```
@k0ste
Copy link
Contributor Author

k0ste commented Dec 21, 2020

@blemmenes I was catch this bug on my cluster, resolve #15

@blemmenes
Copy link
Owner

@k0ste , LGTM, no issues on our clusters. I'll merge.

@blemmenes blemmenes merged commit 4ed01f7 into blemmenes:master Dec 28, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants