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

Open
pt-kojoa opened this issue Nov 13, 2024 · 3 comments
Open

azure/blob-storage uploadStream and MissingRequiredHeader #31744

pt-kojoa opened this issue Nov 13, 2024 · 3 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-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)

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.

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-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)
Projects
None yet
Development

No branches or pull requests

3 participants