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.

Depletes inotify limit on remote session

See original GitHub issue

Issue Type: Bug

Behaviour

Expected vs. Actual

Since 2-3 weeks, my each remote session (while I use Python extension for year/s in that scenario) depletes the inotify limit pretty quickly.

Seems like Python extension tries to inotify-watch a Python lib.

Steps to reproduce:

  1. Kill server processes on a target, close VS Code editors on client
  2. Open new VS Code on client, connect to a repository with 2 files, one being python
  3. Python extenstion launches
  4. After a while โ€œinotify limitโ€ popup can be seen

inotify consumers:

   INOTIFY   INSTANCES
   WATCHES      PER   
    COUNT     PROCESS   PID USER         COMMAND
------------------------------------------------------------
    8042         1      7427 mmatczak    ~/mmatczak/.vscode-server/bin/c3511e6c6
      41         1      8862 mmatczak    ~/mmatczak/.vscode-server/bin/c3511e6c6
       4         1      7123 mmatczak    ~/mmatczak/.vscode-server/bin/c3511e6c6

The process is:

node,7427,6680 ~/mmatczak/.vscode-server/bin/c3511e6c69bb39013c4a4b7b9566ec1ca73fc4d5/out/bootstrap-fork --type=fileWatcher

remoteagent.log shows itโ€™s a Python lib, that couldnโ€™t be watched because of a limit:

โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€
       โ”‚ File: ~/.vscode-server/data/logs/20220603T154041/remoteagent.log
โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€
   1   โ”‚ [2022-06-03 15:40:41.665] [remoteagent] [info] Extension host agent started.
   2   โ”‚ [2022-06-03 15:40:42.047] [remoteagent] [info] [127.0.0.1][69f3143f][ManagementConnection] New connection established.
   3   โ”‚ [2022-06-03 15:40:42.122] [remoteagent] [info] [127.0.0.1][b0d31593][ExtensionHostConnection] New connection established.
   4   โ”‚ [2022-06-03 15:40:43.664] [remoteagent] [info] [127.0.0.1][b0d31593][ExtensionHostConnection] <7647> Launched Extension Host Process.
   5   โ”‚ [2022-06-03 15:44:00.388] [remoteagent] [error] [File Watcher (parcel)] Inotify limit reached (ENOSPC) (path: /....../Python-3.8.0/lib/python3.8)
โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€

Diagnostic data

  • Python version (& distribution if applicable, e.g. Anaconda): 3.8.0
  • Type of virtual environment used (e.g. conda, venv, virtualenv, etc.): Unknown
  • Value of the python.languageServer setting: Pylance
Output for Python in the Output panel (Viewโ†’Output, change the drop-down the upper-right of the Output panel to Python)

Experiment 'pythonaacf' is active
Experiment 'pythonTensorboardExperiment' is active
Experiment 'PythonPyTorchProfiler' is active
Experiment 'pythonDeprecatePythonPath' is active
Experiment 'pythonInterpreterInfoPinned' is active
> conda info --json
> /XXX/Python-3.8.0/bin/python ~/.vscode-server/extensions/ms-python.python-2022.6.3/pythonFiles/get_output_via_markers.py ~/.vscode-server/extensions/ms-python.python-2022.6.3/pythonFiles/interpreterInfo.py
> /usr/share/anaconda/bin/conda info --json
> /file:/XXX/Python-3.8.0/bin/python ~/.vscode-server/extensions/ms-python.python-2022.6.3/pythonFiles/get_output_via_markers.py ~/.vscode-server/extensions/ms-python.python-2022.6.3/pythonFiles/interpreterInfo.py
[ERROR 2022-5-3 15:40:50.382]: [Error: Command failed: /file:/XXX/Python-3.8.0/bin/python ~/.vscode-server/extensions/ms-python.python-2022.6.3/pythonFiles/get_output_via_markers.py ~/.vscode-server/extensions/ms-python.python-2022.6.3/pythonFiles/interpreterInfo.py
/bin/sh: /file:/XXX/Python-3.8.0/bin/python: No such file or directory

	at ChildProcess.exithandler (node:child_process:397:12)
	at ChildProcess.emit (node:events:390:28)
	at maybeClose (node:internal/child_process:1064:16)
	at Socket.<anonymous> (node:internal/child_process:450:11)
	at Socket.emit (node:events:390:28)
	at Pipe.<anonymous> (node:net:687:12)] {
  killed: false,
  code: 127,
  signal: null,
  cmd: '/file:/XXX/Python-3.8.0/bin/python ~/.vscode-server/extensions/ms-python.python-2022.6.3/pythonFiles/get_output_via_markers.py ~/.vscode-server/extensions/ms-python.python-2022.6.3/pythonFiles/interpreterInfo.py'
}
Python interpreter path: /XXX/Python-3.8.0/bin/python
> /bin/python ~/.vscode-server/extensions/ms-python.python-2022.6.3/pythonFiles/get_output_via_markers.py ~/.vscode-server/extensions/ms-python.python-2022.6.3/pythonFiles/interpreterInfo.py
> /usr/bin/python ~/.vscode-server/extensions/ms-python.python-2022.6.3/pythonFiles/get_output_via_markers.py ~/.vscode-server/extensions/ms-python.python-2022.6.3/pythonFiles/interpreterInfo.py
> /usr/local/bin/python ~/.vscode-server/extensions/ms-python.python-2022.6.3/pythonFiles/get_output_via_markers.py ~/.vscode-server/extensions/ms-python.python-2022.6.3/pythonFiles/interpreterInfo.py
[ERROR 2022-5-3 15:40:51.220]: [Error: Command failed: /usr/local/bin/python ~/.vscode-server/extensions/ms-python.python-2022.6.3/pythonFiles/get_output_via_markers.py ~/.vscode-server/extensions/ms-python.python-2022.6.3/pythonFiles/interpreterInfo.py
Traceback (most recent call last):
  File "~/.vscode-server/extensions/ms-python.python-2022.6.3/pythonFiles/get_output_via_markers.py", line 26, in <module>
    runpy.run_path(module, run_name="__main__")
AttributeError: 'module' object has no attribute 'run_path'

	at ChildProcess.exithandler (node:child_process:397:12)
	at ChildProcess.emit (node:events:390:28)
	at maybeClose (node:internal/child_process:1064:16)
	at Socket.<anonymous> (node:internal/child_process:450:11)
	at Socket.emit (node:events:390:28)
	at Pipe.<anonymous> (node:net:687:12)] {
  killed: false,
  code: 1,
  signal: null,
  cmd: '/usr/local/bin/python ~/.vscode-server/extensions/ms-python.python-2022.6.3/pythonFiles/get_output_via_markers.py ~/.vscode-server/extensions/ms-python.python-2022.6.3/pythonFiles/interpreterInfo.py'
}
Starting Pylance language server.
[ERROR 2022-5-3 15:40:51.994]: Active interpreter type is detected as Unknown {"id":"/XXX/Python-3.8.0/bin/python","sysPrefix":"/XXX/Python-3.8.0","envType":"Unknown","envName":"","envPath":"","path":"/XXX/Python-3.8.0/bin/python","architecture":3,"sysVersion":"3.8.0 (default, Jun 27 2020, 21:48:56) \n[GCC 4.8.5 20150623 (Red Hat 4.8.5-4)]","version":{"raw":"3.8.0","major":3,"minor":8,"patch":0,"build":[],"prerelease":["final","0"]},"displayName":"Python 3.8.0 64-bit","detailedDisplayName":"Python 3.8.0 64-bit"}
> /XXX/Python-3.8.0/bin/python ~/.vscode-server/extensions/ms-python.python-2022.6.3/pythonFiles/linter.py -m pylint ./run.py
cwd: .
> /XXX/Python-3.8.0/bin/python ~/.vscode-server/extensions/ms-python.python-2022.6.3/pythonFiles/linter.py -m mypy --follow-imports=silent --ignore-missing-imports --show-column-numbers --no-pretty ./run.py
cwd: .
##########Linting Output - mypy##########

Success: no issues found in 1 source file

##########Linting Output - pylint##########

[
    {
        "type": "convention",
        "module": "run",
        "obj": "",
        "line": 7,
        "column": 0,
        "path": "run.py",
        "symbol": "trailing-newlines",
        "message": "Trailing newlines",
        "message-id": "C0305"
    },
    {
        "type": "convention",
        "module": "run",
        "obj": "",
        "line": 1,
        "column": 0,
        "path": "run.py",
        "symbol": "missing-module-docstring",
        "message": "Missing module docstring",
        "message-id": "C0114"
    }
]

User Settings


languageServer: "Pylance"

linting
โ€ข mypyEnabled: true

formatting
โ€ข autopep8Args: "<placeholder>"

Extension version: 2022.6.3 VS Code version: Code 1.67.2 (c3511e6c69bb39013c4a4b7b9566ec1ca73fc4d5, 2022-05-17T18:15:52.058Z) OS version: Windows_NT x64 10.0.18363 Restricted Mode: No Remote OS version: Linux x64 3.10.0-1127.10.1.el7.x86_64

System Info
Item Value
CPUs 11th Gen Intelยฎ Coreโ„ข i7-1185G7 @ 3.00GHz (8 x 1805)
GPU Status 2d_canvas: enabled
canvas_oop_rasterization: disabled_off
direct_rendering_display_compositor: disabled_off_ok
gpu_compositing: enabled
multiple_raster_threads: enabled_on
oop_rasterization: enabled
opengl: enabled_on
rasterization: enabled
raw_draw: disabled_off_ok
skia_renderer: enabled_on
video_decode: enabled
video_encode: enabled
vulkan: disabled_off
webgl: enabled
webgl2: enabled
Load (avg) undefined
Memory (System) 15.39GB (5.59GB free)
Process Argv โ€“crash-reporter-id 3c01249c-cb3d-4c5d-87ad-4909624b55b9
Screen Reader no
VM 0%
Item Value
Remote SSH: XXX
OS Linux x64 3.10.0-1127.10.1.el7.x86_64
CPUs Intelยฎ Xeonยฎ Gold 5218R CPU @ 2.10GHz (80 x 2899)
Memory (System) 503.41GB (3.76GB free)
VM 0%

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:12 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
karrtikrcommented, Jul 5, 2022

I understand that, but thereโ€™s nothing the Python extension can do here as thatโ€™s caused by Pylance. I recommend you open a new issue for them asking for a workaround.

What I meant by my previous comment is that as Pylance extension is active/enabled, it is able to file watch such directories.

0reactions
maciejmatczakcommented, Jul 5, 2022

@karrtikr, but both issues are closed as of today, while the problem is still actual.

Also, I didnโ€™t get the comment. I turn the extension on, so why it should not be active?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Depletes inotify limit on remote session ยท Issue #3001 - GitHub
I have no idea what this new (aggressive?) file watch strategy solves, but it is not achieved without a drawback. There are multiple...
Read more >
inotify and Solving the โ€œupper limit on inotify watches reached ...
inotify Watch Limit. While the first command applies it per session, the second survives a reboot. That's because it adds a line to...
Read more >
Inotify Watches Limit (Linux) | Knowledge Base - YouTrack
Inotify requires a "watch handle" to be set for each directory in the project. Unfortunately, the default limit of watch handles may not...
Read more >
RHBA-2009:0070: util-linux bug-fix update (Low) - Red Hat
A remote attacker could make use of that flaw to hijack user sessions. (CVE-2009-0030) SquirrelMail users should upgrade to this updatedย ...
Read more >
Memory leaks - CVE - Search Results
Affected by this vulnerability is an unknown functionality of the component mp4mux. The manipulation leads to memory leak. The attack can be launched...
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