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

Sphinx agent not sending dbpath #732

Open
alcarney opened this issue Feb 15, 2024 · 1 comment
Open

Sphinx agent not sending dbpath #732

alcarney opened this issue Feb 15, 2024 · 1 comment
Labels
bug Something isn't working lsp Issues that relate to the language server
Milestone

Comments

@alcarney
Copy link
Member

As reported in #440 (comment)

Python 3.12, sphinx 7.2.6, esbonio 0.92.1

[client] Starting Language Server
[esbonio] Initialising esbonio v1.0.0b1
[esbonio] Language client: Visual Studio Code 1.86.2
Running Sphinx v7.2.6
Unable to deserialize message
  + Exception Group Traceback (most recent call last):
  |   File "/Users/xxxxxx/.vscode/extensions/swyddfa.esbonio-0.92.1/bundled/libs/pygls/protocol/json_rpc.py", line 335, in _deserialize_message
  |     return self._converter.structure(data, response_type)
  |            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  |   File "/Users/xxxxxx/.vscode/extensions/swyddfa.esbonio-0.92.1/bundled/libs/cattrs/converters.py", line 332, in structure
  |     return self._structure_func.dispatch(cl)(obj, cl)
  |            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  |   File "<cattrs generated structure esbonio.sphinx_agent.types.CreateApplicationResponse>", line 20, in structure_CreateApplicationResponse
  |     if errors: raise __c_cve('While structuring ' + 'CreateApplicationResponse', errors, __cl)
  |                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  | cattrs.errors.ClassValidationError: While structuring CreateApplicationResponse (1 sub-exception)
  +-+---------------- 1 ----------------
    | Exception Group Traceback (most recent call last):
    |   File "<cattrs generated structure esbonio.sphinx_agent.types.CreateApplicationResponse>", line 10, in structure_CreateApplicationResponse
    |     res['result'] = __c_structure_result(o['result'], __c_type_result)
    |                      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    |   File "<cattrs generated structure esbonio.sphinx_agent.types.SphinxInfo>", line 39, in structure_SphinxInfo
    |     if errors: raise __c_cve('While structuring ' + 'SphinxInfo', errors, __cl)
    |                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    | cattrs.errors.ClassValidationError: While structuring SphinxInfo (1 sub-exception)
    | Structuring class CreateApplicationResponse @ attribute result
    +-+---------------- 1 ----------------
      | Traceback (most recent call last):
      |   File "<cattrs generated structure esbonio.sphinx_agent.types.SphinxInfo>", line 35, in structure_SphinxInfo
      |     res['dbpath'] = __c_structure_dbpath(o['dbpath'])
      |                                           ~^^^^^^^^^^
      | KeyError: 'dbpath'
      | Structuring class SphinxInfo @ attribute dbpath
      +------------------------------------
@alcarney alcarney added bug Something isn't working lsp Issues that relate to the language server labels Feb 15, 2024
@alcarney alcarney added this to the 1.0 milestone Feb 15, 2024
@lextm
Copy link
Contributor

lextm commented Feb 17, 2024

I'd like to report something interesting. While preparing #735 I notice that when Python 3.12 is used for virtual environment, esbonio works flawlessly. A similar error occurs as soon as switching to Python 3.8.

The log entries from Python 3.8 is,

Running Sphinx v5.3.0
loading pickled environment...
done
Unable to deserialize message
  + Exception Group Traceback (most recent call last):
  |   File "/Users/lextm/.vscode/extensions/swyddfa.esbonio-0.92.1/bundled/libs/pygls/protocol/json_rpc.py", line 335, in _deserialize_message
  |     return self._converter.structure(data, response_type)
  |   File "/Users/lextm/.vscode/extensions/swyddfa.esbonio-0.92.1/bundled/libs/cattrs/converters.py", line 332, in structure
  |     return self._structure_func.dispatch(cl)(obj, cl)
  |   File "<cattrs generated structure esbonio.sphinx_agent.types.CreateApplicationResponse>", line 20, in structure_CreateApplicationResponse
  |     if errors: raise __c_cve('While structuring ' + 'CreateApplicationResponse', errors, __cl)
  | cattrs.errors.ClassValidationError: While structuring CreateApplicationResponse (1 sub-exception)
  +-+---------------- 1 ----------------
    | Exception Group Traceback (most recent call last):
    |   File "<cattrs generated structure esbonio.sphinx_agent.types.CreateApplicationResponse>", line 10, in structure_CreateApplicationResponse
    |     res['result'] = __c_structure_result(o['result'], __c_type_result)
    |   File "<cattrs generated structure esbonio.sphinx_agent.types.SphinxInfo>", line 39, in structure_SphinxInfo
    |     if errors: raise __c_cve('While structuring ' + 'SphinxInfo', errors, __cl)
    | cattrs.errors.ClassValidationError: While structuring SphinxInfo (1 sub-exception)
    | Structuring class CreateApplicationResponse @ attribute result
    +-+---------------- 1 ----------------
      | Traceback (most recent call last):
      |   File "<cattrs generated structure esbonio.sphinx_agent.types.SphinxInfo>", line 35, in structure_SphinxInfo
      |     res['dbpath'] = __c_structure_dbpath(o['dbpath'])
      | KeyError: 'dbpath'
      | Structuring class SphinxInfo @ attribute dbpath
      +------------------------------------

Error receiving data
  + Exception Group Traceback (most recent call last):
  |   File "/Users/lextm/.vscode/extensions/swyddfa.esbonio-0.92.1/bundled/libs/pygls/protocol/json_rpc.py", line 335, in _deserialize_message
  |     return self._converter.structure(data, response_type)
  |   File "/Users/lextm/.vscode/extensions/swyddfa.esbonio-0.92.1/bundled/libs/cattrs/converters.py", line 332, in structure
  |     return self._structure_func.dispatch(cl)(obj, cl)
  |   File "<cattrs generated structure esbonio.sphinx_agent.types.CreateApplicationResponse>", line 20, in structure_CreateApplicationResponse
  |     if errors: raise __c_cve('While structuring ' + 'CreateApplicationResponse', errors, __cl)
  | cattrs.errors.ClassValidationError: While structuring CreateApplicationResponse (1 sub-exception)
  +-+---------------- 1 ----------------
    | Exception Group Traceback (most recent call last):
    |   File "<cattrs generated structure esbonio.sphinx_agent.types.CreateApplicationResponse>", line 10, in structure_CreateApplicationResponse
    |     res['result'] = __c_structure_result(o['result'], __c_type_result)
    |   File "<cattrs generated structure esbonio.sphinx_agent.types.SphinxInfo>", line 39, in structure_SphinxInfo
    |     if errors: raise __c_cve('While structuring ' + 'SphinxInfo', errors, __cl)
    | cattrs.errors.ClassValidationError: While structuring SphinxInfo (1 sub-exception)
    | Structuring class CreateApplicationResponse @ attribute result
    +-+---------------- 1 ----------------
      | Traceback (most recent call last):
      |   File "<cattrs generated structure esbonio.sphinx_agent.types.SphinxInfo>", line 35, in structure_SphinxInfo
      |     res['dbpath'] = __c_structure_dbpath(o['dbpath'])
      | KeyError: 'dbpath'
      | Structuring class SphinxInfo @ attribute dbpath
      +------------------------------------

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/Users/lextm/.vscode/extensions/swyddfa.esbonio-0.92.1/bundled/libs/pygls/protocol/json_rpc.py", line 443, in data_received
    self._data_received(data)
  File "/Users/lextm/.vscode/extensions/swyddfa.esbonio-0.92.1/bundled/libs/pygls/protocol/json_rpc.py", line 475, in _data_received
    json.loads(
  File "/Users/lextm/.pyenv/versions/3.8.16/lib/python3.8/json/__init__.py", line 370, in loads
    return cls(**kw).decode(s)
  File "/Users/lextm/.pyenv/versions/3.8.16/lib/python3.8/json/decoder.py", line 337, in decode
    obj, end = self.raw_decode(s, idx=_w(s, 0).end())
  File "/Users/lextm/.pyenv/versions/3.8.16/lib/python3.8/json/decoder.py", line 353, in raw_decode
    obj, end = self.scan_once(s, idx)
  File "/Users/lextm/.vscode/extensions/swyddfa.esbonio-0.92.1/bundled/libs/pygls/protocol/json_rpc.py", line 344, in _deserialize_message
    raise JsonRpcInvalidParams() from exc
pygls.exceptions.JsonRpcInvalidParams: Invalid Params

The Git repo is https://github.com/lextudio/pysnmp.

So it might be the same issue or just another.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working lsp Issues that relate to the language server
Projects
Status: Todo
Development

No branches or pull requests

2 participants