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

azure/blob-storage uploadStream and MissingRequiredHeader #31744

Closed
pt-kojoa opened this issue Nov 13, 2024 · 7 comments
Closed

azure/blob-storage uploadStream and MissingRequiredHeader #31744

pt-kojoa opened this issue Nov 13, 2024 · 7 comments
Assignees
Labels
Client This issue points to a problem in the data-plane of the library. customer-reported Issues that are reported by GitHub users external to the Azure organization. needs-author-feedback Workflow: More information is needed from author to address the issue. no-recent-activity There has been no recent activity on this issue. question The issue doesn't require a change to the product in order to be resolved. Most issues start as that Service Attention Workflow: This issue is responsible by Azure service team. Storage Storage Service (Queues, Blobs, Files)

Comments

@pt-kojoa
Copy link

Hello,

could someone help resolve this weird blob storage uploadStream case?

I have set up blob storage to Azure account number 1 and SAS token for the container. Blob gets uploaded just fine.
On Azure account number 2 there is similar blob storage setup but suddenly API gives an error. Below attached the SDK error:

{
    "name": "RestError",
    "code": "MissingRequiredHeader",
    "statusCode": 400,
    "details": {
        "errorCode": "MissingRequiredHeader",
        "content-length": "301",
        "content-type": "application/xml",
        "server": "Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0",
        "x-ms-request-id": "REDACTED",
        "x-ms-version": "2024-11-04",
        "x-ms-client-request-id": "REDACTED",
        "date": "Wed, 13 Nov 2024 10:58:16 GMT",
        "message": "An HTTP header that's mandatory for this request is not specified.\nRequestId:REDACTED\nTime:2024-11-13T10:58:16.8205243Z",
        "code": "MissingRequiredHeader",
        "HeaderName": "x-ms-blob-type"
    },
    "request": {
        "url": "https://REDACTED.blob.core.windows.net/REDACTED/hello.txt?sv=REDACTED&ss=REDACTED&srt=REDACTED&sp=REDACTED&se=REDACTED&st=REDACTED&sip=REDACTED&spr=REDACTED&Sig=REDACTED&comp=REDACTED&blockid=REDACTED",
        "headers": {
            "content-type": "application/octet-stream",
            "x-ms-version": "REDACTED",
            "content-length": "20",
            "accept": "application/xml",
            "user-agent": "azsdk-js-azure-storage-blob/12.25.0 core-rest-pipeline/1.17.0 Node/18.20.4 OS/(x64-Linux-5.10.226-235.879.amzn2.x86_64)",
            "x-ms-client-request-id": "REDACTED"
        },
        "method": "PUT",
        "timeout": 0,
        "disableKeepAlive": false,
        "streamResponseStatusCodes": {},
        "withCredentials": false,
        "tracingOptions": {
            "tracingContext": {
                "_contextMap": {}
            }
        },
        "requestId": "REDACTED",
        "allowInsecureConnection": true,
        "enableBrowserStreams": false
    }
}

And here is minimal code to reproduce the error (although it seems it works and doesn't depending on Azure account):

    const blobServiceClient = new BlobServiceClient(
      'https://REDACTED.blob.core.windows.net?REDACTED_SAS_TOKEN'
    );

    const containerClient = blobServiceClient.getContainerClient('REDACTED_CONTAINER_NAME');
    const blockBlobClient = containerClient.getBlockBlobClient('REDACTED_FILE_NAME');
    
    const result = await blockBlobClient.uploadStream(
      readableStream
    );

uploadStream doesn't seem to allow me to add that header?

@github-actions github-actions bot added Client This issue points to a problem in the data-plane of the library. customer-reported Issues that are reported by GitHub users external to the Azure organization. needs-team-attention Workflow: This issue needs attention from Azure service team or SDK team question The issue doesn't require a change to the product in order to be resolved. Most issues start as that Service Attention Workflow: This issue is responsible by Azure service team. Storage Storage Service (Queues, Blobs, Files) labels Nov 13, 2024
Copy link

Thanks for the feedback! We are routing this to the appropriate team for follow-up. cc @xgithubtriage.

@pt-kojoa
Copy link
Author

This might be related to some VNET configs on another account but I can't see their storage settings so really difficult to say. I think they are trying to do some IP-restrictions.

@sshvaiko
Copy link

@pt-kojoa we faces the same issue. After we downgraded package 12.18.0, it started working... Please try.

@EmmaZhu
Copy link
Member

EmmaZhu commented Dec 10, 2024

Hi @pt-kojoa ,

Could share the names for the two accounts to me? Could you help to reproduce the issue and share the request id in the error message to me:
"message": "An HTTP header that's mandatory for this request is not specified.\nRequestId:REDACTED\nTime:2024-11-13T10:58:16.8205243Z",

@xirzec xirzec added the needs-author-feedback Workflow: More information is needed from author to address the issue. label Dec 20, 2024
@github-actions github-actions bot removed the needs-team-attention Workflow: This issue needs attention from Azure service team or SDK team label Dec 20, 2024
Copy link

Hi @pt-kojoa. Thank you for opening this issue and giving us the opportunity to assist. To help our team better understand your issue and the details of your scenario please provide a response to the question asked above or the information requested above. This will help us more accurately address your issue.

Copy link

Hi @pt-kojoa, we're sending this friendly reminder because we haven't heard back from you in 7 days. We need more information about this issue to help address it. Please be sure to give us your input. If we don't hear back from you within 14 days of this comment the issue will be automatically closed. Thank you!

@github-actions github-actions bot added the no-recent-activity There has been no recent activity on this issue. label Dec 27, 2024
@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale Jan 11, 2025
@m1k1o
Copy link

m1k1o commented Jan 11, 2025

   "code": "MissingRequiredHeader",
   "HeaderName": "x-ms-blob-type"

You are missing x-ms-blob-type header.

Per documentation x-ms-blob-type is Required.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Client This issue points to a problem in the data-plane of the library. customer-reported Issues that are reported by GitHub users external to the Azure organization. needs-author-feedback Workflow: More information is needed from author to address the issue. no-recent-activity There has been no recent activity on this issue. question The issue doesn't require a change to the product in order to be resolved. Most issues start as that Service Attention Workflow: This issue is responsible by Azure service team. Storage Storage Service (Queues, Blobs, Files)
Projects
None yet
Development

No branches or pull requests

5 participants