Skip to content
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

Package analysis failed #836

Closed
1 task
ryanliang88 opened this issue Aug 30, 2021 · 19 comments · Fixed by #850
Closed
1 task

Package analysis failed #836

ryanliang88 opened this issue Aug 30, 2021 · 19 comments · Fixed by #850
Assignees
Labels
bug Something isn't working community reported Triaged Label to show that UA team has triaged this issue.

Comments

@ryanliang88
Copy link

ryanliang88 commented Aug 30, 2021

  • Include the log file upgrade-assistant.clef that is produced in the working directory

Describe the bug

A clear and concise description of what the bug is.

FTL] Package analysis failed (analyzer Target compatibility reference analyzer: Collection was modified; enumeration operation may not execute.

Bug believed to be here


state.Packages.Remove(packageReference, new OperationDetails() { Risk = BuildBreakRisk.None, Details = details });

Exceptions (if any)

Likely System.InvalidOperationException

Further technical details

systeminfo | findstr /B /C:"OS Name" /C:"OS Version"
OS Name: Microsoft Windows 10 Pro
OS Version: 10.0.19043 N/A Build 19043

upgrade-assistant --version
0.2.241603+99dc6c7bf12364ae199f7acd8d0d42c631508de0

dotnet --list-sdks
2.2.207 [C:\Program Files\dotnet\sdk]
3.1.101 [C:\Program Files\dotnet\sdk]
3.1.401 [C:\Program Files\dotnet\sdk]
5.0.302 [C:\Program Files\dotnet\sdk]
5.0.400 [C:\Program Files\dotnet\sdk]

@twsouthwick
Copy link
Member

@sunandabalu Can you take a look at this? Looks to be in the analysis feature

@sunandabalu sunandabalu added bug Something isn't working community reported Triaged Label to show that UA team has triaged this issue. labels Sep 7, 2021
@sunandabalu sunandabalu self-assigned this Sep 7, 2021
@sunandabalu
Copy link
Member

@ryanliang88 Could you attach the log file and / or the csproj you are seeing this issue for?

@sunandabalu
Copy link
Member

@ryanliang88 I don't see the System.InvalidOperationException in the log that you have attached, was it one of the package mentions you cleaned up for privacy reasons?

@ryanliang88
Copy link
Author

Any update to this bug?

@sunandabalu
Copy link
Member

@ryanliang88 Is this bug blocking your ability to use UA for upgrade / analyze ? Unfortunately no progress on this yet due to other competing priorities, if this is blocking then we can consider re-prioritizing work on this bug.

@ryanliang88
Copy link
Author

It's not completely blocking, but it's blocking the "Update NuGet Packages" step which I've attempted to migrate manually. I was hoping to have this fixed and confirm that I've migrated correctly but it's fine to leave as is for the meantime.

Thanks for the update

@sunandabalu
Copy link
Member

It's not completely blocking, but it's blocking the "Update NuGet Packages" step which I've attempted to migrate manually. I was hoping to have this fixed and confirm that I've migrated correctly but it's fine to leave as is for the meantime.

Thanks for the update

@ryanliang88 Adding a simple fix to unblock you - #850

@ryanliang88
Copy link
Author

ryanliang88 commented Sep 15, 2021

Lovely, thank you. Do I just wait for PR approval and then rerun the following?:
dotnet tool install -g upgrade-assistant

I'm not totally sure how to get this new update (not sure how to build since I tried building locally but lots of things weren't working)

@sunandabalu
Copy link
Member

Lovely, thank you. Do I just wait for PR approval and then rerun the following?:
dotnet tool install -g upgrade-assistant

I'm not totally sure how to get this new update (not sure how to build since I tried building locally but lots of things weren't working)

Once the PR is merged, you will need to pick the tool update from the public AzDO feed like dotnet tool update -g upgrade-assistant --add-source https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-tools/nuget/v3/index.json

@ryanliang88
Copy link
Author

I'll give it a shot. Thanks again!

@ryanliang88
Copy link
Author

ryanliang88 commented Sep 15, 2021

I ran the following twice and it says that:
dotnet tool update -g upgrade-assistant --add-source https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-tools/nuget/v3/index.json

Tool 'upgrade-assistant' was reinstalled with the latest stable version (version '0.3.246302').

What is the version for the PR that was just completed and how do I get it?

@sunandabalu
Copy link
Member

I ran the following twice and it says that:
dotnet tool update -g upgrade-assistant --add-source https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-tools/nuget/v3/index.json

Tool 'upgrade-assistant' was reinstalled with the latest stable version (version '0.3.246302').

What is the version for the PR that was just completed and how do I get it?

Edit:
Oh, it seems like the PR is waiting for completion as of this comment

I just merged the PR, we need to wait for the CI to pick the commit and push to the feed. I'll let you know when the process completes.

@ryanliang88
Copy link
Author

Great to hear. Thank you!

@sunandabalu
Copy link
Member

sunandabalu commented Sep 16, 2021

@ryanliang88 The change is pushed to nuget, you can pick the version 0.3.246501 to get the change.

@ryanliang88
Copy link
Author

The bug itself can be considered fully resolved. I'm now unfortunately running into the following issue which is exactly what I had to try to do. Is there anything we can do about this?

Logger.LogError("Maximum package analysis and update iterations reached. Review NuGet dependencies manually");

@sunandabalu
Copy link
Member

The bug itself can be considered fully resolved. I'm now unfortunately running into the following issue which is exactly what I had to try to do. Is there anything we can do about this?

Logger.LogError("Maximum package analysis and update iterations reached. Review NuGet dependencies manually");

@mjrousos could you provide some guidance here?

@mjrousos
Copy link
Member

The PackageUpdaterStep runs dependency analyzers repeatedly until it stops finding things that need to be updated. This is done so that if a later analyzer makes a change previous analyzers have an opportunity to react to it.

Hitting this error is almost certainly a UA bug, but I can't think of why @sunandabalu's recent fix would have triggered it. @ryanliang88, are you able to share the csproj file that is running into this so that we can step through it in a debugger and figure out where the issue is?

@ryanliang88
Copy link
Author

I will get back to you ASAP as it's a potential privacy concern that may require review.

@SniperED007
Copy link

SniperED007 commented Dec 26, 2021

I'm getting the following error as well:

[21:20:08 INF] Applying upgrade step Clean up NuGet package references
[21:20:08 INF] Adding package reference: Microsoft.DotNet.UpgradeAssistant.Extensions.Default.Analyzers, Version=0.3.261602
[21:20:14 INF] Reference to .NET Upgrade Assistant analyzer package (Microsoft.DotNet.UpgradeAssistant.Extensions.Default.Analyzers, version 0.3.261602) needs to be added
[21:20:14 INF] Adding package reference: Microsoft.DotNet.UpgradeAssistant.Extensions.Default.Analyzers, Version=0.3.261602
[21:20:19 INF] Reference to .NET Upgrade Assistant analyzer package (Microsoft.DotNet.UpgradeAssistant.Extensions.Default.Analyzers, version 0.3.261602) needs to be added
[21:20:19 INF] Adding package reference: Microsoft.DotNet.UpgradeAssistant.Extensions.Default.Analyzers, Version=0.3.261602
[21:20:25 INF] Reference to .NET Upgrade Assistant analyzer package (Microsoft.DotNet.UpgradeAssistant.Extensions.Default.Analyzers, version 0.3.261602) needs to be added
[21:20:25 ERR] Maximum package analysis and update iterations reached. Review NuGet dependencies manually
[21:20:25 WRN] Upgrade step Clean up NuGet package references failed: Failed: Maximum package analysis and update iterations reached

Is there any way to manually get around this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working community reported Triaged Label to show that UA team has triaged this issue.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants