Repository navigation
IOException running NuGet-Migrations during tests in dotnet CLI first run #80619
Copy link
Copy link
Closed
Unity-Technologies/ml-agents
#6083Labels
Known Build ErrorUse this to report build issues in the .NET Helix tabUse this to report build issues in the .NET Helix tabarea-Infrastructureblocking-clean-ciBlocking PR or rolling runs of 'runtime' or 'runtime-extra-platforms'Blocking PR or rolling runs of 'runtime' or 'runtime-extra-platforms'
Milestone
Description
This is affecting 6.0, 7.0 and 8.0.
In #80510 (comment) we saw a failure because some NuGet migration code failed to run during the dotnet CLI first run experience:
+ dotnet /datadisks/disk1/work/ADFC09B1/p/xunit/xunit.console.dll JIT/HardwareIntrinsics/JIT.HardwareIntrinsics.XUnitWrapper.dll -parallel collections -nocolor -noshadow -xml testResults.xml -trait TestGroup=JIT.HardwareIntrinsics.Arm.ArmBase
Microsoft.DotNet.XUnitConsoleRunner v2.5.0 (64-bit .NET 7.0.2)
Discovering: JIT.HardwareIntrinsics.XUnitWrapper (method display = ClassAndMethod, method display options = None)
Discovered: JIT.HardwareIntrinsics.XUnitWrapper (found 6 of 362 test cases)
Starting: JIT.HardwareIntrinsics.XUnitWrapper (parallel test collections = on, max threads = 2)
JIT/HardwareIntrinsics/Arm/ArmBase.Arm64/ArmBase.Arm64_ro/ArmBase.Arm64_ro.sh [FAIL]
System.IO.IOException: The system cannot open the device or file specified. : 'NuGet-Migrations'
at System.Threading.Mutex.CreateMutexCore(Boolean initiallyOwned, String name, Boolean& createdNew)
at System.Threading.Mutex..ctor(Boolean initiallyOwned, String name)
at NuGet.Common.Migrations.MigrationRunner.Run()
at Microsoft.DotNet.Configurer.DotnetFirstTimeUseConfigurer.Configure()
at Microsoft.DotNet.Cli.Program.ConfigureDotNetForFirstTimeUse(IFirstTimeUseNoticeSentinel firstTimeUseNoticeSentinel, IAspNetCertificateSentinel aspNetCertificateSentinel, IFileSentinel toolPathSentinel, Boolean isDotnetBeingInvokedFromNativeInstaller, DotnetFirstRunConfiguration dotnetFirstRunConfiguration, IEnvironmentProvider environmentProvider, Dictionary`2 performanceMeasurements)
at Microsoft.DotNet.Cli.Program.ProcessArgs(String[] args, TimeSpan startupTime, ITelemetry telemetryClient)
at Microsoft.DotNet.Cli.Program.Main(String[] args)
Return code: 1
We should look into disabling the first run experience via the DOTNET_SKIP_FIRST_TIME_EXPERIENCE=1 env var, it doesn't make sense to run that for the tests.
Report
Summary
| 24-Hour Hit Count | 7-Day Hit Count | 1-Month Count |
|---|---|---|
| 0 | 1 | 15 |
Known Issue Error Message
Fill the error message using known issues guidance.
{
"ErrorPattern": "The system cannot open the device or file specified. : ('|')NuGet-Migrations('|')",
"BuildRetry": false,
"ExcludeConsoleLog": false
}Known issue validation
Build: 🔎
Result validation:
Validation performed at: 6/28/2023 10:04:55 PM UTC
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
Known Build ErrorUse this to report build issues in the .NET Helix tabUse this to report build issues in the .NET Helix tabarea-Infrastructureblocking-clean-ciBlocking PR or rolling runs of 'runtime' or 'runtime-extra-platforms'Blocking PR or rolling runs of 'runtime' or 'runtime-extra-platforms'
Activity
ViktorHofer commentedon Jan 13, 2023
I thought that we were already setting that property at least for libraries tests. Maybe not for runtime tests? cc @jkoritzinsky
carlossanlop commentedon Jan 13, 2023
Another PR that hit this: #80615
radical commentedon Feb 7, 2023
I'm hitting this fairly often. For example on a rolling build(log).
radical commentedon Feb 7, 2023
Another rolling build(log).
carlossanlop commentedon Feb 9, 2023
Another 7.0 dependency flow PR affected by this: #81812
carlossanlop commentedon Feb 9, 2023
Ping @jkoritzinsky
lewing commentedon Feb 24, 2023
did we do something in net8 that needs to also be done in net7 here?
radical commentedon Feb 28, 2023
This is affecting lot of builds.
trylek commentedon Feb 28, 2023
I don't see any property / variable named
DOTNET_SKIP_FIRST_TIME_EXPERIENCEin the dotnet/sdk repo, @ViktorHofer / @akoeplinger - am I looking in the wrong place (can you please point me to the place where it's used?) or are you saying we need to build this as a new feature? In fact I'm somewhat puzzled by the above code, these are apparently CoreCLR tests and they shouldn't be normally executed via dotnet, that must be coming from somewhere else like Crossgen2 execution.67 remaining items
Add NuGet-Migrations workaround to runtime tests too
akoeplinger commentedon Mar 30, 2023
@am11 yep unfortunately the nuget migrations code runs before the NoLogo check so we can't use that one: https://github.com/dotnet/sdk/blob/ec824c9797659318c772330cb176286643a25dfe/src/Cli/Microsoft.DotNet.Configurer/DotnetFirstTimeUseConfigurer.cs#L62-L64
ericstj commentedon Apr 6, 2023
Hit in #84355
lewing commentedon Apr 11, 2023
hit in #84420 but pattern didn't match
Add NuGet-Migrations workaround to runtime tests too (#84129)
lewing commentedon Apr 15, 2023
Is there a plan for fixing the underlying issue here? A mutex that fails for compatibility reasons still is a very broken mutex.
kouvel commentedon Aug 10, 2023
The current plan after discussion is to revert the previous changes that made session-local mutexes user-specific, and offer user-specific mutexes as a new feature in a future release.
Fix session-local named mutex compat issue (#90342)
Use dotnet 8.x in pre-commits to fix flaky failures
Use dotnet 8.x in pre-commits to fix flaky failures (#6083)