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

Fixes issue with AzureBlobStore blockid incorrectly using base64url encoding #208

Merged
merged 1 commit into from
Aug 4, 2024

Conversation

twick00
Copy link

@twick00 twick00 commented Aug 2, 2024

Despite JCLOUDS-1615, using base64url encoded values is not supported by the Put Block endpoint.

When attempting to query this endpoint with partNumber set to 248 (which is blockid: AAAA-A==) I received this error:

<?xml version="1.0" encoding="utf-8"?><Error><Code>InvalidQueryParameterValue</Code><Message>Value for one of the query parameters specified in the request URI is invalid.
RequestId:632a8422-501e-006c-3db4-e238fb000000
Time:2024-07-30T19:10:34.4638223Z</Message><QueryParameterName>blockid</QueryParameterName><QueryParameterValue>AAAA-A==</QueryParameterValue><Reason>Not a valid base64 string.</Reason></Error>

I have confirmed directly with Microsoft that the correct value here is a standard base64 string that is url encoded, which should not be confused with base64url encoding which is NOT supported.

As far as the original ticket (JCLOUDS-1615) which mentions an error related to + reporting as not a valid base64 string, I have tried to replicate the issue and I am unable to do so. My guess is that this was a bug that existed on Microsoft's side and they have since fixed it. Either way, from their own words, it should be a base64 string. + and / are supported.

}
static String makeBlockId(int partNumber) {
// Azure expects a base64-encoded string ONLY. It does not support base64url encoding.
return BaseEncoding.base64().encode(Ints.toByteArray(partNumber));
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The url encoding is handled downstream by org.jclouds.util.Strings2's urlEncode method.

@twick00
Copy link
Author

twick00 commented Aug 2, 2024

I know this is not the correct venue for this but I also tried to sign up to report the issue via jclouds' Jira but nobody has responded to that request in the last week. I also tried contacting the IRC mentioned on the community page and there is practically nobody in there.

I would love to help contribute more to this project but this seems to be the only possible option right now.

@gaul gaul merged commit 6ef293d into apache:master Aug 4, 2024
1 check passed
@gaul
Copy link
Member

gaul commented Aug 4, 2024

Thank you for your contribution @twick00! I approved the JIRA request. I only use the mailing list not IRC or Slack.

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