Open RaleS opened 4 years ago
Somehow this information got stripped. Project is referencing to following package:
<PackageReference Include="Microsoft.NET.Sdk.Functions" Version="3.0.3" />
Can you move Microsoft.NET.Sdk.Functions up to version 3.0.9? There have been a number of fixes since 3.0.3 and this may already be fixed.
If this still repros -- can you then explicitly add a package reference to Microsoft.Azure.Webjobs.Script.ExtensionsMetadataGenerator version 1.2.0? That has even more substantial changes that will be coming soon in Microsoft.NET.Sdk.Functions version 3.0.10 -- but you can try it today with a direct package reference.
Cool, I have bumped and added
<PackageReference Include="Microsoft.Azure.WebJobs.Script.ExtensionsMetadataGenerator" Version="1.2.0" />
<PackageReference Include="Microsoft.NET.Sdk.Functions" Version="3.0.9" />
I will let you know the results. What is the ETA on 3.0.10?
Here is the result
2020-10-08T15:12:08.1977635Z 25:6>Done executing task "GenerateFunctions".
2020-10-08T15:12:08.1978068Z 25:6>Done building target "_GenerateFunctionsPostBuild" in project "Engines.Functions.csproj".
2020-10-08T15:12:08.1982850Z 25:6>Target "_GenerateFunctionsExtensionsMetadataPostBuild" in file "C:\Nuget\Packages\microsoft.azure.webjobs.script.extensionsmetadatagenerator\1.2.0\build\Microsoft.Azure.WebJobs.Script.ExtensionsMetadataGenerator.targets" from project "e:\AgentE1\_work\868\s\Engines\Engines.Functions\Engines.Functions.csproj" (entry point):
2020-10-08T15:12:08.1984180Z Using "GenerateFunctionsExtensionsMetadata" task from assembly "C:\Nuget\Packages\microsoft.azure.webjobs.script.extensionsmetadatagenerator\1.2.0\build\..\tools\netstandard2.0\Microsoft.Azure.WebJobs.Script.ExtensionsMetadataGenerator.dll".
2020-10-08T15:12:08.1984802Z Task "GenerateFunctionsExtensionsMetadata"
2020-10-08T15:12:08.2006108Z Extensions generator working directory: 'C:\Nuget\Packages\microsoft.azure.webjobs.script.extensionsmetadatagenerator\1.2.0\tools\netstandard2.0\..\netstandard2.0\generator'
2020-10-08T15:12:08.2006877Z Extensions generator path: 'C:\Program Files\dotnet\dotnet.exe'
2020-10-08T15:12:08.2007632Z Microsoft.Azure.WebJobs.Script.ExtensionsMetadataGenerator.Console.dll "e:\AgentE1\_work\868\s\Engines\Engines.Functions\bin\Debug\netcoreapp3.1\bin" "e:\AgentE1\_work\868\s\Engines\Engines.Functions\bin\Debug\netcoreapp3.1\bin\extensions.json"
2020-10-08T15:12:08.2052582Z Debug output from extension.json generator:
2020-10-08T15:12:08.2053143Z
2020-10-08T15:12:08.2321157Z ##[error]C:\Nuget\Packages\microsoft.azure.webjobs.script.extensionsmetadatagenerator\1.2.0\build\Microsoft.Azure.WebJobs.Script.ExtensionsMetadataGenerator.targets(37,5): Error : Metadata generation failed. Exit code: '-1073741502' Error: ''
2020-10-08T15:12:08.2335240Z 25:6>C:\Nuget\Packages\microsoft.azure.webjobs.script.extensionsmetadatagenerator\1.2.0\build\Microsoft.Azure.WebJobs.Script.ExtensionsMetadataGenerator.targets(37,5): error : Metadata generation failed. Exit code: '-1073741502' Error: '' [e:\AgentE1\_work\868\s\Engines\Engines.Functions\Engines.Functions.csproj]
2020-10-08T15:12:08.2336151Z Done executing task "GenerateFunctionsExtensionsMetadata" -- FAILED.
2020-10-08T15:12:08.2336579Z 25:6>Done building target "_GenerateFunctionsExtensionsMetadataPostBuild" in project "Engines.Functions.csproj" -- FAILED.
2020-10-08T15:12:08.2337167Z 25:6>Done Building Project "e:\AgentE1\_work\868\s\Engines\Engines.Functions\Engines.Functions.csproj" (default targets) -- FAILED.
The exit code translates to 0xC0000142
which is STATUS_DLL_INIT_FAILED
.
Some things on StackOverflow seem to indicate that running as a service may be the issue:
Could that be the issue?
The error is caused by a hanging dotnet.exe process from previous run. Workaround is to nuke dotnet.exe process and retry build.
Running into the same error using Microsoft.NET.Sdk.Functions 3.0.9
, doesn't seem to be fixed here.
I am running this on Jenkins in Windows Server 2019.
Nuking dotnet.exe from the pipeline script doesn't work, however restarting the whole build agent machine does the trick... which obviously I don't want to rely on. Is there an old version I can fall back to where this issue hasn't been present?
deployment\AppName\bin\Develop\netcoreapp3.1\ " "False "
_GenerateFunctionsExtensionsMetadataPostBuild:
Microsoft.Azure.WebJobs.Script.ExtensionsMetadataGenerator.Console.dll "somelongpath\bin\Develop\netcoreapp3.1\bin" "somelongpath\bin\Develop\netcoreapp3.1\bin\extensions.json"
Debug output from extension.json generator:
38>somelongpath\packages\microsoft.azure.webjobs.script.extensionsmetadatagenerator\1.1.8\build\Microsoft.Azure.WebJobs.Script.ExtensionsMetadataGenerator.targets(37,5): error : Metadata generation failed. Exit code: '-1073741502' Error: ''
The empty string in the error message is not very helpful :/
``` xml
We have the same issue when building solution with dotnet publish
on private build host with parallel builds.
Extremely annoying...
Any news on this? I am getting the same error but with extensionsmetadatagenerator 1.1.8 and with Microsoft.NET.Sdk.Functions 3.0.9
[error]C:\Windows\ServiceProfiles\NetworkService\.nuget\packages\microsoft.azure.webjobs.script.extensionsmetadatagenerator\1.1.8\build\Microsoft.Azure.WebJobs.Script.ExtensionsMetadataGenerator.targets(37,5): Error : Metadata generation failed. Exit code: '-1073741502' Error: ''
.
I am getting this on my Azure Devops build pipeline and very sporadic och sudden. Using the clean option on the pipeline doesn´t help, This started to appear like a week ago. Sometimes after waiting a while, triggering a new build it would succeed.
We're seeing the same problem, started happening late November 2020.
Version 3.0.11
of Microsoft.NET.Sdk.Functions
.
Same problem here, started happening this week since we changed something in our Azure Pipelines.
One agent job is to build 3 functions using dotnet publish
, one project usually goes through, the other two fail.
Microsoft.NET.Sdk.Functions
package is on version 3.0.11
for all three functions.
@brettsam
Can you move Microsoft.NET.Sdk.Functions up to version 3.0.9? There have been a number of fixes since 3.0.3 and this may already be fixed.
If this still repros -- can you then explicitly add a package reference to Microsoft.Azure.Webjobs.Script.ExtensionsMetadataGenerator version 1.2.0? That has even more substantial changes that will be coming soon in Microsoft.NET.Sdk.Functions version 3.0.10 -- but you can try it today with a direct package reference.
We're using Microsoft.NET.Sdk.Functions
v3.0.11, and as per the release notes of v3.0.10 it does contain the changes you're referring to from v1.2.0 of package Microsoft.Azure.WebJobs.Script.ExtensionsMetadataGenerator
.
We're using these package references in our functions app:
<PackageReference Include="Microsoft.Azure.Functions.Extensions" Version="1.1.0" />
<PackageReference Include="Microsoft.Azure.WebJobs.Extensions.DurableTask" Version="2.3.1" />
<PackageReference Include="Microsoft.Azure.WebJobs.Extensions.ServiceBus" Version="4.2.0" />
<PackageReference Include="Microsoft.Azure.WebJobs.Extensions.Storage" Version="4.0.3" />
<PackageReference Include="Microsoft.Extensions.Configuration" Version="3.1.8" />
<PackageReference Include="Microsoft.NET.Sdk.Functions" Version="3.0.11" />
The output from the publish command ends with:
C:\Windows\ServiceProfiles\NetworkService\.nuget\packages\microsoft.azure.webjobs.script.extensionsmetadatagenerator\1.2.0\build\Microsoft.Azure.WebJobs.Script.ExtensionsMetadataGenerator.targets(37,5): error : Metadata generation failed. Exit code: '-1073741502' Error: '' [D:\w3\3\s\Schafwerfen\Schafwerfen.Functions\Schafwerfen.Functions.csproj]
I do believe this is due to a hanging dotnet
process as mentioned in https://github.com/Azure/azure-functions-host/issues/6769#issuecomment-707264696 and it seems to hang randomly.
I do not see any evidence of the build or test steps not completing in Azure Pipelines, however it still leaves a dotnet
process hanging for some reason.
We started having the same issue after switching to dotnet publish from Visual Studio build task in Azure DevOps. It seems that doesn't happen when using publish with .csproj patterns, only when we build entire solution at once(though it would require more testing). Building solution is over 2 times quicker than .csproj pattern with p:BuildInParallel though so we'd like to stick to dotnet publish *.sln. It also happens quite randomly, not on every build. We're also using SDK 3.0.11.
@Edit Also worth mentioning, this started happening when we switched to VM with self-hosted Agent and parallel builds. Now I'm checking it and it seems that if there's only one agent and one build at a time, everything seems ok.
FWIW we are also experiencing this exact same problem (and have been for several months). We're on Microsoft.NET.Sdk.Functions 3.0.11, building on Azure Pipelines with local agents hosted on Azure VMs via dotnet build
(not dotnet publish
), and intermittently get the following:
C:\Users\ba-admin\.nuget\packages\microsoft.azure.webjobs.script.extensionsmetadatagenerator\1.2.0\build\Microsoft.Azure.WebJobs.Script.ExtensionsMetadataGenerator.targets(37,5): error : Metadata generation failed. Exit code: '-1073741502' Error: ''
Like others have reported, it seems highly correlated with multiple concurrent builds. We almost never (maybe actually never) see the problem when one build is executing. When two builds are executing on the same build server it seems to happen frequently.
Linking my issue here in case the two are related, or in case my resolution helps anybody else:
Same issues here. Creating separate accounts for each build agent isn't a very feasible workaround, especially when you are running 10+ agents. Is this going to be looked at anytime soon?
Same issue here... Microsoft.NET.Sdk.Functions 3.0.11
this fixed my issue:
To uninstall dotnet core from macOS:
download dotnet-uninstall-pkgs.sh from https://github.com/dotnet/sdk/blob/main/scripts/obtain/uninstall/dotnet-uninstall-pkgs.sh make dotnet-uninstall-pkgs.sh executable execute dotnet-uninstall-pkgs.sh as root (requires superuser privileges to run). curl -O https://raw.githubusercontent.com/dotnet/sdk/main/scripts/obtain/uninstall/dotnet-uninstall-pkgs.sh chmod u+x dotnet-uninstall-pkgs.sh sudo ./dotnet-uninstall-pkgs.sh
basically uninstalling dotnet
This has crippled me and made me think about my lifes choices. Any fix for this?
@c-lamont This is what worked for us.
We run our own agents, because a few years back the performance of the hosted agents were dramatically reduced. Our PR build times more than doubled.
So we have 1 large Windows based VM running in Azure, where we installed 5 build agents. They were installed on C drive, with working folder on D drive (temp storage in Azure VMs).
I think it was suggested here to assign each service with their own service account.
By default they all run as NETWORK SERVICE
, so I created 5 user accounts with a password that never expires, and doesn't require change on next login, made them a member of a security group that has the same name as the agents in the Services snap-in.
It is important to find the correct group, as they grant access to the folder with the binaries on drive C, which gives capability of self updating etc. Folders for me was C:\a1
, C:\a2
and so on. (you can also manually grant the appropriate access to the individual accounts).
The new service accounts needs to be assigned to the agents in Services.
Then stop all services, delete the working folders (in my case D:\w1
, D:\w2
and so on).
The start all services again, and they should work as expected without this problem.
dotnet tools
This change did something to the discovery of globally installed dotnet
tools.
We use dotnet ef
commands and un-install and then install the tool as part of the build pipeline:
dotnet tool uninstall -g dotnet-ef
dotnet tool install -g dotnet-ef --version 3.0.0
The dotnet ef
commands stopped working, as it couldn't find the tool even though it was globally installed.
We fixed it by adding --tools-path
to the (un)-install commands:
dotnet tool uninstall dotnet-ef --tool-path "C:\dotnet tools"
dotnet tool install dotnet-ef --version 3.0.0 --tool-path "C:\dotnet tools"
And then added C:\dotnet tools
to the system wide PATH
.
@martinnormark Thanks for the detailed steps of how you resolved the issue. However my issue was running it locally on VS Mac. I'm sure your response will help out others though.
For me, with the latest VS Mac update Version 8.10.9 (build 3)
I do not get the error anymore.
Seems to be working now... Updated to Microsoft.NET.Sdk.Functions 3.0.13 However, our build server (Jenkins on windows server) was also patched with framework updates (via standard windows updates) So cannot be sure as to which fixed the issue for us.
Seems to be working now... Updated to Microsoft.NET.Sdk.Functions 3.0.13 However, our build server (Jenkins on windows server) was also patched with framework updates (via standard windows updates) So cannot be sure as to which fixed the issue for us.
I am confirming that we started getting this issue on our Jenkins build servers. Two branches that contained the same code were providing inconsistent results. One was building fine whereas the other one had the error stated in this chain. I tried restarting Jenkins but had the same issue. Finally, after upgrading Microsoft.NET.Sdk.Functions from 3.0.11 to 3.0.13 it got resolved. Hope this helps some folks out there.
Getting error when building a project that contains reference to
Is there an easy way to get more information reg. the error?