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

Object Storage HEAD requests to buckets fail #517

Open
mikattack opened this issue Jul 12, 2024 · 1 comment
Open

Object Storage HEAD requests to buckets fail #517

mikattack opened this issue Jul 12, 2024 · 1 comment

Comments

@mikattack
Copy link

mikattack commented Jul 12, 2024

SDK Version: 65

Given an authenticated session, some code like the following:

osc, err := objectstorage.NewObjectStorageClientWithConfigurationProvider(provider)
if err != nil {
	return objectstorage.HeadBucketResponse{}, err
}

req := objectstorage.HeadBucketRequest{
	BucketName:    common.String(cfg.ObjectStorage.Bucket),
	NamespaceName: common.String(cfg.ObjectStorage.Namespace),
}

rsp, err := osc.HeadBucket(context.Background(), req)
if rsp.RawResponse.StatusCode == http.StatusUnauthorized {
	return rsp, AuthenticationFailure
}
return rsp, err

...fails with a an error like the following:

Error returned by ObjectStorage Service. Http Status Code: 401. Error Code: BadErrorResponse.
Opc request id: iad-1:zSYuRlNaTRBe4ENuRqsNzg1c3-b7p-ZBQYMOxm0aa-pRICqAIoQ5Ui1hLLiOmjdW. 
Message: Failed to parse json from response body due to: unexpected end of JSON input. 
With response body .

The response body should not be parsed for HEAD requests, as there should never be a response body with HEAD responses.

I believe this is an error in the SDK.

@richachugh11
Copy link

hi @mikattack , I wanted to follow up to see if you are still facing this issue? If so, can you try accessing other buckets or performing different operations to determine if the issue is specific to this bucket?

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

No branches or pull requests

2 participants