Unexpected AbortError @azure/storage-file-share
andregrossinho opened this issue · comments
- Package Name: @azure/storage-file-share
- Package Version: 12.26.0
- Operating system:
- nodejs
- version: 22
- browser
- name/version:
- typescript
- version:
- Is the bug related to documentation in
- README.md
- source code documentation
- SDK API docs on https://learn.microsoft.com
Describe the bug
After upgrading Node.js from version 18 to 22, we started facing multiple errors while trying to download files from Azure Storage using this function:
async function downloadFile(directoryName, fileName) {
try {
directoryName = config.get("azure_storage_account.envFolder") + '/' + directoryName;
let shareClient = serviceClient.getShareClient(shareName);
let directoryClient = shareClient.getDirectoryClient(directoryName);
let fileClient = directoryClient.getFileClient(fileName);
let exists = await existsFileStorage(directoryName, fileName)
if(!exists) {
shareClient = serviceClient.getShareClient(shareNameHistory);
directoryClient = shareClient.getDirectoryClient(directoryName);
fileClient = directoryClient.getFileClient(fileName);
}
// Get file content from position 0 to the end
// In Node.js, get downloaded data by accessing downloadFileResponse.readableStreamBody
const result = await fileClient.download();
return result;
} catch (error) {
throw error;
}
}
The error that occurs is: AbortError: The operation was aborted at /usr/src/app/api/node_modules/@azure/storage-file-share/dist/index.js in RetriableReadableStream.sourceAbortedHandler at line 12647:32
This error only occurs in production, where the API is running inside a container in Azure. We are unable to reproduce it locally.
We downgraded to Node.js 18, and the errors stopped happening.
Screenshots
Thanks for the feedback! We are routing this to the appropriate team for follow-up. cc @xgithubtriage.