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

isort formatter server crashes on 3.11 #97

Closed
pfmoore opened this issue Aug 9, 2022 · 11 comments · Fixed by #130
Closed

isort formatter server crashes on 3.11 #97

pfmoore opened this issue Aug 9, 2022 · 11 comments · Fixed by #130
Assignees
Labels
triage-needed Issue is not triaged.

Comments

@pfmoore
Copy link

pfmoore commented Aug 9, 2022

Type: Bug

Start VS Code on my project.

I cannot reproduce on other projects. I have followed the instructions on a similar issue I found (reinstall all extensions) and that had no effect. The other issue mentioned a workspace file - I have no .vscode directory in this project folder, and I don't know where else I should look.

Restarting the isort server just produces the same error.

Extension version: 2022.2.0
VS Code version: Code 1.70.0 (da76f93349a72022ca4670c1b84860304616aaa2, 2022-08-04T04:38:16.462Z)
OS version: Windows_NT x64 10.0.22000
Modes:

System Info
Item Value
CPUs Intel(R) Core(TM) i9-9980HK CPU @ 2.40GHz (16 x 2400)
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
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) 31.73GB (16.11GB free)
Process Argv --crash-reporter-id d99325fe-b12a-45c2-b763-29c3a74b710e
Screen Reader no
VM 0%
A/B Experiments
vsliv368:30146709
vsreu685:30147344
python383:30185418
vspor879:30202332
vspor708:30202333
vspor363:30204092
vslsvsres303:30308271
pythonvspyl392:30443607
vserr242cf:30382550
pythontb:30283811
vsjup518:30340749
pythonptprofiler:30281270
vshan820:30294714
vstes263cf:30335440
vscoreces:30445986
pythondataviewer:30285071
vscod805:30301674
binariesv615:30325510
bridge0708:30335490
bridge0723:30353136
cmake_vspar411:30542924
vsaa593:30376534
vsc1dst:30438360
pythonvs932:30410667
wslgetstarted:30449410
vscscmwlcmt:30465135
cppdebug:30492333
vscaat:30438848
pylanb8912:30529769
vsclangdf:30486550
c4g48928:30535728
d7fjc500:30543455
dsvsc012:30540252

@github-actions github-actions bot added the triage-needed Issue is not triaged. label Aug 9, 2022
@pfmoore
Copy link
Author

pfmoore commented Aug 9, 2022

I found the following log file. I don't know if it helps.

[2022-08-09 14:44:19.962] [exthost] [info] Extension host with pid 7368 started

[2022-08-09 14:44:19.962] [exthost] [info] Skipping acquiring lock for c:\Users\Gustav\AppData\Roaming\Code\User\workspaceStorage\09413e8b615c2e6c9638eb0d7601ef60.

[2022-08-09 14:44:20.272] [exthost] [info] ExtensionService#_doActivateExtension ms-python.python, startup: false, activationEvent: 'onLanguage:python', root cause: ms-python.black-formatter

[2022-08-09 14:44:20.575] [exthost] [info] ExtensionService#_doActivateExtension ms-toolsai.jupyter, startup: false, activationEvent: 'onLanguage:python'

[2022-08-09 14:44:20.679] [exthost] [info] ExtensionService#_doActivateExtension vscode.microsoft-authentication, startup: false, activationEvent: 'onAuthenticationRequest:microsoft'

[2022-08-09 14:44:20.712] [exthost] [info] ExtensionService#_doActivateExtension vscode.debug-auto-launch, startup: true, activationEvent: '*'

[2022-08-09 14:44:20.720] [exthost] [info] ExtensionService#_doActivateExtension vscode.git-base, startup: true, activationEvent: '*', root cause: vscode.git

[2022-08-09 14:44:20.726] [exthost] [info] ExtensionService#_doActivateExtension vscode.ipynb, startup: true, activationEvent: '*'

[2022-08-09 14:44:20.731] [exthost] [info] ExtensionService#_doActivateExtension stkb.rewrap, startup: true, activationEvent: '*'

[2022-08-09 14:44:20.748] [exthost] [info] ExtensionService#_doActivateExtension vscode-icons-team.vscode-icons, startup: true, activationEvent: '*'

[2022-08-09 14:44:21.264] [exthost] [info] ExtensionService#_doActivateExtension vscode.git, startup: true, activationEvent: '*'

[2022-08-09 14:44:21.283] [exthost] [info] ExtensionService#_doActivateExtension vscode.github, startup: true, activationEvent: '*'

[2022-08-09 14:44:21.365] [exthost] [info] ExtensionService#_doActivateExtension ms-toolsai.jupyter-renderers, startup: false, activationEvent: 'api', root cause: ms-toolsai.jupyter

[2022-08-09 14:44:21.478] [exthost] [info] ExtensionService#_doActivateExtension ms-python.black-formatter, startup: false, activationEvent: 'onLanguage:python'

[2022-08-09 14:44:21.488] [exthost] [info] ExtensionService#_doActivateExtension ms-python.isort, startup: false, activationEvent: 'onLanguage:python'

[2022-08-09 14:44:21.497] [exthost] [info] ExtensionService#_doActivateExtension ms-python.vscode-pylance, startup: false, activationEvent: 'onLanguage:python'

[2022-08-09 14:44:21.579] [exthost] [info] ExtensionService#_doActivateExtension vscode.github-authentication, startup: false, activationEvent: 'onAuthenticationRequest:github'

[2022-08-09 14:44:21.931] [exthost] [info] ExtensionService#_doActivateExtension vscode.configuration-editing, startup: false, activationEvent: 'onLanguage:jsonc'

[2022-08-09 14:44:21.944] [exthost] [info] ExtensionService#_doActivateExtension vscode.json-language-features, startup: false, activationEvent: 'onLanguage:jsonc'

[2022-08-09 14:44:21.971] [exthost] [info] ExtensionService#_doActivateExtension vscode.typescript-language-features, startup: false, activationEvent: 'onLanguage:jsonc'

[2022-08-09 14:44:23.745] [exthost] [error] [ms-python.isort] provider FAILED

[2022-08-09 14:44:23.745] [exthost] [error] TypeError: Cannot read properties of null (reading 'map')
	at g (c:\Users\Gustav\.vscode\extensions\ms-python.isort-2022.2.0\dist\extension.js:1:213014)
	at Object.asCodeAction (c:\Users\Gustav\.vscode\extensions\ms-python.isort-2022.2.0\dist\extension.js:1:223954)
	at c:\Users\Gustav\.vscode\extensions\ms-python.isort-2022.2.0\dist\extension.js:1:152688
	at async A.provideCodeActions (c:\Users\Gustav\AppData\Local\Programs\Microsoft VS Code\resources\app\out\vs\workbench\api\node\extensionHostProcess.js:87:42833)

[2022-08-09 14:44:23.981] [exthost] [error] [ms-python.isort] provider FAILED

[2022-08-09 14:44:23.981] [exthost] [error] TypeError: Cannot read properties of null (reading 'map')
	at g (c:\Users\Gustav\.vscode\extensions\ms-python.isort-2022.2.0\dist\extension.js:1:213014)
	at Object.asCodeAction (c:\Users\Gustav\.vscode\extensions\ms-python.isort-2022.2.0\dist\extension.js:1:223954)
	at c:\Users\Gustav\.vscode\extensions\ms-python.isort-2022.2.0\dist\extension.js:1:152688
	at async A.provideCodeActions (c:\Users\Gustav\AppData\Local\Programs\Microsoft VS Code\resources\app\out\vs\workbench\api\node\extensionHostProcess.js:87:42833)

[2022-08-09 14:44:24.227] [exthost] [info] Eager extensions activated

[2022-08-09 14:44:24.230] [exthost] [info] ExtensionService#_doActivateExtension vscode.emmet, startup: false, activationEvent: 'onStartupFinished'

[2022-08-09 14:44:24.240] [exthost] [info] ExtensionService#_doActivateExtension vscode.merge-conflict, startup: false, activationEvent: 'onStartupFinished'

[2022-08-09 14:44:24.243] [exthost] [info] ExtensionService#_doActivateExtension ms-vscode-remote.remote-wsl-recommender, startup: false, activationEvent: 'onStartupFinished'

[2022-08-09 14:44:24.252] [exthost] [info] ExtensionService#_doActivateExtension eamodio.gitlens, startup: false, activationEvent: 'onStartupFinished'

[2022-08-09 14:44:24.297] [exthost] [info] ExtensionService#_doActivateExtension formulahendry.code-runner, startup: false, activationEvent: 'onStartupFinished'

[2022-08-09 14:44:24.359] [exthost] [info] ExtensionService#_doActivateExtension ms-vscode-remote.remote-wsl, startup: false, activationEvent: 'onStartupFinished'

[2022-08-09 14:44:25.858] [exthost] [error] [ms-python.isort] provider FAILED

[2022-08-09 14:44:25.858] [exthost] [error] TypeError: Cannot read properties of null (reading 'map')
	at g (c:\Users\Gustav\.vscode\extensions\ms-python.isort-2022.2.0\dist\extension.js:1:213014)
	at Object.asCodeAction (c:\Users\Gustav\.vscode\extensions\ms-python.isort-2022.2.0\dist\extension.js:1:223954)
	at c:\Users\Gustav\.vscode\extensions\ms-python.isort-2022.2.0\dist\extension.js:1:152688
	at async A.provideCodeActions (c:\Users\Gustav\AppData\Local\Programs\Microsoft VS Code\resources\app\out\vs\workbench\api\node\extensionHostProcess.js:87:42833)

[2022-08-09 14:44:46.577] [exthost] [info] Extension host terminating: received terminate message from renderer

[2022-08-09 14:44:46.853] [exthost] [warning] {"name":"Canceled"}

[2022-08-09 14:44:46.868] [exthost] [info] Extension host with pid 7368 exiting with code 0


@karthiknadig
Copy link
Member

@pfmoore Can you share what you get in Output > isort panel ? It should have more details on what caused the crash.

TypeError: Cannot read properties of null (reading 'map')
	at g (c:\Users\Gustav\.vscode\extensions\ms-python.isort-2022.2.0\dist\extension.js:1:213014)
	at Object.asCodeAction (c:\Users\Gustav\.vscode\extensions\ms-python.isort-2022.2.0\dist\extension.js:1:223954)
	at c:\Users\Gustav\.vscode\extensions\ms-python.isort-2022.2.0\dist\extension.js:1:152688
	at async A.provideCodeActions (c:\Users\Gustav\AppData\Local\Programs\Microsoft VS Code\resources\app\out\vs\workbench\api\node\extensionHostProcess.js:87:42833)

The above error actually does not impact the results of import sorting, nor does it cause the server to crash. I think something else is failing before it gets to some stable point.

@karthiknadig karthiknadig self-assigned this Aug 9, 2022
@pfmoore
Copy link
Author

pfmoore commented Aug 9, 2022

Ah, thanks for the pointer - I hadn't been able to find that output.

Formatter Name: isort
Formatter Module: isort
Traceback (most recent call last):
  File "c:\Users\Gustav\.vscode\extensions\ms-python.isort-2022.2.0\bundled\formatter\format_server.py", line 20, in <module>
    from pygls import lsp, protocol, server, uris, workspace
  File "c:\Users\Gustav\.vscode\extensions\ms-python.isort-2022.2.0\bundled\libs\pygls\lsp\__init__.py", line 23, in <module>
    from pygls.lsp.types import *
  File "c:\Users\Gustav\.vscode\extensions\ms-python.isort-2022.2.0\bundled\libs\pygls\lsp\types\__init__.py", line 6, in <module>
    from pygls.lsp.types.general_messages import *
  File "c:\Users\Gustav\.vscode\extensions\ms-python.isort-2022.2.0\bundled\libs\pygls\lsp\types\general_messages.py", line 35, in <module>
    from pygls.lsp.types.language_features import (CallHierarchyClientCapabilities,
  File "c:\Users\Gustav\.vscode\extensions\ms-python.isort-2022.2.0\bundled\libs\pygls\lsp\types\language_features\__init__.py", line 2, in <module>
    from pygls.lsp.types.language_features.call_hierarchy import *
  File "c:\Users\Gustav\.vscode\extensions\ms-python.isort-2022.2.0\bundled\libs\pygls\lsp\types\language_features\call_hierarchy.py", line 70, in <module>
    class CallHierarchyIncomingCall(Model):
  File "c:\Users\Gustav\.vscode\extensions\ms-python.isort-2022.2.0\bundled\libs\pydantic\main.py", line 369, in __new__
    cls.__signature__ = ClassAttribute('__signature__', generate_model_signature(cls.__init__, fields, config))
                                                        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "c:\Users\Gustav\.vscode\extensions\ms-python.isort-2022.2.0\bundled\libs\pydantic\utils.py", line 231, in generate_model_signature
    merged_params[param_name] = Parameter(
                                ^^^^^^^^^^
  File "C:\Users\Gustav\AppData\Local\Programs\Python\Python311\Lib\inspect.py", line 2715, in __init__
    raise ValueError('{!r} is not a valid parameter name'.format(name))
ValueError: 'from' is not a valid parameter name
[Info  - 14:37:19] Connection to server got closed. Server will restart.
Traceback (most recent call last):
  File "c:\Users\Gustav\.vscode\extensions\ms-python.isort-2022.2.0\bundled\formatter\format_server.py", line 20, in <module>
    from pygls import lsp, protocol, server, uris, workspace
  File "c:\Users\Gustav\.vscode\extensions\ms-python.isort-2022.2.0\bundled\libs\pygls\lsp\__init__.py", line 23, in <module>
    from pygls.lsp.types import *
  File "c:\Users\Gustav\.vscode\extensions\ms-python.isort-2022.2.0\bundled\libs\pygls\lsp\types\__init__.py", line 6, in <module>
    from pygls.lsp.types.general_messages import *
  File "c:\Users\Gustav\.vscode\extensions\ms-python.isort-2022.2.0\bundled\libs\pygls\lsp\types\general_messages.py", line 35, in <module>
    from pygls.lsp.types.language_features import (CallHierarchyClientCapabilities,
  File "c:\Users\Gustav\.vscode\extensions\ms-python.isort-2022.2.0\bundled\libs\pygls\lsp\types\language_features\__init__.py", line 2, in <module>
    from pygls.lsp.types.language_features.call_hierarchy import *
  File "c:\Users\Gustav\.vscode\extensions\ms-python.isort-2022.2.0\bundled\libs\pygls\lsp\types\language_features\call_hierarchy.py", line 70, in <module>
    class CallHierarchyIncomingCall(Model):
  File "c:\Users\Gustav\.vscode\extensions\ms-python.isort-2022.2.0\bundled\libs\pydantic\main.py", line 369, in __new__
    cls.__signature__ = ClassAttribute('__signature__', generate_model_signature(cls.__init__, fields, config))
                                                        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "c:\Users\Gustav\.vscode\extensions\ms-python.isort-2022.2.0\bundled\libs\pydantic\utils.py", line 231, in generate_model_signature
    merged_params[param_name] = Parameter(
                                ^^^^^^^^^^
  File "C:\Users\Gustav\AppData\Local\Programs\Python\Python311\Lib\inspect.py", line 2715, in __init__
    raise ValueError('{!r} is not a valid parameter name'.format(name))
ValueError: 'from' is not a valid parameter name
[Info  - 14:37:19] Connection to server got closed. Server will restart.
Traceback (most recent call last):
  File "c:\Users\Gustav\.vscode\extensions\ms-python.isort-2022.2.0\bundled\formatter\format_server.py", line 20, in <module>
    from pygls import lsp, protocol, server, uris, workspace
  File "c:\Users\Gustav\.vscode\extensions\ms-python.isort-2022.2.0\bundled\libs\pygls\lsp\__init__.py", line 23, in <module>
    from pygls.lsp.types import *
  File "c:\Users\Gustav\.vscode\extensions\ms-python.isort-2022.2.0\bundled\libs\pygls\lsp\types\__init__.py", line 6, in <module>
    from pygls.lsp.types.general_messages import *
  File "c:\Users\Gustav\.vscode\extensions\ms-python.isort-2022.2.0\bundled\libs\pygls\lsp\types\general_messages.py", line 35, in <module>
    from pygls.lsp.types.language_features import (CallHierarchyClientCapabilities,
  File "c:\Users\Gustav\.vscode\extensions\ms-python.isort-2022.2.0\bundled\libs\pygls\lsp\types\language_features\__init__.py", line 2, in <module>
    from pygls.lsp.types.language_features.call_hierarchy import *
  File "c:\Users\Gustav\.vscode\extensions\ms-python.isort-2022.2.0\bundled\libs\pygls\lsp\types\language_features\call_hierarchy.py", line 70, in <module>
    class CallHierarchyIncomingCall(Model):
  File "c:\Users\Gustav\.vscode\extensions\ms-python.isort-2022.2.0\bundled\libs\pydantic\main.py", line 369, in __new__
    cls.__signature__ = ClassAttribute('__signature__', generate_model_signature(cls.__init__, fields, config))
                                                        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "c:\Users\Gustav\.vscode\extensions\ms-python.isort-2022.2.0\bundled\libs\pydantic\utils.py", line 231, in generate_model_signature
    merged_params[param_name] = Parameter(
                                ^^^^^^^^^^
  File "C:\Users\Gustav\AppData\Local\Programs\Python\Python311\Lib\inspect.py", line 2715, in __init__
    raise ValueError('{!r} is not a valid parameter name'.format(name))
ValueError: 'from' is not a valid parameter name
[Info  - 14:37:20] Connection to server got closed. Server will restart.
Traceback (most recent call last):
  File "c:\Users\Gustav\.vscode\extensions\ms-python.isort-2022.2.0\bundled\formatter\format_server.py", line 20, in <module>
    from pygls import lsp, protocol, server, uris, workspace
  File "c:\Users\Gustav\.vscode\extensions\ms-python.isort-2022.2.0\bundled\libs\pygls\lsp\__init__.py", line 23, in <module>
    from pygls.lsp.types import *
  File "c:\Users\Gustav\.vscode\extensions\ms-python.isort-2022.2.0\bundled\libs\pygls\lsp\types\__init__.py", line 6, in <module>
    from pygls.lsp.types.general_messages import *
  File "c:\Users\Gustav\.vscode\extensions\ms-python.isort-2022.2.0\bundled\libs\pygls\lsp\types\general_messages.py", line 35, in <module>
    from pygls.lsp.types.language_features import (CallHierarchyClientCapabilities,
  File "c:\Users\Gustav\.vscode\extensions\ms-python.isort-2022.2.0\bundled\libs\pygls\lsp\types\language_features\__init__.py", line 2, in <module>
    from pygls.lsp.types.language_features.call_hierarchy import *
  File "c:\Users\Gustav\.vscode\extensions\ms-python.isort-2022.2.0\bundled\libs\pygls\lsp\types\language_features\call_hierarchy.py", line 70, in <module>
    class CallHierarchyIncomingCall(Model):
  File "c:\Users\Gustav\.vscode\extensions\ms-python.isort-2022.2.0\bundled\libs\pydantic\main.py", line 369, in __new__
    cls.__signature__ = ClassAttribute('__signature__', generate_model_signature(cls.__init__, fields, config))
                                                        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "c:\Users\Gustav\.vscode\extensions\ms-python.isort-2022.2.0\bundled\libs\pydantic\utils.py", line 231, in generate_model_signature
    merged_params[param_name] = Parameter(
                                ^^^^^^^^^^
  File "C:\Users\Gustav\AppData\Local\Programs\Python\Python311\Lib\inspect.py", line 2715, in __init__
    raise ValueError('{!r} is not a valid parameter name'.format(name))
ValueError: 'from' is not a valid parameter name
[Info  - 14:37:20] Connection to server got closed. Server will restart.
Traceback (most recent call last):
  File "c:\Users\Gustav\.vscode\extensions\ms-python.isort-2022.2.0\bundled\formatter\format_server.py", line 20, in <module>
    from pygls import lsp, protocol, server, uris, workspace
  File "c:\Users\Gustav\.vscode\extensions\ms-python.isort-2022.2.0\bundled\libs\pygls\lsp\__init__.py", line 23, in <module>
    from pygls.lsp.types import *
  File "c:\Users\Gustav\.vscode\extensions\ms-python.isort-2022.2.0\bundled\libs\pygls\lsp\types\__init__.py", line 6, in <module>
    from pygls.lsp.types.general_messages import *
  File "c:\Users\Gustav\.vscode\extensions\ms-python.isort-2022.2.0\bundled\libs\pygls\lsp\types\general_messages.py", line 35, in <module>
    from pygls.lsp.types.language_features import (CallHierarchyClientCapabilities,
  File "c:\Users\Gustav\.vscode\extensions\ms-python.isort-2022.2.0\bundled\libs\pygls\lsp\types\language_features\__init__.py", line 2, in <module>
    from pygls.lsp.types.language_features.call_hierarchy import *
  File "c:\Users\Gustav\.vscode\extensions\ms-python.isort-2022.2.0\bundled\libs\pygls\lsp\types\language_features\call_hierarchy.py", line 70, in <module>
    class CallHierarchyIncomingCall(Model):
  File "c:\Users\Gustav\.vscode\extensions\ms-python.isort-2022.2.0\bundled\libs\pydantic\main.py", line 369, in __new__
    cls.__signature__ = ClassAttribute('__signature__', generate_model_signature(cls.__init__, fields, config))
                                                        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "c:\Users\Gustav\.vscode\extensions\ms-python.isort-2022.2.0\bundled\libs\pydantic\utils.py", line 231, in generate_model_signature
    merged_params[param_name] = Parameter(
                                ^^^^^^^^^^
  File "C:\Users\Gustav\AppData\Local\Programs\Python\Python311\Lib\inspect.py", line 2715, in __init__
    raise ValueError('{!r} is not a valid parameter name'.format(name))
ValueError: 'from' is not a valid parameter name
[Error - 14:37:21] Connection to server got closed. Server will not be restarted.
Traceback (most recent call last):
  File "c:\Users\Gustav\.vscode\extensions\ms-python.isort-2022.2.0\bundled\formatter\format_server.py", line 20, in <module>
    from pygls import lsp, protocol, server, uris, workspace
  File "c:\Users\Gustav\.vscode\extensions\ms-python.isort-2022.2.0\bundled\libs\pygls\lsp\__init__.py", line 23, in <module>
    from pygls.lsp.types import *
  File "c:\Users\Gustav\.vscode\extensions\ms-python.isort-2022.2.0\bundled\libs\pygls\lsp\types\__init__.py", line 6, in <module>
    from pygls.lsp.types.general_messages import *
  File "c:\Users\Gustav\.vscode\extensions\ms-python.isort-2022.2.0\bundled\libs\pygls\lsp\types\general_messages.py", line 35, in <module>
    from pygls.lsp.types.language_features import (CallHierarchyClientCapabilities,
  File "c:\Users\Gustav\.vscode\extensions\ms-python.isort-2022.2.0\bundled\libs\pygls\lsp\types\language_features\__init__.py", line 2, in <module>
    from pygls.lsp.types.language_features.call_hierarchy import *
  File "c:\Users\Gustav\.vscode\extensions\ms-python.isort-2022.2.0\bundled\libs\pygls\lsp\types\language_features\call_hierarchy.py", line 70, in <module>
    class CallHierarchyIncomingCall(Model):
  File "c:\Users\Gustav\.vscode\extensions\ms-python.isort-2022.2.0\bundled\libs\pydantic\main.py", line 369, in __new__
    cls.__signature__ = ClassAttribute('__signature__', generate_model_signature(cls.__init__, fields, config))
                                                        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "c:\Users\Gustav\.vscode\extensions\ms-python.isort-2022.2.0\bundled\libs\pydantic\utils.py", line 231, in generate_model_signature
    merged_params[param_name] = Parameter(
                                ^^^^^^^^^^
  File "C:\Users\Gustav\AppData\Local\Programs\Python\Python311\Lib\inspect.py", line 2715, in __init__
    raise ValueError('{!r} is not a valid parameter name'.format(name))
ValueError: 'from' is not a valid parameter name
[Info  - 14:38:35] Connection to server got closed. Server will restart.
Traceback (most recent call last):
  File "c:\Users\Gustav\.vscode\extensions\ms-python.isort-2022.2.0\bundled\formatter\format_server.py", line 20, in <module>
    from pygls import lsp, protocol, server, uris, workspace
  File "c:\Users\Gustav\.vscode\extensions\ms-python.isort-2022.2.0\bundled\libs\pygls\lsp\__init__.py", line 23, in <module>
    from pygls.lsp.types import *
  File "c:\Users\Gustav\.vscode\extensions\ms-python.isort-2022.2.0\bundled\libs\pygls\lsp\types\__init__.py", line 6, in <module>
    from pygls.lsp.types.general_messages import *
  File "c:\Users\Gustav\.vscode\extensions\ms-python.isort-2022.2.0\bundled\libs\pygls\lsp\types\general_messages.py", line 35, in <module>
    from pygls.lsp.types.language_features import (CallHierarchyClientCapabilities,
  File "c:\Users\Gustav\.vscode\extensions\ms-python.isort-2022.2.0\bundled\libs\pygls\lsp\types\language_features\__init__.py", line 2, in <module>
    from pygls.lsp.types.language_features.call_hierarchy import *
  File "c:\Users\Gustav\.vscode\extensions\ms-python.isort-2022.2.0\bundled\libs\pygls\lsp\types\language_features\call_hierarchy.py", line 70, in <module>
    class CallHierarchyIncomingCall(Model):
  File "c:\Users\Gustav\.vscode\extensions\ms-python.isort-2022.2.0\bundled\libs\pydantic\main.py", line 369, in __new__
    cls.__signature__ = ClassAttribute('__signature__', generate_model_signature(cls.__init__, fields, config))
                                                        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "c:\Users\Gustav\.vscode\extensions\ms-python.isort-2022.2.0\bundled\libs\pydantic\utils.py", line 231, in generate_model_signature
    merged_params[param_name] = Parameter(
                                ^^^^^^^^^^
  File "C:\Users\Gustav\AppData\Local\Programs\Python\Python311\Lib\inspect.py", line 2715, in __init__
    raise ValueError('{!r} is not a valid parameter name'.format(name))
ValueError: 'from' is not a valid parameter name
[Info  - 14:38:35] Connection to server got closed. Server will restart.
Traceback (most recent call last):
  File "c:\Users\Gustav\.vscode\extensions\ms-python.isort-2022.2.0\bundled\formatter\format_server.py", line 20, in <module>
    from pygls import lsp, protocol, server, uris, workspace
  File "c:\Users\Gustav\.vscode\extensions\ms-python.isort-2022.2.0\bundled\libs\pygls\lsp\__init__.py", line 23, in <module>
    from pygls.lsp.types import *
  File "c:\Users\Gustav\.vscode\extensions\ms-python.isort-2022.2.0\bundled\libs\pygls\lsp\types\__init__.py", line 6, in <module>
    from pygls.lsp.types.general_messages import *
  File "c:\Users\Gustav\.vscode\extensions\ms-python.isort-2022.2.0\bundled\libs\pygls\lsp\types\general_messages.py", line 35, in <module>
    from pygls.lsp.types.language_features import (CallHierarchyClientCapabilities,
  File "c:\Users\Gustav\.vscode\extensions\ms-python.isort-2022.2.0\bundled\libs\pygls\lsp\types\language_features\__init__.py", line 2, in <module>
    from pygls.lsp.types.language_features.call_hierarchy import *
  File "c:\Users\Gustav\.vscode\extensions\ms-python.isort-2022.2.0\bundled\libs\pygls\lsp\types\language_features\call_hierarchy.py", line 70, in <module>
    class CallHierarchyIncomingCall(Model):
  File "c:\Users\Gustav\.vscode\extensions\ms-python.isort-2022.2.0\bundled\libs\pydantic\main.py", line 369, in __new__
    cls.__signature__ = ClassAttribute('__signature__', generate_model_signature(cls.__init__, fields, config))
                                                        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "c:\Users\Gustav\.vscode\extensions\ms-python.isort-2022.2.0\bundled\libs\pydantic\utils.py", line 231, in generate_model_signature
    merged_params[param_name] = Parameter(
                                ^^^^^^^^^^
  File "C:\Users\Gustav\AppData\Local\Programs\Python\Python311\Lib\inspect.py", line 2715, in __init__
    raise ValueError('{!r} is not a valid parameter name'.format(name))
ValueError: 'from' is not a valid parameter name
[Info  - 14:38:35] Connection to server got closed. Server will restart.
Traceback (most recent call last):
  File "c:\Users\Gustav\.vscode\extensions\ms-python.isort-2022.2.0\bundled\formatter\format_server.py", line 20, in <module>
    from pygls import lsp, protocol, server, uris, workspace
  File "c:\Users\Gustav\.vscode\extensions\ms-python.isort-2022.2.0\bundled\libs\pygls\lsp\__init__.py", line 23, in <module>
    from pygls.lsp.types import *
  File "c:\Users\Gustav\.vscode\extensions\ms-python.isort-2022.2.0\bundled\libs\pygls\lsp\types\__init__.py", line 6, in <module>
    from pygls.lsp.types.general_messages import *
  File "c:\Users\Gustav\.vscode\extensions\ms-python.isort-2022.2.0\bundled\libs\pygls\lsp\types\general_messages.py", line 35, in <module>
    from pygls.lsp.types.language_features import (CallHierarchyClientCapabilities,
  File "c:\Users\Gustav\.vscode\extensions\ms-python.isort-2022.2.0\bundled\libs\pygls\lsp\types\language_features\__init__.py", line 2, in <module>
    from pygls.lsp.types.language_features.call_hierarchy import *
  File "c:\Users\Gustav\.vscode\extensions\ms-python.isort-2022.2.0\bundled\libs\pygls\lsp\types\language_features\call_hierarchy.py", line 70, in <module>
    class CallHierarchyIncomingCall(Model):
  File "c:\Users\Gustav\.vscode\extensions\ms-python.isort-2022.2.0\bundled\libs\pydantic\main.py", line 369, in __new__
    cls.__signature__ = ClassAttribute('__signature__', generate_model_signature(cls.__init__, fields, config))
                                                        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "c:\Users\Gustav\.vscode\extensions\ms-python.isort-2022.2.0\bundled\libs\pydantic\utils.py", line 231, in generate_model_signature
    merged_params[param_name] = Parameter(
                                ^^^^^^^^^^
  File "C:\Users\Gustav\AppData\Local\Programs\Python\Python311\Lib\inspect.py", line 2715, in __init__
    raise ValueError('{!r} is not a valid parameter name'.format(name))
ValueError: 'from' is not a valid parameter name
[Info  - 14:38:36] Connection to server got closed. Server will restart.
Traceback (most recent call last):
  File "c:\Users\Gustav\.vscode\extensions\ms-python.isort-2022.2.0\bundled\formatter\format_server.py", line 20, in <module>
    from pygls import lsp, protocol, server, uris, workspace
  File "c:\Users\Gustav\.vscode\extensions\ms-python.isort-2022.2.0\bundled\libs\pygls\lsp\__init__.py", line 23, in <module>
    from pygls.lsp.types import *
  File "c:\Users\Gustav\.vscode\extensions\ms-python.isort-2022.2.0\bundled\libs\pygls\lsp\types\__init__.py", line 6, in <module>
    from pygls.lsp.types.general_messages import *
  File "c:\Users\Gustav\.vscode\extensions\ms-python.isort-2022.2.0\bundled\libs\pygls\lsp\types\general_messages.py", line 35, in <module>
    from pygls.lsp.types.language_features import (CallHierarchyClientCapabilities,
  File "c:\Users\Gustav\.vscode\extensions\ms-python.isort-2022.2.0\bundled\libs\pygls\lsp\types\language_features\__init__.py", line 2, in <module>
    from pygls.lsp.types.language_features.call_hierarchy import *
  File "c:\Users\Gustav\.vscode\extensions\ms-python.isort-2022.2.0\bundled\libs\pygls\lsp\types\language_features\call_hierarchy.py", line 70, in <module>
    class CallHierarchyIncomingCall(Model):
  File "c:\Users\Gustav\.vscode\extensions\ms-python.isort-2022.2.0\bundled\libs\pydantic\main.py", line 369, in __new__
    cls.__signature__ = ClassAttribute('__signature__', generate_model_signature(cls.__init__, fields, config))
                                                        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "c:\Users\Gustav\.vscode\extensions\ms-python.isort-2022.2.0\bundled\libs\pydantic\utils.py", line 231, in generate_model_signature
    merged_params[param_name] = Parameter(
                                ^^^^^^^^^^
  File "C:\Users\Gustav\AppData\Local\Programs\Python\Python311\Lib\inspect.py", line 2715, in __init__
    raise ValueError('{!r} is not a valid parameter name'.format(name))
ValueError: 'from' is not a valid parameter name
[Error - 14:38:36] Connection to server got closed. Server will not be restarted.
Traceback (most recent call last):
  File "c:\Users\Gustav\.vscode\extensions\ms-python.isort-2022.2.0\bundled\formatter\format_server.py", line 20, in <module>
    from pygls import lsp, protocol, server, uris, workspace
  File "c:\Users\Gustav\.vscode\extensions\ms-python.isort-2022.2.0\bundled\libs\pygls\lsp\__init__.py", line 23, in <module>
    from pygls.lsp.types import *
  File "c:\Users\Gustav\.vscode\extensions\ms-python.isort-2022.2.0\bundled\libs\pygls\lsp\types\__init__.py", line 6, in <module>
    from pygls.lsp.types.general_messages import *
  File "c:\Users\Gustav\.vscode\extensions\ms-python.isort-2022.2.0\bundled\libs\pygls\lsp\types\general_messages.py", line 35, in <module>
    from pygls.lsp.types.language_features import (CallHierarchyClientCapabilities,
  File "c:\Users\Gustav\.vscode\extensions\ms-python.isort-2022.2.0\bundled\libs\pygls\lsp\types\language_features\__init__.py", line 2, in <module>
    from pygls.lsp.types.language_features.call_hierarchy import *
  File "c:\Users\Gustav\.vscode\extensions\ms-python.isort-2022.2.0\bundled\libs\pygls\lsp\types\language_features\call_hierarchy.py", line 70, in <module>
    class CallHierarchyIncomingCall(Model):
  File "c:\Users\Gustav\.vscode\extensions\ms-python.isort-2022.2.0\bundled\libs\pydantic\main.py", line 369, in __new__
    cls.__signature__ = ClassAttribute('__signature__', generate_model_signature(cls.__init__, fields, config))
                                                        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "c:\Users\Gustav\.vscode\extensions\ms-python.isort-2022.2.0\bundled\libs\pydantic\utils.py", line 231, in generate_model_signature
    merged_params[param_name] = Parameter(
                                ^^^^^^^^^^
  File "C:\Users\Gustav\AppData\Local\Programs\Python\Python311\Lib\inspect.py", line 2715, in __init__
    raise ValueError('{!r} is not a valid parameter name'.format(name))
ValueError: 'from' is not a valid parameter name
[Info  - 14:48:14] Connection to server got closed. Server will restart.
Traceback (most recent call last):
  File "c:\Users\Gustav\.vscode\extensions\ms-python.isort-2022.2.0\bundled\formatter\format_server.py", line 20, in <module>
    from pygls import lsp, protocol, server, uris, workspace
  File "c:\Users\Gustav\.vscode\extensions\ms-python.isort-2022.2.0\bundled\libs\pygls\lsp\__init__.py", line 23, in <module>
    from pygls.lsp.types import *
  File "c:\Users\Gustav\.vscode\extensions\ms-python.isort-2022.2.0\bundled\libs\pygls\lsp\types\__init__.py", line 6, in <module>
    from pygls.lsp.types.general_messages import *
  File "c:\Users\Gustav\.vscode\extensions\ms-python.isort-2022.2.0\bundled\libs\pygls\lsp\types\general_messages.py", line 35, in <module>
    from pygls.lsp.types.language_features import (CallHierarchyClientCapabilities,
  File "c:\Users\Gustav\.vscode\extensions\ms-python.isort-2022.2.0\bundled\libs\pygls\lsp\types\language_features\__init__.py", line 2, in <module>
    from pygls.lsp.types.language_features.call_hierarchy import *
  File "c:\Users\Gustav\.vscode\extensions\ms-python.isort-2022.2.0\bundled\libs\pygls\lsp\types\language_features\call_hierarchy.py", line 70, in <module>
    class CallHierarchyIncomingCall(Model):
  File "c:\Users\Gustav\.vscode\extensions\ms-python.isort-2022.2.0\bundled\libs\pydantic\main.py", line 369, in __new__
    cls.__signature__ = ClassAttribute('__signature__', generate_model_signature(cls.__init__, fields, config))
                                                        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "c:\Users\Gustav\.vscode\extensions\ms-python.isort-2022.2.0\bundled\libs\pydantic\utils.py", line 231, in generate_model_signature
    merged_params[param_name] = Parameter(
                                ^^^^^^^^^^
  File "C:\Users\Gustav\AppData\Local\Programs\Python\Python311\Lib\inspect.py", line 2715, in __init__
    raise ValueError('{!r} is not a valid parameter name'.format(name))
ValueError: 'from' is not a valid parameter name
[Info  - 14:48:14] Connection to server got closed. Server will restart.
Traceback (most recent call last):
  File "c:\Users\Gustav\.vscode\extensions\ms-python.isort-2022.2.0\bundled\formatter\format_server.py", line 20, in <module>
    from pygls import lsp, protocol, server, uris, workspace
  File "c:\Users\Gustav\.vscode\extensions\ms-python.isort-2022.2.0\bundled\libs\pygls\lsp\__init__.py", line 23, in <module>
    from pygls.lsp.types import *
  File "c:\Users\Gustav\.vscode\extensions\ms-python.isort-2022.2.0\bundled\libs\pygls\lsp\types\__init__.py", line 6, in <module>
    from pygls.lsp.types.general_messages import *
  File "c:\Users\Gustav\.vscode\extensions\ms-python.isort-2022.2.0\bundled\libs\pygls\lsp\types\general_messages.py", line 35, in <module>
    from pygls.lsp.types.language_features import (CallHierarchyClientCapabilities,
  File "c:\Users\Gustav\.vscode\extensions\ms-python.isort-2022.2.0\bundled\libs\pygls\lsp\types\language_features\__init__.py", line 2, in <module>
    from pygls.lsp.types.language_features.call_hierarchy import *
  File "c:\Users\Gustav\.vscode\extensions\ms-python.isort-2022.2.0\bundled\libs\pygls\lsp\types\language_features\call_hierarchy.py", line 70, in <module>
    class CallHierarchyIncomingCall(Model):
  File "c:\Users\Gustav\.vscode\extensions\ms-python.isort-2022.2.0\bundled\libs\pydantic\main.py", line 369, in __new__
    cls.__signature__ = ClassAttribute('__signature__', generate_model_signature(cls.__init__, fields, config))
                                                        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "c:\Users\Gustav\.vscode\extensions\ms-python.isort-2022.2.0\bundled\libs\pydantic\utils.py", line 231, in generate_model_signature
    merged_params[param_name] = Parameter(
                                ^^^^^^^^^^
  File "C:\Users\Gustav\AppData\Local\Programs\Python\Python311\Lib\inspect.py", line 2715, in __init__
    raise ValueError('{!r} is not a valid parameter name'.format(name))
ValueError: 'from' is not a valid parameter name
[Info  - 14:48:14] Connection to server got closed. Server will restart.
Traceback (most recent call last):
  File "c:\Users\Gustav\.vscode\extensions\ms-python.isort-2022.2.0\bundled\formatter\format_server.py", line 20, in <module>
    from pygls import lsp, protocol, server, uris, workspace
  File "c:\Users\Gustav\.vscode\extensions\ms-python.isort-2022.2.0\bundled\libs\pygls\lsp\__init__.py", line 23, in <module>
    from pygls.lsp.types import *
  File "c:\Users\Gustav\.vscode\extensions\ms-python.isort-2022.2.0\bundled\libs\pygls\lsp\types\__init__.py", line 6, in <module>
    from pygls.lsp.types.general_messages import *
  File "c:\Users\Gustav\.vscode\extensions\ms-python.isort-2022.2.0\bundled\libs\pygls\lsp\types\general_messages.py", line 35, in <module>
    from pygls.lsp.types.language_features import (CallHierarchyClientCapabilities,
  File "c:\Users\Gustav\.vscode\extensions\ms-python.isort-2022.2.0\bundled\libs\pygls\lsp\types\language_features\__init__.py", line 2, in <module>
    from pygls.lsp.types.language_features.call_hierarchy import *
  File "c:\Users\Gustav\.vscode\extensions\ms-python.isort-2022.2.0\bundled\libs\pygls\lsp\types\language_features\call_hierarchy.py", line 70, in <module>
    class CallHierarchyIncomingCall(Model):
  File "c:\Users\Gustav\.vscode\extensions\ms-python.isort-2022.2.0\bundled\libs\pydantic\main.py", line 369, in __new__
    cls.__signature__ = ClassAttribute('__signature__', generate_model_signature(cls.__init__, fields, config))
                                                        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "c:\Users\Gustav\.vscode\extensions\ms-python.isort-2022.2.0\bundled\libs\pydantic\utils.py", line 231, in generate_model_signature
    merged_params[param_name] = Parameter(
                                ^^^^^^^^^^
  File "C:\Users\Gustav\AppData\Local\Programs\Python\Python311\Lib\inspect.py", line 2715, in __init__
    raise ValueError('{!r} is not a valid parameter name'.format(name))
ValueError: 'from' is not a valid parameter name
[Info  - 14:48:14] Connection to server got closed. Server will restart.
Traceback (most recent call last):
  File "c:\Users\Gustav\.vscode\extensions\ms-python.isort-2022.2.0\bundled\formatter\format_server.py", line 20, in <module>
    from pygls import lsp, protocol, server, uris, workspace
  File "c:\Users\Gustav\.vscode\extensions\ms-python.isort-2022.2.0\bundled\libs\pygls\lsp\__init__.py", line 23, in <module>
    from pygls.lsp.types import *
  File "c:\Users\Gustav\.vscode\extensions\ms-python.isort-2022.2.0\bundled\libs\pygls\lsp\types\__init__.py", line 6, in <module>
    from pygls.lsp.types.general_messages import *
  File "c:\Users\Gustav\.vscode\extensions\ms-python.isort-2022.2.0\bundled\libs\pygls\lsp\types\general_messages.py", line 35, in <module>
    from pygls.lsp.types.language_features import (CallHierarchyClientCapabilities,
  File "c:\Users\Gustav\.vscode\extensions\ms-python.isort-2022.2.0\bundled\libs\pygls\lsp\types\language_features\__init__.py", line 2, in <module>
    from pygls.lsp.types.language_features.call_hierarchy import *
  File "c:\Users\Gustav\.vscode\extensions\ms-python.isort-2022.2.0\bundled\libs\pygls\lsp\types\language_features\call_hierarchy.py", line 70, in <module>
    class CallHierarchyIncomingCall(Model):
  File "c:\Users\Gustav\.vscode\extensions\ms-python.isort-2022.2.0\bundled\libs\pydantic\main.py", line 369, in __new__
    cls.__signature__ = ClassAttribute('__signature__', generate_model_signature(cls.__init__, fields, config))
                                                        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "c:\Users\Gustav\.vscode\extensions\ms-python.isort-2022.2.0\bundled\libs\pydantic\utils.py", line 231, in generate_model_signature
    merged_params[param_name] = Parameter(
                                ^^^^^^^^^^
  File "C:\Users\Gustav\AppData\Local\Programs\Python\Python311\Lib\inspect.py", line 2715, in __init__
    raise ValueError('{!r} is not a valid parameter name'.format(name))
ValueError: 'from' is not a valid parameter name
[Error - 14:48:15] Connection to server got closed. Server will not be restarted.

@karthiknadig
Copy link
Member

@pfmoore This looks like you are using python 3.11. It seems like pydantic is failing here. This should filed on pylgs which is where the error is occurring. Highly likely because of this: openlawlibrary/pygls#234

@pfmoore
Copy link
Author

pfmoore commented Aug 9, 2022

Thanks. Does this mean I need to go back to Python 3.10 for now? Assuming so, how would I know when a possible fix that I can test is released?

@karthiknadig karthiknadig changed the title The isort Formatter server crashed 5 times in the last 3 minutes. The server will not be restarted. isort formatter server crashes on 3.11 Aug 9, 2022
@karthiknadig
Copy link
Member

Yes you have to drop to 3.10. I will be leaving this issue open till the 3.11 gets resolved.

@pfmoore
Copy link
Author

pfmoore commented Aug 9, 2022

Great, thanks for the help.

@pfmoore
Copy link
Author

pfmoore commented Oct 24, 2022

With 3.11 being released in the next day or so, is there any progress on this? I know that the root cause is in pygls (I'll ping that issue too) but are you working on any short-term mitigation if pygls isn't ready?

If not, how do I disable the isort server until this gets fixed?

@karthiknadig
Copy link
Member

@pfmoore You should be able to disable the isort extension itself (see screen shot below) from the extensions view. Python core extension will detect that and use isort as it used to before. You may have to reload.
image

@HunterDG
Copy link

curious - what is the proper solution to mitigate this issue while developing in python 2.7 venv? Disable the extension as in screenshot above?

@karthiknadig
Copy link
Member

karthiknadig commented Nov 12, 2022

You have two options:
Option 1: Try the isort.interpreter setting. Set that to point to a python 3.7 or greater. This way, you can still use Python 2.7 venv to run your code, and isort extension will use python 3.7 to run the server.

Option 2: Downgrading the python extension to 2021.12.*. To do this you have to uninstall isort extension, then use the gear icon on the python extension to install older version. You can do this better in a dev-container. This will get to all the 2.7 support including debugging which is not supported in Option 1.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
triage-needed Issue is not triaged.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants