Open taisuke-fujimoto opened 5 months ago
Thanks for reporting this @taisuke-fujimoto.
Looking through the stack trace something seems a bit off here, nothing you did just something I noticed, where createTable
is attempting to deserialize the response as XML but the documentation for the REST API says it should be JSON:
If possible, could you get a capture of what Azurite is returning for a response when this API is called.
@alzimmermsft Captured from Azurite debug log.
2024-06-04T03:12:51.029Z d72b49e6-8202-42cb-8b8a-2b0414591db9 info: TableStorageContextMiddleware: RequestMethod=POST RequestURL=http://127.0.0.1/devstoreaccount1/Tables RequestHeaders:{"host":"127.0.0.1:10002","date":"Tue, 04 Jun 2024 03:12:50 GMT","authorization":"SharedKeyLite devstoreaccount1:cq445rmWGNkGen9sV2RWNEmyLeiGi4kAsyMhyk24ELw=","x-ms-version":"2020-12-06","prefer":"return-no-content","content-type":"application/json;odata=nometadata","dataserviceversion":"3.0","x-ms-client-request-id":"f3601329-d7f5-4b22-9994-474088931aac","accept":"application/json;odata=minimalmetadata","user-agent":"azsdk-java-azure-data-tables/12.4.0 (17.0.6; Windows 11; 10.0)","content-length":"20"} ClientIP=172.17.0.1 Protocol=http HTTPVersion=1.1
2024-06-04T03:12:51.039Z d72b49e6-8202-42cb-8b8a-2b0414591db9 error: ErrorMiddleware: Set HTTP body: "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?>\n<Error>\n <Code>AuthorizationFailure</Code>\n <Message>Server failed to authenticate the request. Make sure the value of the Authorization header is formed correctly including the signature.\nRequestId:d72b49e6-8202-42cb-8b8a-2b0414591db9\nTime:2024-06-04T03:12:51.035Z</Message>\n</Error>"
2024-06-04T03:12:51.040Z d72b49e6-8202-42cb-8b8a-2b0414591db9 info: EndMiddleware: End response. TotalTimeInMS=12 StatusCode=403 StatusMessage=Forbidden Headers={"server":"Azurite-Table/3.30.0","x-ms-error-code":"AuthorizationFailure","x-ms-request-id":"d72b49e6-8202-42cb-8b8a-2b0414591db9","x-ms-version":"2024-05-04","content-type":"application/xml"}
Even with the latest version of Azurite (3.30.0), the response when an authentication error occurs is XML.
Thanks for sharing that @taisuke-fujimoto.
@jairmyree, @vcolin7 could you follow-up and do a comparison of the behavior when using the Tables service instead of Azurite. If the behaviors are different we can follow-up with Azurite to be consistent with the service, if the behaviors are the same we'll need to investigate further as this would mean that the service returns different error formats on authentication issues vs invalid request issues.
Describe the bug TableAsyncClient operation does not finish under the following conditions:
AccountKey
in the connection string is incorrectThis only happens in Azurite, so it's not a big issue, but it's a concern that the library is missing unexpected errors in asynchronous processing.
Exception or Stack Trace This is WARN log.
To Reproduce https://github.com/taisuke-fujimoto/azure-tables-bug-by-incorrect-connection-string
Code Snippet
Expected behavior TableAsyncClient operation should finish with an exception.
Setup (please complete the following information):