-
Notifications
You must be signed in to change notification settings - Fork 442
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
dotnet publish fails with 'Metadata generation failed' sometimes #4055
Comments
@paulbatum or colleagues - How should we investigate this error? |
Also asked in Stack Overflow: https://stackoverflow.com/questions/54660616/dotnet-publish-fails-with-metadata-generation-failed-sometimes |
Maybe if you amend your command to include verbose output, there will be a clue of what the error is? See the |
Hi @paulbatum - It came back today and I captured logs with I notice that most of the Anonymized snippet - Let me know if you want the whole thing privately
|
Same for me I have 3 agents on the same Virtual Machine and sometimes one of them produces this kind of error. |
@ishepherd -- could you try again with our latest sdk package? https://www.nuget.org/packages/Microsoft.NET.Sdk.Functions/1.0.26. Do you get the same thing? |
@jonathanantoine please let us know if you still see this with version 1.0.26 that Brett mentioned above |
Hi @brettsam @paulbatum, we upgraded a week ago and fine all week - but just now the problem reoccurred and all our builds are broken again. The snippet I posted (#4055 (comment)) is the same, except:
|
Hello, We switched to VS hosted agent and it's working fine now. I don't know if the latest package you mention wouod have fix the issue. |
We're having the same issue on a VM with several Build Agents installed. Event with the latest version of the SDK. |
We're also experiencing this error intermittently on a server running multiple agents. Consireded if the isse was both agents using the same nuget cache, causing some lock issue etc, but even disabling all but one agent still resultet in issues. Workaround for us: |
Thanks for the reports -- we're trying to figure out where this is coming from but no one has been able to capture it for us yet. For those reporting it: Is it reproducible once you see it? Can you hop on the agent and run your build command manually and get the same error? If so, I've got a few things that could help us narrow it down. What's ultimately happening is that our build task calls into a console application to generate the extensions.json file. It's failing, but with no output (or at least none that we've captured). If this is reproducible, you should be able to hop on and run the same command from the command prompt and see if that fails. You'll need three things:
Once you have those, you can open a command prompt and run: I'm also trying to beef up our logging with #4314 to see if that helps us diagnose this. |
Note that I've just pushed a new version of Microsoft.NET.Sdk.Functions -- 1.0.27 -- that contains some better logging in an effort to catch the underlying error. If possible, it'd be great if anyone experiencing this could move to this version so we can get some better output (hopefully!). |
I've updated my project to version 1.0.27 and I get the following error:
I also tried this, and assuming I passed the correct parameters I am getting no output whatsoever |
@ksstott thank you! Does this happen every time you build, or is it sporadic? |
It is happening all the time for me running locally (running on windows) but not happening when we are building in a docker container using the |
For me this is the error it is giving: My scenario is a bit different though: I had a (working) solution. Then I had to migrate to a different repo, so I copied the projects into a new solution. And all of a sudden the extensions.json does not get generated anymore. On file level (within the solution) the files are equal. So I have no idea where this is coming from. The only difference I see is that they both use a different global Nuget cache folder... |
Unfortunately no. It was not generating any extensions.json file anymore. So based on other Google-results I added the package Microsoft.Azure.WebJobs.Script.ExtensionsMetadataGenerator explicitly to my FunctionApp project. I'm expecting 2 extensions there:
Maybe this gives a bit of a clue. Based on the ouytput might it be the sequencing of the targets? As the metadata is called before the function.json is generated? |
I copied over the new dll and could move past a problem: here is the output (assuming thats fine, no functions stuff should be in the view dll): |
In my case, I was working on razor pages and had to include these two packages to my function project also (when referencing an aspnet core project from the function project).
|
@brettsam That updated console.dll you linked made the difference for me. For reference, I was using the Jil serialiser in an assembly referenced by my functions project, and it in turn references Sigil which is a netstandard1.5 assembly that does all sorts of fun Reflection.Emit things. The message I get now is this:
|
Thanks for the confirmation @thecontrarycat! Did you see that message as a build warning? I've changed it to be a Message (rather than Warning) so that you shouldn't get constant warnings about an assembly that likely won't have any Functions extensiosn in it. |
https://www.nuget.org/packages/Microsoft.NET.Sdk.Functions/1.0.28 has been released, which contains this fix. Please give it a try and let me know if you continue to have issues with your builds. Huge thanks to everyone that helped us debug this. The latest release has more diagnostic logging so it may be easier to detect these kinds of things in the future. |
The 1.0.28 update has broken my build with a new 'Metadata generation failed' (when running both locally and in VSTS). I simply reverted from 1.0.* to 1.0.27 because the older package still works fine. However, I thought the bug report might be relevent here. The fix might be easy as you'll notice the "binbin" extension and I suspect it has to do with the "_FunctionsExtensionsTasksDir", but this is where my expertise ends. Thanks for the great SDK
|
Thanks for the report @QuantechTP! Is there any chance that you could kick off a build with "/bl" as your command line and email me the msbuild.binlog file that it generates? My microsoft email is in my github profile. |
Is there a solution to the following problem: https://twitter.com/pksorensen/status/1131080645696983040 How do i get to build when one of my other dependencies need json >=12.0.2?
|
@QuantechTP @brettsam Did you manage to get to the bottom of the /binbin path issue? |
I can't remember -- there's been a bunch of fixes here :-) If you're seeing a problem with Microsoft.Net.Sdk.functions 1.0.29, can you open a new issue with the description and I can take it from there? Feel free to mention me (and link it in a comment here) and I can take a look. If you're able to run the build with "/bl" and email me (email is in my github profile) the msbuild.binlog file that it generates, that has been a huge help in investigating these. |
I was able to get past the "binbin" issue by editing the I changed the line to remove the "bin"
it looks like the $(TargetDir) variable already includes the "bin", so having it here also doubles it up. This was for an existing project. When I created a new project, the entire file is not there. So then I tried deleting the Directory.Build.targets file, and that also seemed to work. Hope that helps somebody ;) |
We already perform that tranformation here: Line 23 in f7f9d4f
Your Directory.Build.targets file may have been there to fix some older issue and it's no longer needed (and in fact, seems like it's breaking things). Thanks for coming back to let us know! |
This worked for me (1.0.29) |
Upgrade your Microsoft.Azure.WebJobs.Script.ExtensionsMetadataGenerator to 1.1.2 will solve the issue |
I've upgraded Microsoft.NET.Sdk.Functions to last version (1.0.29) and it solved my problem. It also includes Microsoft.Azure.WebJobs.Script.ExtensionsMetadataGenerator 1.1.2 version. |
I have updated to 1.0.29 but ran in this issue again today. |
In order to avoid the same issue, i have created a Windows accounts (Admin) by DevOps Agent. The goal of that is to have for each account it's own folder for nugets. (No more // issues on the same folder) Since i have change all Windows service with the new windows account i have no more errors in my builds ;) (need to restart the Agent Windows Service) |
1 similar comment
In order to avoid the same issue, i have created a Windows accounts (Admin) by DevOps Agent. The goal of that is to have for each account it's own folder for nugets. (No more // issues on the same folder) Since i have change all Windows service with the new windows account i have no more errors in my builds ;) (need to restart the Agent Windows Service) |
tried upgrading my functions to v3 with Microsoft.NET.Sdk.Functions 1.30.0-beta2 and I get the "binbin" problem, it uses Microsoft.Azure.WebJobs.Script.ExtensionsMetadataGenerator 1.1.2. |
This worked for me (1.30.0-beta2) |
I think the usage of Directory.Build.targets was for an old bug. Some people still have that file floating around, but it shouldn't be needed anymore and ends up applying "bin" twice. |
Repro steps
Provide the steps required to reproduce the problem:
dotnet publish C:\temp\OurFunctionApp.csproj -c Release -o C:\temp\output
Expected behavior
It should build without an error.
Actual behavior
Output of dotnet --version: 2.1.503
This error occurs sporadically on our Jenkins server. I can't reproduce it on my computer. Also, I cannot reproduce it if run this command on the Jenkins server from command line prompt.
Can you help?
The text was updated successfully, but these errors were encountered: