logicapps icon indicating copy to clipboard operation
logicapps copied to clipboard

In VSCode, Workflow Fails To Start after designer changes - Azurite 3.17.1 Extension

Open dancurtiss opened this issue 2 years ago • 20 comments

Scenario:

  1. Logic App workflow starts and runs correctly
  2. Make any updates to logic app workflow which would require a rebuild of the logic app
  3. Attempt to run logic app again
2022-04-29T14:28:28.932Z] Workflow Error: operationName='WorkflowDefinitionProvider.ProcessWorkflow', message='Workflow 'xxx' validate and create workflow 
failed, the error is 'Unexpected HTTP status code '412'.'', exception='Microsoft.WindowsAzure.Storage.StorageException: Unexpected HTTP status code '412'.
[2022-04-29T14:28:28.936Z]    at Microsoft.WindowsAzure.ResourceStack.Common.Storage.Http.Parsers.FastCloudTableParser.UpdateEntitiesFromResponse(TableBatchOperation batch, MemoryStream content, RequestResult operationResult)

dancurtiss avatar Apr 29 '22 14:04 dancurtiss

I have also hit this issue which I seem to have worked around by using the content from a previous extension bundle. The latest bundle 1.1.35 seems to be the cause and so I am using the content of 1.1.32 in the 1.1.35 directory for the time being.

asos-nickward avatar May 03 '22 17:05 asos-nickward

Thank you for the input. It does seem to be due to VSCode extension updates to Azure Logic App Designer and maybe more importantly Azurite.

I've downgraded these to:

Azure Logic Apps (standard) v1.0.14 Azurite v3.16

Seems to be working again now. I'll leave this open to get notified when fixed.

dancurtiss avatar May 04 '22 13:05 dancurtiss

Hello, I am also getting similar exception, I degrade the version but looks like same issue except getting error code 404 I did the same thing - Azure Logic Apps (standard) v1.0.14 Azurite v3.16

Workflow Error: operationName='WorkflowDefinitionProvider.ProcessWorkflow', message='Workflow 'test' validate and create workflow failed, the error is 'One or more errors occurred. (Unexpected HTTP status code 'NotFound'.) (Unexpected HTTP status code 'NotFound'.)'', exception='System.AggregateException: One or more errors occurred. (Unexpected HTTP status code 'NotFound'.) (Unexpected HTTP status code 'NotFound'.) Microsoft.WindowsAzure.Storage.StorageException: Unexpected HTTP status code 'NotFound'. System.Net.WebException: The remote server returned an error: (404) Not Found.

siddheshdp avatar May 05 '22 04:05 siddheshdp

Thank you for the input. It does seem to be due to VSCode extension updates to Azure Logic App Designer and maybe more importantly Azurite.

I've downgraded these to:

Azure Logic Apps (standard) v1.0.14 Azurite v3.16

Seems to be working again now. I'll leave this open to get notified when fixed.

For me the issue was the new Azurite extension version - downgrading to v3.16 resolved the issue. I've kept the Azure Logic Apps Standard extension at v1.0.19 and don't have any issues. Thanks for the tip :)

One thing to add is that I had to delete the existing Azurite files (blobstorage, azurite_db_blob.json etc.) that had been created and reload VSCode to get rid of the error.

HLChucky avatar May 05 '22 05:05 HLChucky

I also have issues with Logic Apps (Standard) after upgrading Azurite to version 3.17.x. However, I don't get any error messages but when I execute a workflow it keeps running on the first step.

I downgraded Azurite and it started working again, VSCode extension version is 1.0.19

gastonmuijtjens avatar May 05 '22 11:05 gastonmuijtjens

I've confirmed the issue is only with the Azurite Extension and not the Azure Logic Apps (standard) extension as well.

dancurtiss avatar May 05 '22 19:05 dancurtiss

Hi Guys If you get stuck on this another workaround is to change the connection string to use a storage account in azure rather than Azurite. Not ideal but hopefully helps people unblock until the product team(s) can address the issue

michaelstephensonuk avatar May 07 '22 10:05 michaelstephensonuk

The issue seems to happen when I'm in debug mode and add a new action. If I remove the action it starts working again. Adding actions while not debugging works fine. That said 3.17.1 of Azurite seems to leave the executions as running even if those are done. image

If I open one of those running events you can see that all actions are executed. image Note I get the same 'Unexpected HTTP status code '412' with 3.16

skastberg avatar May 15 '22 10:05 skastberg

Hi Everyone

I ran into this today as well - another workaround I have found is to use the full local development connection from the Azurite documentation in your local.settings.json file for the AzureWebJobsStorage setting - instead of UseDevelopmentStorage=true

I tested this using Azurite v3.18.0

Your local.settings.json should look this like

{
  "IsEncrypted": false,
  "Values": {
    "AzureWebJobsStorage": "DefaultEndpointsProtocol=http;AccountName=devstoreaccount1;AccountKey=Eby8vdM02xNOcqFlqUwJPLlmEtlCDXJ1OUzFT50uSRZ6IFsuFq2UVErCz4I6tq/K1SZFPTOtr/KBHBeksoGMGw==;BlobEndpoint=http://127.0.0.1:10000/devstoreaccount1;QueueEndpoint=http://127.0.0.1:10001/devstoreaccount1;TableEndpoint=http://127.0.0.1:10002/devstoreaccount1;",
    "WORKFLOWS_SUBSCRIPTION_ID": "",
    "FUNCTIONS_WORKER_RUNTIME": "node"
  }
}

Documented here: https://docs.microsoft.com/en-us/azure/storage/common/storage-use-azurite?tabs=visual-studio-code#https-connection-strings

Garyljackson avatar Jul 03 '22 02:07 Garyljackson

I had same issue. The very first time, running F5 from VScode works and workflow URL is shown successful in terminal.

image

However when I hit the call back url (which is available in workflow overview) from browser/postman, the workflow is triggered fine but its in running state for long time. When I inspected the run, I saw request trigger was completed fine but it got stuck at the Response action. So I deleted the response action (while It was still in debugging mode) just to see if that was the culprit. And that is when it started giving below issue.

Workflow Error: operationName='WorkflowDefinitionProvider.ProcessWorkflow', message='Workflow 'Stateful2' validate and create workflow failed, the error is 'Unexpected HTTP status code '412'.'', exception='Microsoft.WindowsAzure.Storage.StorageException: Unexpected HTTP status code '412'.

I tried downgrading Azurite version from V1.8 to V1.6 but no luck.

So as a workaround I had to create a brand new workflow and Not use the response action, then atleast it generates the URL fine and I can get 202 response back. However the run history still shows it as running.

image image image

Not sure if its Azurite problem or something to do that fact that I changed the logic app while it was running, following issues still persist

  1. Not able to use Response action
  2. Run history shows Running while I have got 202 response back from Postman.

nareshnagpal06 avatar Jul 30 '22 15:07 nareshnagpal06

I had same issue. Thanks to the help I found here, it finally works.

Now working with: Azure Logic Apps (standard) v1.0.25 (VSCode extension) Azurite v3.16 (VSCode extension)

kritollm avatar Aug 26 '22 11:08 kritollm

Hi @nareshnagpal06

The same behavior is happening to me. Did you find any solution?

manoelvlm avatar Aug 29 '22 19:08 manoelvlm

Not working for me, also tried all the workarounds in this issue.

Also, installing Azurite via NPM or some other source result in the same error. Worked the first time but the 2nd time it fails with the same error message.

yoHasse avatar Sep 06 '22 10:09 yoHasse

Ok got it to work... sort of.

  • Uninstalled Azurite (Extension) and Downloaded/installed from GitHub source.
  • Set the folder to C:\Users<MyUserName>.azurite\
  • Ran debug and it worked.
  • Edited the designer and ran again which failed with the same error.
  • Removed all the files in the .azurite folder.
  • Ran again and it works.

It fails as soon as I edit in the designer so I have to remove all files between runs.

The Azurite logger gives the below errors "ResourceNotFound" and "Precondition Failed".

2022-09-07T10:44:09.500Z afbae5cb-72db-4356-bd56-312d915f1622 error: ErrorMiddleware: Received a MiddlewareError, fill error information to HTTP response
2022-09-07T10:44:09.500Z afbae5cb-72db-4356-bd56-312d915f1622 error: ErrorMiddleware: ErrorName=StorageError ErrorMessage="The specified resource does not exist."  ErrorHTTPStatusCode=404 ErrorHTTPStatusMessage=undefined ErrorHTTPHeaders={"x-ms-error-code":"ResourceNotFound","x-ms-request-id":"afbae5cb-72db-4356-bd56-312d915f1622","x-ms-version":"2021-10-04"} ErrorHTTPBody="{\"odata.error\":{\"code\":\"ResourceNotFound\",\"message\":{\"lang\":\"en-US\",\"value\":\"The specified resource does not exist.\\nRequestId:afbae5cb-72db-4356-bd56-312d915f1622\\nTime:2022-09-07T10:44:09.500Z\"}}}" ErrorStack="\"StorageError: The specified resource does not exist.\\n    at Function.getEntityNotFound (C:\\\\Users\\\\marnat\\\\git\\\\_external\\\\Azurite\\\\dist\\\\src\\\\table\\\\errors\\\\StorageErrorFactory.js:76:16)\\n    at TableHandler.queryEntitiesWithPartitionAndRowKey (C:\\\\Users\\\\marnat\\\\git\\\\_external\\\\Azurite\\\\dist\\\\src\\\\table\\\\handlers\\\\TableHandler.js:375:49)\\n    at runMicrotasks (<anonymous>)\\n    at processTicksAndRejections (internal/process/task_queues.js:97:5)\""
2022-09-07T10:44:09.500Z afbae5cb-72db-4356-bd56-312d915f1622 error: ErrorMiddleware: Set HTTP code: 404
2022-09-07T10:44:09.500Z afbae5cb-72db-4356-bd56-312d915f1622 error: ErrorMiddleware: Set HTTP Header: x-ms-error-code=ResourceNotFound
2022-09-07T10:44:09.500Z afbae5cb-72db-4356-bd56-312d915f1622 error: ErrorMiddleware: Set HTTP Header: x-ms-request-id=afbae5cb-72db-4356-bd56-312d915f1622
2022-09-07T10:44:09.500Z afbae5cb-72db-4356-bd56-312d915f1622 error: ErrorMiddleware: Set HTTP Header: x-ms-version=2021-10-04
2022-09-07T10:44:09.500Z afbae5cb-72db-4356-bd56-312d915f1622 error: ErrorMiddleware: Set content type: application/json;odata=nometadata;streaming=true;charset=utf-8
2022-09-07T10:44:09.500Z afbae5cb-72db-4356-bd56-312d915f1622 error: ErrorMiddleware: Set HTTP body: "{\"odata.error\":{\"code\":\"ResourceNotFound\",\"message\":{\"lang\":\"en-US\",\"value\":\"The specified resource does not exist.\\nRequestId:afbae5cb-72db-4356-bd56-312d915f1622\\nTime:2022-09-07T10:44:09.500Z\"}}}"

2022-09-07T10:44:13.861Z 	 warn: TableHandler:mergeEntity() Incoming PartitionKey:C0000 RowKey:E17EAF29EF594EDC82AF62C922989D8B_FlowConsistencyJob-08585390595179472850-Immediate in URL parameters don't align with entity body PartitionKey:undefined RowKey:undefined.
2022-09-07T10:44:13.861Z 492ece8f-92aa-483a-b70c-53459b1f8fcc error: ErrorMiddleware: Received a MiddlewareError, fill error information to HTTP response
2022-09-07T10:44:13.861Z 492ece8f-92aa-483a-b70c-53459b1f8fcc error: ErrorMiddleware: ErrorName=StorageError ErrorMessage="The update condition specified in the request was not satisfied."  ErrorHTTPStatusCode=412 ErrorHTTPStatusMessage=undefined ErrorHTTPHeaders={"x-ms-error-code":"UpdateConditionNotSatisfied","x-ms-request-id":"492ece8f-92aa-483a-b70c-53459b1f8fcc","x-ms-version":"2021-10-04"} ErrorHTTPBody="{\"odata.error\":{\"code\":\"UpdateConditionNotSatisfied\",\"message\":{\"lang\":\"en-US\",\"value\":\"The update condition specified in the request was not satisfied.\\nRequestId:492ece8f-92aa-483a-b70c-53459b1f8fcc\\nTime:2022-09-07T10:44:13.861Z\"}}}" ErrorStack="\"StorageError: The update condition specified in the request was not satisfied.\\n    at Function.getPreconditionFailed (C:\\\\Users\\\\MyUserName\\\\git\\\\Azurite\\\\dist\\\\src\\\\table\\\\errors\\\\StorageErrorFactory.js:67:16)\\n    at LokiTableMetadataStore.mergeTableEntity (C:\\\\Users\\\\MyUserName\\\\git\\\\Azurite\\\\dist\\\\src\\\\table\\\\persistence\\\\LokiTableMetadataStore.js:498:49)\\n    at LokiTableMetadataStore.insertOrMergeTableEntity (C:\\\\Users\\\\MyUserName\\\\git\\\\Azurite\\\\dist\\\\src\\\\table\\\\persistence\\\\LokiTableMetadataStore.js:299:25)\\n    at TableHandler.mergeEntity (C:\\\\Users\\\\MyUserName\\\\git\\\\Azurite\\\\dist\\\\src\\\\table\\\\handlers\\\\TableHandler.js:284:34)\\n    at TableHandler.mergeEntityWithMerge (C:\\\\Users\\\\MyUserName\\\\git\\\\Azurite\\\\dist\\\\src\\\\table\\\\handlers\\\\TableHandler.js:413:21)\\n    at C:\\\\Users\\\\MyUserName\\\\git\\\\Azurite\\\\dist\\\\src\\\\table\\\\generated\\\\middleware\\\\HandlerMiddlewareFactory.js:58:18\\n    at C:\\\\Users\\\\MyUserName\\\\git\\\\Azurite\\\\dist\\\\src\\\\table\\\\generated\\\\ExpressMiddlewareFactory.js:77:63\\n    at Layer.handle [as handle_request] (C:\\\\Users\\\\MyUserName\\\\git\\\\Azurite\\\\node_modules\\\\express\\\\lib\\\\router\\\\layer.js:95:5)\\n    at trim_prefix (C:\\\\Users\\\\MyUserName\\\\git\\\\Azurite\\\\node_modules\\\\express\\\\lib\\\\router\\\\index.js:328:13)\\n    at C:\\\\Users\\\\MyUserName\\\\git\\\\Azurite\\\\node_modules\\\\express\\\\lib\\\\router\\\\index.js:286:9\""
2022-09-07T10:44:13.861Z 492ece8f-92aa-483a-b70c-53459b1f8fcc error: ErrorMiddleware: Set HTTP code: 412
2022-09-07T10:44:13.861Z 492ece8f-92aa-483a-b70c-53459b1f8fcc error: ErrorMiddleware: Set HTTP Header: x-ms-error-code=UpdateConditionNotSatisfied
2022-09-07T10:44:13.861Z 492ece8f-92aa-483a-b70c-53459b1f8fcc error: ErrorMiddleware: Set HTTP Header: x-ms-request-id=492ece8f-92aa-483a-b70c-53459b1f8fcc
2022-09-07T10:44:13.861Z 492ece8f-92aa-483a-b70c-53459b1f8fcc error: ErrorMiddleware: Set HTTP Header: x-ms-version=2021-10-04
2022-09-07T10:44:13.861Z 492ece8f-92aa-483a-b70c-53459b1f8fcc error: ErrorMiddleware: Set content type: application/json;odata=nometadata;streaming=true;charset=utf-8
2022-09-07T10:44:13.861Z 492ece8f-92aa-483a-b70c-53459b1f8fcc error: ErrorMiddleware: Set HTTP body: "{\"odata.error\":{\"code\":\"UpdateConditionNotSatisfied\",\"message\":{\"lang\":\"en-US\",\"value\":\"The update condition specified in the request was not satisfied.\\nRequestId:492ece8f-92aa-483a-b70c-53459b1f8fcc\\nTime:2022-09-07T10:44:13.861Z\"}}}"
2022-09-07T10:44:13.861Z 492ece8f-92aa-483a-b70c-53459b1f8fcc info: EndMiddleware: End response. TotalTimeInMS=2 StatusCode=412 StatusMessage=Precondition Failed Headers={"server":"Azurite-Table/3.19.0","x-ms-error-code":"UpdateConditionNotSatisfied","x-ms-request-id":"492ece8f-92aa-483a-b70c-53459b1f8fcc","x-ms-version":"2021-10-04","content-type":"application/json;odata=nometadata;streaming=true;charset=utf-8"}

yoHasse avatar Sep 07 '22 10:09 yoHasse

Just to add to the list of devs having issues with locally building Logic Apps (standard in this case), I had my environment mostly working last week using the information in this thread.

Azurite 3.16 Core Tools 3.0.453 Function Runtime 3.12.1.0 VSCode 1.71.0 all dependent extensions are current

When I came back to it this week, Azurite 3.16 could not connect to the blob sdk due to a wrong version. In settings I checked loose mode for Azurite and it started working again but come to find out, my queue trigger is not firing. I created a new workflow just to make sure that I'm not doing anything weird. With just the trigger and instantiating a variable, no queue triggers work.

I updated azurite to 3.19.0 and deleted the store files, ran again but the same issues from before came back. No triggers run, and when my http triggered flow does run it locks up. I rolled it back to 3.16, deleted the store files again and it works but no queue trigger. I had to close and run a couple times before my recurrent trigger would fire reliably. I can go back and forth proofing the same issues but no resolution yet. It 'kinda' works, but not enough to use it professionally.

Why is this so buggy? How do we fix it?

robertcmolidor avatar Sep 07 '22 15:09 robertcmolidor

We are seeing the same issue now as well. Our workflows that involved blob triggers are now failing. We are trying rolling back the latest logic app extension update which is from the past week.

dancurtiss avatar Sep 07 '22 15:09 dancurtiss

Even with rollback of Azure Logic Apps (Standard) extension to 1.0.25 we are still seeing the error:

[2022-09-07T16:17:09.410Z] Azure.Storage.Blobs: Service request failed. [2022-09-07T16:17:09.411Z] Status: 400 (The value for one of the HTTP headers is not in the correct format.) [2022-09-07T16:17:09.413Z] ErrorCode: InvalidHeaderValue [2022-09-07T16:17:09.415Z] [2022-09-07T16:17:09.416Z] Headers: [2022-09-07T16:17:09.418Z] Server: Azurite-Blob/3.16.0 [2022-09-07T16:17:09.420Z] x-ms-error-code: InvalidHeaderValue [2022-09-07T16:17:09.421Z] x-ms-request-id: f6a4d412-fee4-4804-a995-043d1b5e5b87 [2022-09-07T16:17:09.423Z] Date: Wed, 07 Sep 2022 16:17:09 GMT [2022-09-07T16:17:09.425Z] Connection: keep-alive [2022-09-07T16:17:09.427Z] Keep-Alive: REDACTED

We were not seeing this on Friday 9/2/22

dancurtiss avatar Sep 07 '22 16:09 dancurtiss

We may resort to using actual azure storage until we can figure out how to get azurite to play nice with logic apps in VS code. I think this applies specifically to blob triggers as our other triggers continued to work locally I believe.

dancurtiss avatar Sep 07 '22 17:09 dancurtiss

We may resort to using actual azure storage until we can figure out how to get azurite to play nice with logic apps in VS code. I think this applies specifically to blob triggers as our other triggers continued to work locally I believe.

This is what we did for now. leveraging a storage account in azure instead of using Azurite unblocked us. Hopefully we get to see Azurite working soon!

robertcmolidor avatar Sep 07 '22 17:09 robertcmolidor

Hi, the issues with azurite 3.17 and later were fixed today in PR 1661. If you try to run the latest version of azurite's master branch, local development with logic apps standard should work.

About azurite 3.16 and lower: I did a fresh install with azurite 3.16 and this version doesn't seem to work anymore with the VS Code Extension "Logic Apps (Standard)". I get the error below, which indicates that service api-version "2021-06-08" is used by the extension and you can see in azurite's releases that this api-version is only supported by azurite 3.17 and above.

<Error>
  <Code>InvalidHeaderValue</Code>
  <Message>The value for one of the HTTP headers is not in the correct format.
RequestId:9c72451c-4736-4a91-8d31-e9c5032971dd
Time:2022-09-07T15:56:39.609Z</Message>
  <HeaderName>x-ms-version</HeaderName>
  <HeaderValue>2021-06-08</HeaderValue>
</Error>

IMeeus avatar Sep 08 '22 07:09 IMeeus

This issue is stale because it has been open for 30 days with no activity.

github-actions[bot] avatar Oct 20 '22 21:10 github-actions[bot]

This issue was closed because it has been inactive for 7 days since being marked as stale.

github-actions[bot] avatar Oct 27 '22 22:10 github-actions[bot]