-
Notifications
You must be signed in to change notification settings - Fork 320
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
azure-sdk-for-go AppendBlock operation resolves to AppendBlobHandler.create() #702
Comments
Small update: I tried running
I don't see any duplication of the |
[Wei] I am a little confused on this. Do you mean you would like to append block, but azurite actually created append blob? Per the rest doc of create blob and append block, you need add "?comp=appendblock" in the Uri to indicate you need append block. Have you add it when try to append block?
[Wei] per the rest doc of append block, it does not support x-ms-blob-type header. Why you want to add it, or even make it mandatory? This might will break other user of Azurite. |
Hey @blueww, thank you for looking into this issue and sharing links to the relevant documentation! Here is the Azurite debug log (for v3.11.0) 2021-02-26T21:47:22.333Z info: Azurite Blob service is starting on 0.0.0.0:10000 In there, you can observe that
That's understandable, but I feel this REST API has been formalised after My proposal to mark the I assumed that the lack of the As an alternative, I put together a hack in #710, which is only active when the |
@mihaitodor |
@blueww Unfortunately, that code is quite tangled and brittle. I fear changing this behaviour in it might cause unintended side-effects. |
Would you please file an issue on Go SDK repo https://github.com/Azure/azure-sdk-for-go, and see if Go SDK owner can help to fix it. Besides that, I will also try to ping the SDK owner to see if they can help to fix it. |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
Which service(blob, file, queue, table) does this issue concern?
blob
Which version of the Azurite was used?
Latest (v3.11.0)
Where do you get Azurite? (npm, DockerHub, NuGet, Visual Studio Code Extension)
DockerHub (
mcr.microsoft.com/azure-storage/azurite:3.11.0
)What's the Node.js version?
Whatever the
mcr.microsoft.com/azure-storage/azurite:3.11.0
docker container is runningWhat problem was encountered?
Blob.AppendBlock
gets resolved toAppendBlobHandler.create()
instead ofAppendBlobHandler.appendBlock()
. This is happening because the API specification requires thecomp
query parameter for theAppendBlob_AppendBlock
operation, while theAppendBlob_Create
operation requires thex-ms-blob-type
header, which makes it equivalent to theAppendBlob_Create
operation indispatchMiddleware
(keys 59 and 60 return the sameconditionsMet
) because both of them contain theContent-Length
header.Would it be possible to make the
x-ms-blob-type
header mandatory for theAppendBlob_AppendBlock
operation? This will probably require doing the same forAppendBlob_AppendBlockFromUrl
, so it won't end up being confused withAppendBlob_AppendBlock
. I'm happy to submit a PR for this if you can provide the steps to re-generate the code from the swagger definition.Steps to reproduce the issue?
Run the following code:
Have you found a mitigation/solution?
Sadly, no workaround...
Would it be possible to make the
x-ms-blob-type
header mandatory for theAppendBlob_AppendBlock
operation? This will probably require doing the same forAppendBlob_AppendBlockFromUrl
, so it won't end up being confused withAppendBlob_AppendBlock
. I'm happy to submit a PR for this if you can provide the steps to re-generate the code from the swagger definition.I would very much hope to see this fixed, if possible. Upgrading to the new azure-storage-blob-go API is not feasible for now (although I think that one might encounter the same issue).
The text was updated successfully, but these errors were encountered: