Skip to content

IOException running NuGet-Migrations during tests in dotnet CLI first run #80619

Closed
Unity-Technologies/ml-agents
#6083

Description

@akoeplinger

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

Build Definition Test Pull Request
368683 dotnet/runtime JIT.Methodical.eE.WorkItemExecution #90241
362596 dotnet/runtime JIT.Methodical.eE.WorkItemExecution #89003
361655 dotnet/runtime JIT.Math.WorkItemExecution #89905
361259 dotnet/runtime JIT.Generics.WorkItemExecution
361075 dotnet/runtime JIT.Regression.WorkItemExecution #89867
360768 dotnet/runtime JIT.Regression.JitBlue.WorkItemExecution #89815
360148 dotnet/runtime JIT.jit64.WorkItemExecution #89814
359522 dotnet/runtime JIT.Methodical.WorkItemExecution #89805
356421 dotnet/runtime JIT.Methodical.a-dA-D.WorkItemExecution
355235 dotnet/runtime JIT.Methodical.f-iF-I.WorkItemExecution #89009
343534 dotnet/runtime JIT.Methodical.WorkItemExecution
342037 dotnet/runtime JIT.Regression.JitBlue.WorkItemExecution #89008
341937 dotnet/runtime JIT.Methodical.a-dA-D.WorkItemExecution #89003
337982 dotnet/runtime JIT.HardwareIntrinsics.X86.Avx2.WorkItemExecution #88809
337742 dotnet/runtime JIT.Regression.CLR-x86-JIT.V1-M12-M13.WorkItemExecution #88769

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 could not be done without an Azure DevOps build URL on the issue. Please add it to the "Build: 🔎" line.
Validation performed at: 6/28/2023 10:04:55 PM UTC

Activity

  1. ghost added
    untriagedNew issue has not been triaged by the area owner
    on Jan 13, 2023
  2. ViktorHofer commented on Jan 13, 2023

    @ViktorHofer
    Member

    I thought that we were already setting that property at least for libraries tests. Maybe not for runtime tests? cc @jkoritzinsky

  3. carlossanlop commented on Jan 13, 2023

    @carlossanlop
    Contributor

    Another PR that hit this: #80615

  4. removed
    untriagedNew issue has not been triaged by the area owner
    on Feb 7, 2023
  5. added this to the 8.0.0 milestone on Feb 7, 2023
  6. radical commented on Feb 7, 2023

    @radical
    Member

    I'm hitting this fairly often. For example on a rolling build(log).

  7. radical commented on Feb 7, 2023

    @radical
    Member

    Another rolling build(log).

  8. carlossanlop commented on Feb 9, 2023

    @carlossanlop
    Contributor

    Another 7.0 dependency flow PR affected by this: #81812

  9. carlossanlop commented on Feb 9, 2023

    @carlossanlop
    Contributor

    I thought that we were already setting that property at least for libraries tests. Maybe not for runtime tests? cc @jkoritzinsky

    Ping @jkoritzinsky

  10. lewing commented on Feb 24, 2023

    @lewing
    Member

    did we do something in net8 that needs to also be done in net7 here?

  11. radical commented on Feb 28, 2023

    @radical
    Member

    This is affecting lot of builds.

  12. trylek commented on Feb 28, 2023

    @trylek
    Member

    I don't see any property / variable named DOTNET_SKIP_FIRST_TIME_EXPERIENCE in 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.

  13. 67 remaining items

  14. akoeplinger commented on Mar 30, 2023

    @akoeplinger
    MemberAuthor
  15. ericstj commented on Apr 6, 2023

    @ericstj
    Member

    Hit in #84355

  16. lewing commented on Apr 11, 2023

    @lewing
    Member

    hit in #84420 but pattern didn't match

  17. lewing commented on Apr 15, 2023

    @lewing
    Member

    Is there a plan for fixing the underlying issue here? A mutex that fails for compatibility reasons still is a very broken mutex.

  18. ghost added
    in-prThere is an active PR which will close this issue when it is merged
    on Aug 10, 2023
  19. kouvel commented on Aug 10, 2023

    @kouvel
    Contributor

    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.

  20. ghost removed
    in-prThere is an active PR which will close this issue when it is merged
    on Aug 11, 2023
  21. ghost locked as resolved and limited conversation to collaborators on Sep 11, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Known Build ErrorUse this to report build issues in the .NET Helix tabarea-Infrastructureblocking-clean-ciBlocking PR or rolling runs of 'runtime' or 'runtime-extra-platforms'

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions