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.

[macOS and Linux] PSES crashes - System.IO.IOException: Too many open files

See original GitHub issue

System Details

  • Operating system name and version:
    • macOS 10.12.6
    • Ubuntu 16.0
  • VS Code version: 1.15.1
  • PowerShell extension version: 1.14.1
  • Output from $PSVersionTable (on macOS):
Name                           Value                                                                                                                                               
----                           -----                                                                                                                                               
PSVersion                      6.0.0-beta                                                                                                                                          
PSEdition                      Core                                                                                                                                                
GitCommitId                    v6.0.0-beta.6                                                                                                                                       
OS                             Darwin 16.7.0 Darwin Kernel Version 16.7.0: Thu Jun 15 17:36:27 PDT 2017; root:xnu-3789.70.16~2/RELEASE_X86_64                                      
Platform                       Unix                                                                                                                                                
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0...}                                                                                                                             
PSRemotingProtocolVersion      2.3                                                                                                                                                 
SerializationVersion           1.1.0.1                                                                                                                                             
WSManStackVersion              3.0                                                                                                                                                 

From macOS:

PS> code -v
1.15.1
41abd21afdf7424c89319ee7cb0445cc6f376959
PS> $pseditor.EditorServicesVersion

Major  Minor  Build  Revision
-----  -----  -----  --------
1      4      1      0


PS> code --list-extensions --show-versions
Shan.code-settings-sync@2.8.3
donjayamanne.python@0.7.0
fabianlauer.vs-code-xml-format@0.1.5
florianloch.text-transform@0.1.0
idleberg.applescript@0.6.1
ms-vscode.cpptools@0.12.3
ms-vscode.csharp@1.12.1
ms-vscode.PowerShell@1.4.1
slevesque.vscode-hexdump@1.4.0
PS> $PSVersionTable

Issue Description

Things start to go wrong when the PS version cannot be determined and the version is assumed to be v5:

[WARNING] - Method "GetVersionDetails" at line 153 of C:\projects\powershelleditorservices\src\PowerShellEditorServices\Session\PowerShellVersionDetails.cs

  Failed to look up PowerShell version, defaulting to version 5.

In effect, the Editor Services don’t work properly on either platform, but some aspects still work on Linux, such as F8.

On macOS, the logs show additional failures:

System.AggregateException: One or more errors occurred. (Too many open files) ---> System.IO.IOException: Too many open files
...
PowerShell Editor Services is terminating due to an unhandled exception

Note that ulimit -n (number of files that can be open simultaneously) still defaults to 256 as of macOS 10.12.6.

Attached Logs

macOs.zip

ubuntu.zip

Issue Analytics

  • State:open
  • Created 6 years ago
  • Reactions:1
  • Comments:6 (1 by maintainers)

github_iconTop GitHub Comments

2reactions
tom-hendersoncommented, Jan 14, 2018

Hi @daviwil, just wondering if you were able to look into this at all? I’m getting the same ‘Too many open files in system’ issue and lsof shows a huge number of files open under powershell processes.

I’m using VS Code 1.19.2, vscode-powershell 1.5.1 and MacOS 10.12.6.

2reactions
daviwilcommented, Sep 13, 2017

Thanks for the additional details! I’ll see if I can figure out a better way to open those files to work around the handle leakage, might be able to ship an update in the next couple of days.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Too many open files error on Mac OS: ulim…
A simple fix for the "too many files open" limitation of Mac OS is to use the "ulimit - n" command. Curiously, the...
Read more >
System.IO.IOException: Too many open files
I solved a similar issue by disabling Mono's file watcher due to a bug. In the terminal: export MONO_MANAGED_WATCHER=disabled.
Read more >
Linux Server: Too Many Open Files
The message indicates that the machine running out of file handles, check the current value and try increasing the value.
Read more >
Is there a fix for the "Too many open files in system" error ...
According to this helpful article (which I recommend reading):. By default, the maximum number of files that Mac OS X can open is...
Read more >
How to Fix the 'Too Many Open Files' Error in Linux?
Very often 'too many open files' errors occur on high-load Linux servers. It means that a process has opened too many files (file...
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