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

Crashes in VS Code due to Pydantic Validation Error #963

Open
sohang3112 opened this issue Feb 23, 2023 · 2 comments
Open

Crashes in VS Code due to Pydantic Validation Error #963

sohang3112 opened this issue Feb 23, 2023 · 2 comments

Comments

@sohang3112
Copy link

Python Language Server keeps crashing in VS Code due to a Pydantic Validation Error. See the full error trackeback output below:

Traceback (most recent call last):
  File "c:\Users\SohangChopra\.vscode\extensions\ms-python.python-2023.2.0\pythonFiles\lib\jedilsp\pygls\protocol.py", line 152, in deserialize_message
    deserialize_params(data, get_params_type)
  File "c:\Users\SohangChopra\.vscode\extensions\ms-python.python-2023.2.0\pythonFiles\lib\jedilsp\pygls\protocol.py", line 138, in deserialize_params
    data['params'] = params_type(**params)
  File "c:\Users\SohangChopra\.vscode\extensions\ms-python.python-2023.2.0\pythonFiles\lib\jedilsp\pygls\lsp\types\basic_structures.py", line 58, in __init__
    super().__init__(**data)
  File "c:\Users\SohangChopra\.vscode\extensions\ms-python.python-2023.2.0\pythonFiles\lib\jedilsp\pydantic\main.py", line 342, in __init__
    raise validation_error
pydantic.error_wrappers.ValidationError: 6 validation errors for CodeActionParams
context -> diagnostics -> 0 -> range -> start -> line
  none is not an allowed value (type=type_error.none.not_allowed)
context -> diagnostics -> 0 -> range -> end -> line
  none is not an allowed value (type=type_error.none.not_allowed)
context -> diagnostics -> 1 -> range -> start -> line
  none is not an allowed value (type=type_error.none.not_allowed)
context -> diagnostics -> 1 -> range -> end -> line
  none is not an allowed value (type=type_error.none.not_allowed)
context -> diagnostics -> 2 -> range -> start -> line
  none is not an allowed value (type=type_error.none.not_allowed)
context -> diagnostics -> 2 -> range -> end -> line
  none is not an allowed value (type=type_error.none.not_allowed)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "c:\Users\SohangChopra\.vscode\extensions\ms-python.python-2023.2.0\pythonFiles\run-jedi-language-server.py", line 11, in <module>
    sys.exit(cli())
  File "c:\Users\SohangChopra\.vscode\extensions\ms-python.python-2023.2.0\pythonFiles\lib\jedilsp\jedi_language_server\cli.py", line 125, in cli
    SERVER.start_io()
  File "c:\Users\SohangChopra\.vscode\extensions\ms-python.python-2023.2.0\pythonFiles\lib\jedilsp\pygls\server.py", line 225, in start_io
    self.loop.run_until_complete(
  File "C:\Users\SohangChopra\AppData\Local\Programs\Python\Python310\lib\asyncio\base_events.py", line 641, in run_until_complete
    return future.result()
  File "c:\Users\SohangChopra\.vscode\extensions\ms-python.python-2023.2.0\pythonFiles\lib\jedilsp\pygls\server.py", line 78, in aio_readline
    proxy(b''.join(message))
  File "c:\Users\SohangChopra\.vscode\extensions\ms-python.python-2023.2.0\pythonFiles\lib\jedilsp\pygls\protocol.py", line 456, in data_received
    json.loads(body.decode(self.CHARSET),
  File "C:\Users\SohangChopra\AppData\Local\Programs\Python\Python310\lib\json\__init__.py", line 359, in loads
    return cls(**kw).decode(s)
  File "C:\Users\SohangChopra\AppData\Local\Programs\Python\Python310\lib\json\decoder.py", line 337, in decode
    obj, end = self.raw_decode(s, idx=_w(s, 0).end())
  File "C:\Users\SohangChopra\AppData\Local\Programs\Python\Python310\lib\json\decoder.py", line 353, in raw_decode
    obj, end = self.scan_once(s, idx)
  File "c:\Users\SohangChopra\.vscode\extensions\ms-python.python-2023.2.0\pythonFiles\lib\jedilsp\pygls\protocol.py", line 154, in deserialize_message
    raise JsonRpcInvalidParams()
pygls.exceptions.JsonRpcInvalidParams: Invalid Params
[Info  - 6:16:31 PM] Connection to server got closed. Server will restart.
WARNING:pygls.protocol:Cancel notification for unknown message id "2"
WARNING:pygls.protocol:Cancel notification for unknown message id "15"
@sohang3112
Copy link
Author

@palantirtech Do you have any idea why this issue could have occurred?

1 similar comment
@sohang3112
Copy link
Author

@palantirtech Do you have any idea why this issue could have occurred?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant