Skip to content
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

The system cannot open the device or file specified. : 'PSReadLineHistoryFile_3946503603' #1488

Closed
FiggyRoll opened this issue Apr 24, 2020 · 7 comments
Labels
Resolution-Duplicate There's another issue on the tracker that's pretty much the same thing.

Comments

@FiggyRoll
Copy link

Unable to run Powershell or Preview on MacOS if the PSReadline Module is loaded.

The error is:

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-rc1
PowerShell: 7.0.0
OS: Darwin 19.2.0 Darwin Kernel Version 19.2.0: Sat Nov 9 03:47:04 PST 2019; root:xnu-6153.61.1~20/RELEASE_X86_64
Last 0 Keys


Exception

System.IO.IOException: The system cannot open the device or file specified. : 'PSReadLineHistoryFile_3946503603'
   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)

Powershell lods fine if I delete / rename / dont load the PSReadLine module.

@ghost ghost added the Needs-Triage 🔍 It's a new issue that core contributor team needs to triage. label Apr 24, 2020
@iSazonov
Copy link

@FiggyRoll How can we reproduce the issue? Can you add more information?

@FiggyRoll
Copy link
Author

Hi @iSazonov

Sure. In terms of more info.

Running iterm2 using zsh on MacOS, and Powershell is installed using brew. Has failed since I updated to Powershell 7 from 6.

brew cask uninstall powershell
brew cask install powershell

Updating Homebrew...
==> Auto-updated Homebrew!
Updated 2 taps (homebrew/core and homebrew/cask).
=> Downloading https://github.com/PowerShell/PowerShell/releases/download/v7.0.0/powershell-7.0.0-osx-x64.pkg
Already downloaded: /Users/785207/Library/Caches/Homebrew/downloads/c509d60c30f795663f2d92d5ce54dc4ea3a700fed889ca40f66666df05ce4d14--powershell-7.0.0-osx-x64.pkg
==> Verifying SHA-256 checksum for Cask 'powershell'.
==> Installing Cask powershell
==> Running installer for powershell; your password may be necessary.
==> Package installers may write to any location; options such as --appdir are ignored.
installer: Package name is PowerShell - 7.0.0
installer: Installing at base path /
installer: The install was successful.
🍺 powershell was successfully installed!

then run powershell from iterm2

pwsh

first time running probably takes 10 - 15 seconds then the error above appears. Just checked using the native terminal as well and receive the same error.

Thanks

@FiggyRoll
Copy link
Author

Just as a side note I experience the same behaviour with powershell-preview as well

@FiggyRoll
Copy link
Author

Hi

This appears to be resolved now. I have upgraded my mac from 10.15.2 to 10.15.4 and both 7 and preview are now working. No idea what has changed to now make this work, but it is running as expected now.

Thanks

@daxian-dbw
Copy link
Member

@FiggyRoll Thanks for the follow-up comments. It looks you were still using a preview release of 7.0.0. Please upgrade to the 7.0.0 GA release if possible :)
Also please re-open this issue and update the PR description (environment data and repro steps) if you run into this issue again.

@ghost ghost removed the Needs-Triage 🔍 It's a new issue that core contributor team needs to triage. label Apr 28, 2020
@FiggyRoll
Copy link
Author

FiggyRoll commented May 18, 2020

Hi @daxian-dbw

Would it be possible to re-open this please? I dont appear to be able to reopen it myself (I'm assuming this is because you have closed it and not me?)

The issue has returned with the exact same error message

Exception

System.IO.IOException: The system cannot open the device or file specified. : 'PSReadLineHistoryFile_3946503603'
   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)

Other details from the error

### Environment
PSReadLine: 2.0.0
PowerShell: 7.0.1
OS: Darwin 19.4.0 Darwin Kernel Version 19.4.0: Wed Mar  4 22:28:40 PST 2020; root:xnu-6153.101.6~15/RELEASE_X86_64
Last 0 Keys

My mac is up to date and I'm not aware of any additional updates that have been installed in the last few days. This was working up until at least Wednesday last week.

To reproduce I just run pwsh from terminal on my mac. I noticed the issue this morning when opening a script in vscode, and then tested just opening powershell in terminal and the issue appeared.

I have powershell installed using brew, and up until this morning was on 7.0.0, I have upgraded to 7.1.0 this morning using 'brew cask upgrade powershell' but the issue persists. I did also have powershell-preview installed using brew which I have now removed, but still have the error.

UPDATE:
Checking installed updates on my mac and the only changes I can see are these

XProtectPlistConfigData:
  Version: 2121
  Source: Apple
  Install Date: 15/05/2020, 17:41
 
MRTConfigData:
  Version: 1.60
  Source: Apple
  Install Date: 15/05/2020, 17:46

Thanks

@daxian-dbw
Copy link
Member

@FiggyRoll Thanks for reporting back on this with additional information!
I will resolve this as a duplicate of #1464 and move your last comment to it. I really appreciate for the additional information.

@daxian-dbw daxian-dbw added the Resolution-Duplicate There's another issue on the tracker that's pretty much the same thing. label Sep 6, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Resolution-Duplicate There's another issue on the tracker that's pretty much the same thing.
Projects
None yet
Development

No branches or pull requests

3 participants