Open craigbehnke opened 3 months ago
The problem is with opening a named mutex. Since macOS doesn't natively support those, I believe they are implemented using file locks on temporary files, which could be the source of the problem.
Can you see if running the following code on your mac throws?
var mutexName = @"Global\Metalama.Configuration";
if ( !Mutex.TryOpenExisting( mutexName, out var _ ) )
{
new Mutex( false, mutexName );
}
If so, does the process have limited access to files on disk, or something like that?
I created a new ASP.NET Core project with only this code and ran it using dotnet run
. Here's the output:
Unhandled exception. System.IO.IOException: The system cannot open the device or file specified. : 'Global\Metalama.Configuration'
at System.Threading.Mutex.CreateMutexCore(Boolean initiallyOwned, String name, Boolean& createdNew)
at System.Threading.Mutex..ctor(Boolean initiallyOwned, String name)
at Program.<Main>$(String[] args) in /Users/me/Code/TestMutex/Program.cs:line 5
Just in case it was a permissions issue, I ran the same code using sudo dotnet run
, and got the same result.
However, when I ran dotnet run
with a different name -- "Global/Random.Name" -- it worked properly, and I was even able to run it repeatedly without encountering into an error.
Update: A hard restart solves it, so it does appear that it is linked to a /tmp file somewhere, or something else that can be cleared out on (re)boot.
Thanks for the information. I have reported this issue to the .Net runtime team, hopefully, they will be able to resolve it: https://github.com/dotnet/runtime/issues/100135.
I'm running into an issue with builds on my personal machine (MacBook w/ Apple Silicon) failing due to being unable to find 'Global\Metalama.Configuration'. I've tried to Google my way through the problem, but there are no results on Google for "Metalama.Configuration" and only one code reference on GitHub.
At the same time, builds on my CICD system continue to work, which leads me to believe that it is a config or corruption issue on my machine. What should I do/look for in order to address the problem?
Stacktrace
What I've tried
1) Deleting all files within my local repository, and then reapplying only committed files to remove generated files. 2) Deleting all downloaded packages in /Users/me/.nuget/packages at the same time as step 1 to force new copies to be redownloaded.
Other questions: are there other locations that should be cleaned out in order to fix this issue, or is there something else I should be doing?