question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

When getting account information Azurite returns a 400 error

See original GitHub issue

Which service(blob, file, queue, table) does this issue concern?

Blob

Which version of the Azurite was used?

3.13.0

Where do you get Azurite? (npm, DockerHub, NuGet, Visual Studio Code Extension)

DockerHub mcr.microsoft.com/azure-storage/azurite:3.13.0

What’s the Node.js version?

N/A

What problem was encountered?

When trying to get account information, Azurite throws a 400: The specifed resource name contains invalid characters

I think it is related to PR #799 and issue #456

Steps to reproduce the issue?

In python (runs as async)

from azure.storage.blob.aio import BlobServiceClient

blob_service_client = BlobServiceClient.from_connection_string({insert default azurite connection string here})

await blob_service_client.get_account_information()

Started the container with

azurite-blob --blobHost 0.0.0.0 --loose -d /tmp/debug.log
Debug log
2021-06-09T10:55:34.069Z 	 info: Azurite Blob service is starting on 0.0.0.0:10000
2021-06-09T10:55:34.071Z 	 info: AccountDataStore:init() Refresh accounts from environment variable AZURITE_ACCOUNTS with value undefined
2021-06-09T10:55:34.071Z 	 info: AccountDataStore:init() Fallback to default emulator account devstoreaccount1.
2021-06-09T10:55:34.086Z 	 info: BlobGCManager:start() Starting BlobGCManager. Set status to Initializing.
2021-06-09T10:55:34.087Z 	 info: BlobGCManager:start() Trigger mark and sweep loop. Set status to Running.
2021-06-09T10:55:34.087Z 	 info: BlobGCManager:markSweepLoop() Start next mark and sweep.
2021-06-09T10:55:34.087Z 	 info: BlobGCManager:markSweep() Get all extents.
2021-06-09T10:55:34.088Z 	 info: BlobGCManager:start() BlobGCManager successfully started.
2021-06-09T10:55:34.090Z 	 info: BlobGCManager:markSweep() Got 0 extents.
2021-06-09T10:55:34.091Z 	 info: BlobGCManager:markSweep() Get referred extents.
2021-06-09T10:55:34.092Z 	 info: BlobGCManager:markSweep() Got referred extents, unreferenced extents count is 0.
2021-06-09T10:55:34.092Z 	 info: BlobGCManager:markSweepLoop() Mark and sweep finished, taken 5ms.
2021-06-09T10:55:34.092Z 	 info: BlobGCManager:markSweepLoop() Sleep for 600000ms.
2021-06-09T10:55:34.093Z 	 info: Azurite Blob service successfully listens on http://0.0.0.0:10000
2021-06-09T10:55:43.057Z 12d59669-022f-4104-94e0-44a1f97532a4 info: BlobStorageContextMiddleware: RequestMethod=GET RequestURL=http://localhost/devstoreaccount1/?restype=account&comp=properties RequestHeaders:{"host":"localhost:10000","x-ms-version":"2020-06-12","accept":"application/xml","x-ms-date":"Wed, 09 Jun 2021 10:55:43 GMT","x-ms-client-request-id":"3c695402-c911-11eb-bce3-acde48001122","user-agent":"azsdk-python-storage-blob/12.8.1 Python/3.9.5 (macOS-11.5-x86_64-i386-64bit)","authorization":"SharedKey devstoreaccount1:NKyDtXIQ6oEG2FAGPkkAk3C8lsJTKQikWSos0tmbbo4=","accept-encoding":"gzip, deflate"} ClientIP=172.19.0.1 Protocol=http HTTPVersion=1.1
2021-06-09T10:55:43.066Z 12d59669-022f-4104-94e0-44a1f97532a4 error: ErrorMiddleware: Received a MiddlewareError, fill error information to HTTP response
2021-06-09T10:55:43.066Z 12d59669-022f-4104-94e0-44a1f97532a4 error: ErrorMiddleware: ErrorName=StorageError ErrorMessage=The specifed resource name contains invalid characters.  ErrorHTTPStatusCode=400 ErrorHTTPStatusMessage=The specifed resource name contains invalid characters. ErrorHTTPHeaders={"x-ms-error-code":"InvalidResourceName","x-ms-request-id":"12d59669-022f-4104-94e0-44a1f97532a4"} ErrorHTTPBody="<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?>\n<Error>\n  <Code>InvalidResourceName</Code>\n  <Message>The specifed resource name contains invalid characters.\nRequestId:12d59669-022f-4104-94e0-44a1f97532a4\nTime:2021-06-09T10:55:43.058Z</Message>\n</Error>" ErrorStack="StorageError: The specifed resource name contains invalid characters.\n    at Function.getInvalidResourceName (/opt/azurite/dist/src/blob/errors/StorageErrorFactory.js:228:16)\n    at Object.validateContainerName (/opt/azurite/dist/src/blob/utils/utils.js:109:45)\n    at blobStorageContextMiddleware (/opt/azurite/dist/src/blob/middlewares/blobStorageContext.middleware.js:68:17)\n    at /opt/azurite/dist/src/blob/middlewares/blobStorageContext.middleware.js:14:16\n    at Layer.handle [as handle_request] (/opt/azurite/node_modules/express/lib/router/layer.js:95:5)\n    at trim_prefix (/opt/azurite/node_modules/express/lib/router/index.js:317:13)\n    at /opt/azurite/node_modules/express/lib/router/index.js:284:7\n    at Function.process_params (/opt/azurite/node_modules/express/lib/router/index.js:335:12)\n    at next (/opt/azurite/node_modules/express/lib/router/index.js:275:10)\n    at logger (/opt/azurite/node_modules/morgan/index.js:144:5)"
2021-06-09T10:55:43.066Z 12d59669-022f-4104-94e0-44a1f97532a4 error: ErrorMiddleware: Set HTTP code: 400
2021-06-09T10:55:43.066Z 12d59669-022f-4104-94e0-44a1f97532a4 error: ErrorMiddleware: Set HTTP status message: The specifed resource name contains invalid characters.
2021-06-09T10:55:43.067Z 12d59669-022f-4104-94e0-44a1f97532a4 error: ErrorMiddleware: Set HTTP Header: x-ms-error-code=InvalidResourceName
2021-06-09T10:55:43.067Z 12d59669-022f-4104-94e0-44a1f97532a4 error: ErrorMiddleware: Set HTTP Header: x-ms-request-id=12d59669-022f-4104-94e0-44a1f97532a4
2021-06-09T10:55:43.067Z 12d59669-022f-4104-94e0-44a1f97532a4 error: ErrorMiddleware: Set content type: application/xml
2021-06-09T10:55:43.067Z 12d59669-022f-4104-94e0-44a1f97532a4 error: ErrorMiddleware: Set HTTP body: "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?>\n<Error>\n  <Code>InvalidResourceName</Code>\n  <Message>The specifed resource name contains invalid characters.\nRequestId:12d59669-022f-4104-94e0-44a1f97532a4\nTime:2021-06-09T10:55:43.058Z</Message>\n</Error>"
2021-06-09T10:55:43.070Z 12d59669-022f-4104-94e0-44a1f97532a4 info: EndMiddleware: End response. TotalTimeInMS=14 StatusCode=400 StatusMessage=The specifed resource name contains invalid characters. Headers={"server":"Azurite-Blob/3.13.0","x-ms-error-code":"InvalidResourceName","x-ms-request-id":"12d59669-022f-4104-94e0-44a1f97532a4","content-type":"application/xml"}

Have you found a mitigation/solution?

Will be using 3.12.0 until resolved.

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:10 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
ayuinacommented, Jun 11, 2021

Version 3.13.1 seems to run as expected now. Thanks to you, I can continue developing logic apps in local environment. This is my original purpose to use Azurite. Of course Storage Explorer doesn’t show any error too.

1reaction
bluewwcommented, Jun 11, 2021

@ayuina , @omBratteng

Azurite 3.13.1 has released to fix this issue. I will close this issue , as the fix is already released.

Feel free to contact us again if you need further assistance on Azurite.

Read more comments on GitHub >

github_iconTop Results From Across the Web

azurite blob store returns 400 Bad Request when accessed ...
400 Bad Request is returned when accessing blobs over a network using a DNS hostname rather than IP. Steps to reproduce the issue?...
Read more >
I am getting Bad Request (400) messages for Emulated and ...
I am storing the Azure Connection string in the appSettings section, and in this simple example I have tried pointing at a real...
Read more >
Azure Blob Storage error codes - Microsoft Learn
Error code HTTP status code User message BlobAlreadyExists Conflict (409) The specified blob already exists. BlobNotFound Not Found (404) The specified blob does not exist. ContainerAlreadyExists...
Read more >
How to Fix a 400 Bad Request Error (Causes and Fixes) - Kinsta
The 400 Bad Request error indicates that the server cannot or process the request due to a client error. Read about the common...
Read more >
Azure Blob 400 Bad request on Creation of container - Intellipaat
as soon as the if the statement is executed I'm getting the following exception: {"The remote server returned an error: (400) Bad Request."}....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found