Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Azure Durable Function does not finish when I configured Azurite with multiple Storage Accounts. #1854

Closed
ecormaksin opened this issue Mar 22, 2023 · 5 comments
Assignees
Labels
azure-function docker table-batch table-storage Relating to Azurite table storage implementation

Comments

@ecormaksin
Copy link
Contributor

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

table

Which version of the Azurite was used?

3.22.0

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

DockerHub

What's the Node.js version?

v14.17.0 (in Docker container)

What problem was encountered?

Firstly, I posted the same question to Microsoft Q&A. Then, the respondent (your company's staff) advised me to post an issue here.

I'm developing Azure Function (Python).

And I configuire Azurite with multiple Storage Accounts & Keys.
I use Azurite from container, so I configure docker-compose.yml as follows:

# (omission)
services:
  azurite:
    image: mcr.microsoft.com/azure-storage/azurite
    ports:
      - 10000:10000
      - 10001:10001
      - 10002:10002
    environment:
      - AZURITE_ACCOUNTS=local-dev-sa-001:cGFzc3dvcmQ=;local-dev-sa-003:cGFzc3dvcmQ=;
    # (omission)

And I configure local.settings.json in Azure Function code as follows (other value is omitted):

{
  "Values": {
    "AzureWebJobsStorage": "DefaultEndpointsProtocol=http;AccountName=local-dev-sa-001;AccountKey=cGFzc3dvcmQ=;BlobEndpoint=http://127.0.0.1:10000/local-dev-sa-001;QueueEndpoint=http://127.0.0.1:10001/local-dev-sa-001;TableEndpoint=http://127.0.0.1:10002/local-dev-sa-001;"
  }
}

When I launch Azure Function App from Visual Studio Code with F5 and execute Durable Funcion, the funcion does not finish. Not only that, the function is executed multiple times. I confirmed from the log output on Visual Studio Code terminal pane.

As for Azure Function, errors do not seem to happen.
When I access statusQueryGetUri of the Durable Function response, runtimeStatus is Pending.

The same code works fine when I use Azurite default configuration.

Steps to reproduce the issue?

I launched Azurite with debug log option.

Errors seem to happen as follows:

2023-03-17T04:59:23.245Z 972c1088-1962-4f2a-8daf-3fdb721e6109 error: ErrorMiddleware: Received an error, fill error information to HTTP response
2023-03-17T04:59:23.245Z 972c1088-1962-4f2a-8daf-3fdb721e6109 error: ErrorMiddleware: ErrorName=Error ErrorMessage=Couldn't extract path from URL in sub-Request:
 Content-Type: application/http
Content-Transfer-Encoding: binary

PUT http://127.0.0.1:10002/local-dev-sa-001/TestHubNameHistory(PartitionKey='56656b76b34949608390d67519214a09',RowKey='0000000000000000') HTTP/1.1
Accept: application/json;odata=minimalmetadata
Content-Type: application/json
DataServiceVersion: 3.0;

{"EventId":-1,"IsPlayed":false,"_Timestamp":"2023-03-17T04:59:23.1433773Z","_Timestamp@odata.type":"Edm.DateTime","EventType":"OrchestratorStarted","ExecutionId":"60e994a9e641437a881ab32a035c6faa"}
 ErrorStack="Error: Couldn't extract path from URL in sub-Request:\n Content-Type: application/http\r\nContent-Transfer-Encoding: binary\r\n\r\nPUT http://127.0.0.1:10002/local-dev-sa-001/TestHubNameHistory(PartitionKey='56656b76b34949608390d67519214a09',RowKey='0000000000000000') HTTP/1.1\r\nAccept: application/json;odata=minimalmetadata\r\nContent-Type: application/json\r\nDataServiceVersion: 3.0;\r\n\r\n{\"EventId\":-1,\"IsPlayed\":false,\"_Timestamp\":\"2023-03-17T04:59:23.1433773Z\",\"_Timestamp@odata.type\":\"Edm.DateTime\",\"EventType\":\"OrchestratorStarted\",\"ExecutionId\":\"60e994a9e641437a881ab32a035c6faa\"}\r\n\n    at /opt/azurite/dist/src/table/batch/TableBatchSerialization.js:65:23\n    at Array.map (<anonymous>)\n    at TableBatchSerialization.deserializeBatchRequest (/opt/azurite/dist/src/table/batch/TableBatchSerialization.js:52:45)\n    at TableBatchOrchestrator.processBatchRequestAndSerializeResponse (/opt/azurite/dist/src/table/batch/TableBatchOrchestrator.js:46:32)\n    at TableHandler.batch (/opt/azurite/dist/src/table/handlers/TableHandler.js:498:50)\n    at runMicrotasks (<anonymous>)\n    at processTicksAndRejections (internal/process/task_queues.js:95:5)"
2023-03-17T04:59:23.245Z 972c1088-1962-4f2a-8daf-3fdb721e6109 error: ErrorMiddleware: Set HTTP code: 500

The above error message seems to be the same as #1141

Have you found a mitigation/solution?

No.

@blueww blueww self-assigned this Mar 22, 2023
@blueww blueww added docker azure-function table-storage Relating to Azurite table storage implementation table-batch labels Mar 22, 2023
@blueww
Copy link
Member

blueww commented Mar 22, 2023

@edwin-huber

This looks like related with table batch, do you have any idea?

@blueww
Copy link
Member

blueww commented Mar 22, 2023

@ecormaksin

"local-dev-sa-001" is not a valid storage account name, see link:

Storage account names must be between 3 and 24 characters in length and may contain numbers and lowercase letters only.

Would you please change it to a valid storage account name like "localdevsa001" and test again?
In my test this account name works with table batch.

@ecormaksin
Copy link
Contributor Author

@blueww
Thank you for your answer.
I removed "-" from storage accout names, then Durable Function worked correctly.

I think that if wrong storage account name was configured, Azurite should raise an error when launched, not when a function is executed.

Should I post another new issue?

@blueww
Copy link
Member

blueww commented Mar 23, 2023

@ecormaksin

We don't want to block customer from start Azurite by reporting error in start Azurite.
(Azurite has several different release channels, customer might be confused when see Azurite can't be start in some release.)

I think what we can optimize on this might be:

  1. Update Azurite doc: https://github.com/Azure/Azurite#customized-storage-accounts--keys , by add a note that the storage account name must following the limitation in https://learn.microsoft.com/en-us/azure/storage/common/storage-account-overview#storage-account-name
  2. (optional) Add a debug log to indicate the account name is not valid and might cause error in following request.
    However, since some customer might won't enable debug log or read it carefully, so this might not be so useful/necessary.

I still have other pending features in hand, so this might won't be my priority recently.

Azurite welcome contribution!
Would you like to raise a PR to update the doc?

ecormaksin added a commit to ecormaksin/Azurite that referenced this issue Mar 24, 2023
according to [this GitHub issue](Azure#1854)
@ecormaksin
Copy link
Contributor Author

@blueww
Thank you for yor reply.
I raised a PR.

blueww pushed a commit that referenced this issue Mar 24, 2023
* Update README.md

according to [this GitHub issue](#1854)

* Update README.md

reflect blueww's review comment.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
azure-function docker table-batch table-storage Relating to Azurite table storage implementation
Projects
None yet
Development

No branches or pull requests

2 participants