question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Mutex constructor fails with "system cannot open the device or file specified"

See original GitHub issue

Hi, Just beeing a good citizen, and doing as the console is asking me to do:

bash-3.2$ pwsh PowerShell 7.0.0 Copyright © Microsoft Corporation. All rights reserved.

https://aka.ms/powershell Type ‘help’ to get help.

PS /Users/stephanevg/Code/ansible-lab/Roles> Oops, something went wrong. Please report this bug with the details below. Report on GitHub: https://github.com/PowerShell/PSReadLine/issues/new

Environment

PSReadLine: 2.0.0 PowerShell: 7.0.0 OS: Darwin 19.3.0 Darwin Kernel Version 19.3.0: Thu Jan 9 20:58:23 PST 2020; root:xnu-6153.81.5~1/RELEASE_X86_64

Exception

System.IO.IOException: The system cannot open the device or file specified. : 'PSReadLineHistoryFile_1525368525'
   at System.Threading.Mutex.CreateMutexCore(Boolean initiallyOwned, String name, Boolean& createdNew)
   at System.Threading.Mutex..ctor(Boolean initiallyOwned, String name)
   at Microsoft.PowerShell.PSConsoleReadLine.DelayedOneTimeInitialize()
   at Microsoft.PowerShell.PSConsoleReadLine.Initialize(Runspace runspace, EngineIntrinsics engineIntrinsics)
   at Microsoft.PowerShell.PSConsoleReadLine.ReadLine(Runspace runspace, EngineIntrinsics engineIntrinsics, CancellationToken cancellationToken)

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:14 (5 by maintainers)

github_iconTop GitHub Comments

5reactions
brainwipecommented, Nov 13, 2020

Please keep closed, this is for others landing here.

This error message is also thrown when /tmp is full. You can check how much is free using:

df -k /tmp

If Available is 0 or Use% is 100, then /tmp is full.

How you then go about cleaning it depends on your use case. To remove any file that’s older than 10 days:

sudo find /tmp -type f -atime +10 -delete

Apologies for pinging this thread, it’s the top result in Google for the error as a search term.

0reactions
daxian-dbwcommented, May 21, 2020

@FiggyRoll Thanks for the confirmation. That’s great.

More user friendly error message will be great to have.

Agreed. Opened https://github.com/dotnet/runtime/issues/36823. Hopefully dotnet team can improve the error message. I will close this issue as resolved.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Create Mutex throws Error The system cannot open ...
IOException : The system cannot open the device or file specified. ... Mutex..ctor(Boolean initiallyOwned, String name) at Network.Services.
Read more >
ProcessSharedData - do smth with mutex : DTRC-29836
Message = “The system cannot open the device or file specified. : '1_JetBrains. ... Mutex..ctor(Boolean initiallyOwned, String name).
Read more >
An error occurred during the activation of a particular ...
We recently ran into an issue where builds are failing to one of our Linux targets. ... The system cannot open the device...
Read more >
Mutex Constructor (System.Threading)
The named mutex exists and has access control security, but the user does not have FullControl. IOException. name is invalid. This can be...
Read more >
Mutex creation and opening failing? - C++ Forum
Hi, I am learning to use Mutexes and I tried to create a basic mutex using CreateMutex then see if the mutex is...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found