Catastrophic Failure at getContainerNameFromURL (ContainerClient) #23173
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.
question
The issue doesn't require a change to the product in order to be resolved. Most issues start as that
Storage
Storage Service (Queues, Blobs, Files)
"dependencies": {
"@azure/storage-blob": "^12.11.0",
"@emotion/react": "11.10.4",
"@emotion/styled": "11.10.4",
"@mui/icons-material": "5.10.3",
"@mui/material": "5.10.3",
"@types/react": "18.0.18",
"@types/react-dom": "18.0.6",
"@types/uuid": "^8.3.4",
"blob-util": "^2.0.2",
"dotenv-webpack": "^8.0.1",
"react": "^18.2.0",
"react-cropper": "^2.1.8",
"react-dom": "^18.2.0",
"react-image-file-resizer": "^0.4.8",
"rxjs": "7.5.6",
"style-loader": "^3.3.1"
},
"devDependencies": {
"css-loader": "^6.7.1",
"file-loader": "^6.2.0",
"filemanager-webpack-plugin": "^7.0.0",
"source-map-loader": "^3.0.1",
"ts-loader": "^9.2.8",
"typescript": "^4.6.3",
"webpack": "^5.71.0",
"webpack-cli": "^4.9.2"
}
Describe the bug
I have created a local instance of Azurite.
I have connected to it with Azure Storage Explorer.
I have create a CORS policy.
I can successfully create an instance of a Blob Service Client.
I call the method:
blobServiceClient.getContainerClient(<name>)
Uncaught (in promise) Error: Unable to extract containerName with provided information.
at ContainerClient.getContainerNameFromUrl (ContainerClient.ts:2122:13)
at new ContainerClient (ContainerClient.ts:772:32)
at BlobServiceClient.getContainerClient (BlobServiceClient.ts:505:12)
at newTestLocal.tsx:29:51
at Generator.next ()
at fulfilled (mainPresenter.tsx:428:29)
To Reproduce
Steps to reproduce the behavior:
Expected behavior
No error and a return to state either the blob is available or not
Screenshots

Blob Service Client created
Error shown:

This is clearly happening because the Blob Service Client has a URL which is complete jank consisting of the SAS token - and when calling the getContainerClient - it blows up completely, because along the construction path, someone decided it would be a good idea to try and extract the container name from a URL - even thought it is explicitly provided as a parameter.
I note here is your instructions:
https://docs.microsoft.com/en-us/javascript/api/@azure/storage-blob/blobserviceclient?view=azure-node-latest#@azure-storage-blob-blobserviceclient-getcontainerclient
A work around would be most appreciated asap.
The text was updated successfully, but these errors were encountered: