-
Notifications
You must be signed in to change notification settings - Fork 4.8k
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
IOException running NuGet-Migrations during tests in dotnet CLI first run #80619
IOException running NuGet-Migrations during tests in dotnet CLI first run #80619
Comments
Tagging subscribers to this area: @dotnet/runtime-infrastructure Issue DetailsIn #80510 (comment) we saw a failure because some NuGet migration code failed to run during the dotnet CLI first run experience:
We should look into disabling the first run experience via the
|
I thought that we were already setting that property at least for libraries tests. Maybe not for runtime tests? cc @jkoritzinsky |
Another PR that hit this: #80615 |
I'm hitting this fairly often. For example on a rolling build(log). |
Another rolling build(log). |
Another 7.0 dependency flow PR affected by this: #81812 |
Ping @jkoritzinsky |
did we do something in net8 that needs to also be done in net7 here? |
This is affecting lot of builds. |
I don't see any property / variable named |
This one is interesting but it's not the root thing, it just reacts on the fact that the variable isn't used anywhere: I continue looking what gutted this behavior. |
OK, so as I now understand it, the call to The check class for the implementation of the sentinel; this seems to be tied to the conditional block triggered by the command-line parameter which leads me to In this light I tend to believe that it might be possible to workaround this by using the internal option |
quite a few things expect it to work https://github.com/search?q=org%3Adotnet+DOTNET_SKIP_FIRST_TIME_EXPERIENCE&type=code |
As I said, I'm not all that much familiar with this era of SDK development. To reinstate the variable, I guess it would be easiest to hack around where we're already inspecting several environment variables. Adding an extra variable representing the "no-first-time-experience" and using it in an OR clause at line would probably go a long way towards satisfying both behaviors. Having said that, I still maintain I'm not an SDK expert so I'd love to hear from at least one person familiar with the repo that my conclusions make some sense. |
@marcpopMSFT - could you please comment on this or route this to someone familiar with the code in question? |
Looks similar to NuGet/Home#12159 |
Hmm interesting, looks like |
Hit in #84355 |
hit in #84420 but pattern didn't match |
Is there a plan for fixing the underlying issue here? A mutex that fails for compatibility reasons still is a very broken mutex. |
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. |
- A previous change that was serviced back changed session-local named mutexes to be user-specific by restricting the permissions of the session directories and files under them, and adding the sticky bit to some directoires. A compat issue arose from that change, as the session directories have the session ID in their name and session IDs can be reused between different users. The current plan that we have discussed is to revert the change and service back the revert, which also restores the intended behavior, and offer user-specific mutexes as a new feature in a future .NET that would satisfy some user scenarios in a better way. - This PR reverts the previous change (first commit) and restores one change from the previous change (second commit) to improve backward compatibility due to differences in permissions for session directories before and after the change - Fixes #80619
The 8.x release should contain dotnet/runtime#90342 which fixes dotnet/runtime#80619. I hope this will fix flaky failures like https://github.com/Unity-Technologies/ml-agents/actions/runs/8268945605/job/22623023348 of the form: ``` dotnet-format............................................................Failed - hook id: dotnet-format - exit code: 1 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(String migrationsDirectory) 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) ```
The 8.x release should contain dotnet/runtime#90342 which fixes dotnet/runtime#80619. I hope this will fix flaky failures like https://github.com/Unity-Technologies/ml-agents/actions/runs/8268945605/job/22623023348 of the form: ``` dotnet-format............................................................Failed - hook id: dotnet-format - exit code: 1 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(String migrationsDirectory) 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) ```
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:
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
Known Issue Error Message
Fill the error message using known issues guidance.
Known issue validation
Build: 🔎⚠️ Validation could not be done without an Azure DevOps build URL on the issue. Please add it to the "Build: 🔎" line.
Result validation:
Validation performed at: 6/28/2023 10:04:55 PM UTC
The text was updated successfully, but these errors were encountered: