Azure / azure-functions-host

The host/runtime that powers Azure Functions
https://functions.azure.com
MIT License
1.94k stars 441 forks source link

TypeScript compilation intermittently times out #2124

Open ahmelsayed opened 6 years ago

ahmelsayed commented 6 years ago

From @jumpei-yamauchi on November 5, 2017 23:28

Hi,

Recently we started to see this error intermittently - "Microsoft.CodeAnalysis.Scripting.CompilationErrorException : Compilation timed out" when running one of the function. Please see the full error message below.

The function is queue-triggered and written in Typescript. Restarting the Function App that contains this function seemed to have helped (runs successfully without the error) but after a while it started to spit out the same error again. Has anyone come across this before?

Thank you in advance,

Microsoft.Azure.WebJobs.Host.FunctionInvocationException : Exception while executing function:  ---> Microsoft.CodeAnalysis.Scripting.CompilationErrorException : Compilation timed out.
   at async Microsoft.Azure.WebJobs.Script.Description.ConditionalJavaScriptCompilationService.GetCompilationResultAsync(FunctionMetadata functionMetadata) at C:\azure-webjobs-sdk-script\src\WebJobs.Script\Description\Node\Compilation\ConditionalJavaScriptCompilationService.cs : 115
   at async Microsoft.Azure.WebJobs.Script.Description.ConditionalJavaScriptCompilationService.GetFunctionCompilationAsync(FunctionMetadata functionMetadata) at C:\azure-webjobs-sdk-script\src\WebJobs.Script\Description\Node\Compilation\ConditionalJavaScriptCompilationService.cs : 56
   at async Microsoft.Azure.WebJobs.Script.Description.NodeFunctionInvoker.CompileAndTraceAsync(LogTargets logTargets,Boolean throwOnCompilationError,Boolean suppressCompilationSummary) at C:\azure-webjobs-sdk-script\src\WebJobs.Script\Description\Node\NodeFunctionInvoker.cs : 170
   at async Microsoft.Azure.WebJobs.Script.Description.NodeFunctionInvoker.CreateFunctionTarget(CancellationToken cancellationToken) at C:\azure-webjobs-sdk-script\src\WebJobs.Script\Description\Node\NodeFunctionInvoker.cs : 133
   at async Microsoft.Azure.WebJobs.Script.Description.FunctionLoader`1.GetFunctionTargetAsync[T](Int32 attemptCount) at C:\azure-webjobs-sdk-script\src\WebJobs.Script\Description\FunctionLoader.cs : 0
   at async Microsoft.Azure.WebJobs.Script.Description.NodeFunctionInvoker.GetFunctionTargetAsync() at C:\azure-webjobs-sdk-script\src\WebJobs.Script\Description\Node\NodeFunctionInvoker.cs : 121
   at async Microsoft.Azure.WebJobs.Script.Description.NodeFunctionInvoker.InvokeCore(Object[] parameters,FunctionInvocationContext context) at C:\azure-webjobs-sdk-script\src\WebJobs.Script\Description\Node\NodeFunctionInvoker.cs : 192

Copied from original issue: Azure/Azure-Functions#579

ahmelsayed commented 6 years ago

From @ahamfelt on November 6, 2017 12:44

@jumpei-yamauchi I've struggled with the same problem all morning. This and 'access denied to keys', found a solution here somewhere that suggested to rename/delete the host.json file from the root-folder and restart the function. Did that and the function seemed to run fine. but then it all came back... Hope someone has a solution to this!

ahmelsayed commented 6 years ago

From @cgillum on November 6, 2017 23:32

@christopheranderson any ideas?

ahmednuaman commented 6 years ago

Any ideas? This is a very strange bug. It would be handy to see the NodeFunctionInvoker.cs file. What's even strange is that every 2/100 function calls are successful.

In my case my function is being triggered by CosmosDB.

lczc1988 commented 6 years ago

@panchagnula @ahmelsayed Any progress of this issue? My customer is experiencing the same issue and need a workaround or solution. Thank you.

spg-iwilson commented 6 years ago

Microsoft told us that TypeScript isn't fully supported with Azure Functions yet. We have rewritten the function in JavaScript, but still getting the same error