Skip to content

The system cannot open the device or file specified 'NuGet-Migrations' #91987

Open

Description

Description

In a CI build, in the official sdk docker image, I run dotnet nuget locals all --clear, and get this:

RUN dotnet nuget locals all --clear
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)
ERROR: process "/bin/sh -c dotnet nuget locals all --clear" did not complete successfully: exit code: 1

Reproduction Steps

inside the sdk container:

RUN \
  export DOTNET_SKIP_FIRST_TIME_EXPERIENCE=1 && \
  dotnet nuget locals all --clear

Expected behavior

No error

Actual behavior

Error

Regression?

uknown

Known Workarounds

none

Configuration

mcr.microsoft.com/dotnet/sdk:7.0.400-bookworm-slim-amd64

Other information

Might be related to NuGet/Home#12159 and #80619, but those have been locked.

If I remove that offending line, I can build the docker image. If I then run that image and do something as simple as dotnet nuget it will give the same error as above.

{
  "ErrorMessage": "The system cannot open the device or file specified. : 'NuGet-Migrations'",
  "BuildRetry": false,
  "ErrorPattern": "",
  "ExcludeConsoleLog": false
}

Known issue validation

Build: 🔎 https://dev.azure.com/dnceng-public/public/_build/results?buildId=426482
Error message validated: The system cannot open the device or file specified. : 'NuGet-Migrations'
Result validation: ✅ Known issue matched with the provided build.
Validation performed at: 10/4/2023 1:44:58 AM UTC

Report

Summary

24-Hour Hit Count 7-Day Hit Count 1-Month Count
0 0 0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions