Skip to content

File upload issue with @azure/storage-file-datalake #18854

@ptmkarvinen

Description

@ptmkarvinen

What version of Bun is running?

1.2.8+adab0f64f

What platform is your computer?

Darwin 24.3.0 arm64 arm

What steps can reproduce the bug?

package.json:
"@azure/storage-file-datalake": "^12.26.0"

Example code:

import { DataLakeServiceClient } from "@azure/storage-file-datalake"
const connStr = process.env.AZURE_STORAGE_CONNECTION_STRING || "";
const dataLakeServiceClient = DataLakeServiceClient.fromConnectionString(connStr);

const fileName = "testfile.txt"
const filesystem = 'test'
const fileClient = dataLakeServiceClient.getFileSystemClient(filesystem).getFileClient(fileName)
try{
  let res = await fileClient.uploadFile(fileName)
  console.log(res)
}
catch(err:any){
  console.error(err.details)
}

File uploads larger than 64K will fail with an authentication error.

What is the expected behavior?

File upload would complete successfully.

What do you see instead?

File upload fails with a following error:

{
  clientRequestId: "XXXXXXX",
  requestId: "XXXXXXX",
  version: "2025-05-05",
  "content-length": "719",
  "content-type": "application/json;charset=utf-8",
  date: "Tue, 08 Apr 2025 06:55:34 GMT",
  server: "Windows-Azure-HDFS/1.0 Microsoft-HTTPAPI/2.0",
  "x-ms-error-code": "AuthenticationFailed",
  error: {
    code: "AuthenticationFailed",
    message: "Server failed to authenticate the request. Make sure the value of Authorization header is formed correctly including the signature.\nRequestId:XXXXXXX\nTime:2025-04-08T06:55:34.7019366Z",
    detail: {
      AuthenticationErrorDetail: "The MAC signature found in the HTTP request 'XXXXXXX' is not the same as any computed signature. Server used following string to sign: 'PATCH\n\n\n\n\napplication/json\n\n\n\n\n\n\nx-ms-client-request-id:XXXXXXX\nx-ms-date:Tue, 08 Apr 2025 06:55:34 GMT\nx-ms-version:2025-05-05\n/XXXXXXX/test/testfile.txt\naction:append\nposition:0'.",
    },
  },
}

Additional information

Prior to Bun 1.2.8, the file upload failed with a missing Content-Length header instead, starting with Bun version 1.1.43.

Upload works as intended on Bun 1.1.42.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingecosystemSomething that relates to package or framework compatibilitynode.jsCompatibility with Node.js APIsregression

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions