tfsaggregator / aggregator-cli

A new version of Aggregator aiming at Azure DevOps (ex Visual Studio Team Services)
https://tfsaggregator.github.io/
Apache License 2.0
74 stars 32 forks source link

Complitation failed with 0.9.10 #121

Closed adu80 closed 4 years ago

adu80 commented 4 years ago

Steps to reproduce

On version 0.9.8, I was update a rule. Automatically an upgrade proceed to 0.9.10 (can we disable that ?) After, complilation failed for my rule.

Diagnostic logs

Error :

2020-04-20T06:54:47.077 [Error] Function compilation errorMicrosoft.CodeAnalysis.Scripting.CompilationErrorException : Script compilation failed.at async Microsoft.Azure.WebJobs.Script.Description.DotNetFunctionInvoker.CreateFunctionTarget(CancellationToken cancellationToken) at D:\a\1\s\src\WebJobs.Script\Description\DotNet\DotNetFunctionInvoker.cs : 314at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()at async Microsoft.Azure.WebJobs.Script.Description.FunctionLoader`1.GetFunctionTargetAsync[T](Int32 attemptCount) at D:\a\1\s\src\WebJobs.Script\Description\FunctionLoader.cs : 55at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()at async Microsoft.Azure.WebJobs.Script.Description.DotNetFunctionInvoker.GetFunctionTargetAsync(Boolean isInvocation) at D:\a\1\s\src\WebJobs.Script\Description\DotNet\DotNetFunctionInvoker.cs : 183
2020-04-20T06:54:47.170 [Error] run.csx(10,23): error CS7036: There is no argument given that corresponds to the required formal parameter 'httpContext' of 'AzureFunctionHandler.AzureFunctionHandler(ILogger, ExecutionContext, HttpContext)'

Warning :

2020-04-20T06:54:47.058 [Warning] run.csx(13,23): warning CS1702: Assuming assembly reference 'Microsoft.Extensions.Logging.Abstractions, Version=3.1.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60' used by 'aggregator-function' matches identity 'Microsoft.Extensions.Logging.Abstractions, Version=3.1.3.0, Culture=neutral, PublicKeyToken=adb9793829ddae60' of 'Microsoft.Extensions.Logging.Abstractions', you may need to supply runtime policy
2020-04-20T06:54:47.058 [Warning] run.csx(14,27): warning CS1701: Assuming assembly reference 'Microsoft.AspNetCore.Http.Abstractions, Version=2.2.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60' used by 'aggregator-function' matches identity 'Microsoft.AspNetCore.Http.Abstractions, Version=3.1.3.0, Culture=neutral, PublicKeyToken=adb9793829ddae60' of 'Microsoft.AspNetCore.Http.Abstractions', you may need to supply runtime policy
2020-04-20T06:54:47.059 [Warning] run.csx(15,24): warning CS1701: Assuming assembly reference 'Microsoft.AspNetCore.Mvc.Abstractions, Version=2.2.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60' used by 'aggregator-function' matches identity 'Microsoft.AspNetCore.Mvc.Abstractions, Version=3.1.3.0, Culture=neutral, PublicKeyToken=adb9793829ddae60' of 'Microsoft.AspNetCore.Mvc.Abstractions', you may need to supply runtime policy

Thanks for your help.

giuliov commented 4 years ago

Thanks for informing, clearly the end-to-end test I added failed to catch it, as it tests only new deployments. BTW yes you can specify sourceUrl pointing to the desired FunctionRuntime.zip package.

adu80 commented 4 years ago

Great, I will use sourceUrl for the next update of my rules. How can I solve my current problem ? Can I help you ?

Thank you for your time, really.

giuliov commented 4 years ago

The error seems to be related to the run.csx file, so maybe patching that manually is the fastest course.

A radical cure is to create new instances and mappings, then dispose the old ones. In some cases, it might be better remove existing mappings.

BobSilent commented 4 years ago

In PR #108 I introduced an update.instance command which should do the update As you not only need to update you runtime package but also update your azure functions instance from v2 to v3 runtime

Unfortunately it is not yet well documented as I am not completely finished

adu80 commented 4 years ago

(I was already in v3 runtime)

Wonderful. After a update.instance and a fail, I don't have error anymore, just warnings (the same). My service seems work fine in 0.9.10.

The error with update.instance : image

I'm going to start a new instance to be "clean".

Thank you very much for your responsiveness. I remain available if you want more details to help you with corrections.

BobSilent commented 4 years ago

hmm, i quickly checked the code and unfortunately the PR was not complete and well tested. Sorry for that.

BUT: It has done everything fine, unfortunately i did a small mistake and return alaways a false which leads to the failed! message.

Have you checked the instance, just to get the feedback if the migration did the job. Or did you just ignore the output and setup an clean instance?

adu80 commented 4 years ago

I can't setup a second instance to be clean right now.

What do I need to check in the instance ?

BobSilent commented 4 years ago

Simply let the instance execute a rule, your error

2020-04-20T06:54:47.077 [Error] Function compilation errorMicrosoft.CodeAnalysis.Scripting.CompilationErrorException : Script compilation failed.at async Microsoft.Azure.WebJobs.Script.Description.DotNetFunctionInvoker.CreateFunctionTarget(CancellationToken cancellationToken) at D:\a\1\s\src\WebJobs.Script\Description\DotNet\DotNetFunctionInvoker.cs : 314at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()at async Microsoft.Azure.WebJobs.Script.Description.FunctionLoader`1.GetFunctionTargetAsync[T](Int32 attemptCount) at D:\a\1\s\src\WebJobs.Script\Description\FunctionLoader.cs : 55at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()at async Microsoft.Azure.WebJobs.Script.Description.DotNetFunctionInvoker.GetFunctionTargetAsync(Boolean isInvocation) at D:\a\1\s\src\WebJobs.Script\Description\DotNet\DotNetFunctionInvoker.cs : 183
2020-04-20T06:54:47.170 [Error] run.csx(10,23): error CS7036: There is no argument given that corresponds to the required formal parameter 'httpContext' of 'AzureFunctionHandler.AzureFunctionHandler(ILogger, ExecutionContext, HttpContext)'

should not occur if update went well

adu80 commented 4 years ago

Everything's working fine. Thank you.