kedro-org / vscode-kedro

Kedro extension for VSCode including LSP and other features
https://marketplace.visualstudio.com/items?itemName=kedro.Kedro
Apache License 2.0
11 stars 2 forks source link

Some startup errors #7

Closed astrojuanlu closed 1 month ago

astrojuanlu commented 1 month ago

Spotting this right after opening the editor:

2024-05-09 08:20:40.738 [info] Exception occurred in notification: "UnboundLocalError: cannot access local variable 'project_metadata' where it is not associated with a value"
Traceback (most recent call last):
  File "/Users/juan_cano/.vscode/extensions/kedro.kedro-0.0.1/bundled/tool/lsp_server.py", line 171, in _set_project_with_workspace
    project_metadata = bootstrap_project(root_path)
                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/juan_cano/Projects/QuantumBlackLabs/kedro-mlflow-playground/spaceflights-mlflow3/.venv/lib/python3.11/site-packages/kedro/framework/startup.py", line 156, in bootstrap_project
    configure_project(metadata.package_name)
  File "/Users/juan_cano/Projects/QuantumBlackLabs/kedro-mlflow-playground/spaceflights-mlflow3/.venv/lib/python3.11/site-packages/kedro/framework/project/__init__.py", line 269, in configure_project
    LOGGING.set_project_logging(PACKAGE_NAME)
  File "/Users/juan_cano/Projects/QuantumBlackLabs/kedro-mlflow-playground/spaceflights-mlflow3/.venv/lib/python3.11/site-packages/kedro/framework/project/__init__.py", line 238, in set_project_logging
    if package_name not in self.data["loggers"]:
                           ~~~~~~~~~^^^^^^^^^^^
KeyError: 'loggers'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/Users/juan_cano/.vscode/extensions/kedro.kedro-0.0.1/bundled/libs/pygls/protocol/json_rpc.py", line 159, in _execute_notification_callback
    raise future.exception()
  File "/Users/juan_cano/.vscode/extensions/kedro.kedro-0.0.1/bundled/tool/lsp_server.py", line 240, in initialize
    _check_project()
  File "/Users/juan_cano/.vscode/extensions/kedro.kedro-0.0.1/bundled/tool/lsp_server.py", line 290, in _check_project
    LSP_SERVER._set_project_with_workspace()
  File "/Users/juan_cano/.vscode/extensions/kedro.kedro-0.0.1/bundled/tool/lsp_server.py", line 185, in _set_project_with_workspace
    self.project_metadata = project_metadata
                            ^^^^^^^^^^^^^^^^
UnboundLocalError: cannot access local variable 'project_metadata' where it is not associated with a value
Full logs: ``` 2024-05-09 08:20:39.218 [info] Name: Kedro 2024-05-09 08:20:39.218 [info] Module: kedro 2024-05-09 08:20:39.218 [info] Python extension loading 2024-05-09 08:20:39.218 [info] Python Interpreter: 2024-05-09 08:20:39.218 [info] Waiting for interpreter from python extension. 2024-05-09 08:20:39.218 [info] Python extension loaded 2024-05-09 08:20:39.218 [info] Server run command: /Users/juan_cano/Projects/QuantumBlackLabs/kedro-mlflow-playground/spaceflights-mlflow3/.venv/bin/python /Users/juan_cano/.vscode/extensions/kedro.kedro-0.0.1/bundled/tool/lsp_server.py 2024-05-09 08:20:39.218 [info] Server: Start requested. 2024-05-09 08:20:39.608 [info] /Users/juan_cano/.vscode/extensions/kedro.kedro-0.0.1/bundled/tool/lsp_server.py:34: DeprecationWarning: The 'warn' method is deprecated, use 'warning' instead logger.warn(f"{before_update_path=}") 2024-05-09 08:20:39.608 [info] before_update_path=['/Users/juan_cano/.vscode/extensions/kedro.kedro-0.0.1/bundled/tool', '/opt/homebrew/Cellar/python@3.11/3.11.5/Frameworks/Python.framework/Versions/3.11/lib/python311.zip', '/opt/homebrew/Cellar/python@3.11/3.11.5/Frameworks/Python.framework/Versions/3.11/lib/python3.11', '/opt/homebrew/Cellar/python@3.11/3.11.5/Frameworks/Python.framework/Versions/3.11/lib/python3.11/lib-dynload', '/Users/juan_cano/Projects/QuantumBlackLabs/kedro-mlflow-playground/spaceflights-mlflow3/.venv/lib/python3.11/site-packages'] /Users/juan_cano/.vscode/extensions/kedro.kedro-0.0.1/bundled/tool/lsp_server.py:35: DeprecationWarning: The 'warn' method is deprecated, use 'warning' instead logger.warn(f"{after_update_path=}") after_update_path=['/Users/juan_cano/.vscode/extensions/kedro.kedro-0.0.1/bundled/libs', '/Users/juan_cano/.vscode/extensions/kedro.kedro-0.0.1/bundled/tool', '/opt/homebrew/Cellar/python@3.11/3.11.5/Frameworks/Python.framework/Versions/3.11/lib/python311.zip', '/opt/homebrew/Cellar/python@3.11/3.11.5/Frameworks/Python.framework/Versions/3.11/lib/python3.11', '/opt/homebrew/Cellar/python@3.11/3.11.5/Frameworks/Python.framework/Versions/3.11/lib/python3.11/lib-dynload', '/Users/juan_cano/Projects/QuantumBlackLabs/kedro-mlflow-playground/spaceflights-mlflow3/.venv/lib/python3.11/site-packages'] 2024-05-09 08:20:40.306 [info] [Trace - 08:20:40] Received notification 'window/logMessage'. 2024-05-09 08:20:40.306 [info] CWD Server: /Users/juan_cano/Projects/QuantumBlackLabs/kedro-mlflow-playground/spaceflights-mlflow3 2024-05-09 08:20:40.306 [info] [Trace - 08:20:40] Received notification 'window/logMessage'. 2024-05-09 08:20:40.306 [info] sys.path used to run Server: /Users/juan_cano/.vscode/extensions/kedro.kedro-0.0.1/bundled/libs /Users/juan_cano/.vscode/extensions/kedro.kedro-0.0.1/bundled/tool /opt/homebrew/Cellar/python@3.11/3.11.5/Frameworks/Python.framework/Versions/3.11/lib/python311.zip /opt/homebrew/Cellar/python@3.11/3.11.5/Frameworks/Python.framework/Versions/3.11/lib/python3.11 /opt/homebrew/Cellar/python@3.11/3.11.5/Frameworks/Python.framework/Versions/3.11/lib/python3.11/lib-dynload /Users/juan_cano/Projects/QuantumBlackLabs/kedro-mlflow-playground/spaceflights-mlflow3/.venv/lib/python3.11/site-packages 2024-05-09 08:20:40.306 [info] [Trace - 08:20:40] Received notification 'window/logMessage'. 2024-05-09 08:20:40.306 [info] Settings used to run Server: [ { "cwd": "/Users/juan_cano/Projects/QuantumBlackLabs/kedro-mlflow-playground/spaceflights-mlflow3", "workspace": "file:///Users/juan_cano/Projects/QuantumBlackLabs/kedro-mlflow-playground/spaceflights-mlflow3", "args": [], "path": [], "interpreter": [ "/Users/juan_cano/Projects/QuantumBlackLabs/kedro-mlflow-playground/spaceflights-mlflow3/.venv/bin/python" ], "importStrategy": "useBundled", "showNotifications": "off", "isExperimental": "yes" } ] 2024-05-09 08:20:40.307 [info] [Trace - 08:20:40] Received notification 'window/logMessage'. 2024-05-09 08:20:40.307 [info] Global settings: { "cwd": "/", "workspace": "/", "args": [], "path": [], "interpreter": [], "importStrategy": "useBundled", "showNotifications": "off", "isExperimental": "yes" } 2024-05-09 08:20:40.307 [info] [Trace - 08:20:40] Received notification 'window/logMessage'. 2024-05-09 08:20:40.307 [info] Workspace settings: { "/Users/juan_cano/Projects/QuantumBlackLabs/kedro-mlflow-playground/spaceflights-mlflow3": { "cwd": "/Users/juan_cano/Projects/QuantumBlackLabs/kedro-mlflow-playground/spaceflights-mlflow3", "workspace": "file:///Users/juan_cano/Projects/QuantumBlackLabs/kedro-mlflow-playground/spaceflights-mlflow3", "args": [], "path": [], "interpreter": [ "/Users/juan_cano/Projects/QuantumBlackLabs/kedro-mlflow-playground/spaceflights-mlflow3/.venv/bin/python" ], "importStrategy": "useBundled", "showNotifications": "off", "isExperimental": "yes", "workspaceFS": "/Users/juan_cano/Projects/QuantumBlackLabs/kedro-mlflow-playground/spaceflights-mlflow3" } } 2024-05-09 08:20:40.738 [info] Exception occurred in notification: "UnboundLocalError: cannot access local variable 'project_metadata' where it is not associated with a value" Traceback (most recent call last): File "/Users/juan_cano/.vscode/extensions/kedro.kedro-0.0.1/bundled/tool/lsp_server.py", line 171, in _set_project_with_workspace project_metadata = bootstrap_project(root_path) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/Users/juan_cano/Projects/QuantumBlackLabs/kedro-mlflow-playground/spaceflights-mlflow3/.venv/lib/python3.11/site-packages/kedro/framework/startup.py", line 156, in bootstrap_project configure_project(metadata.package_name) File "/Users/juan_cano/Projects/QuantumBlackLabs/kedro-mlflow-playground/spaceflights-mlflow3/.venv/lib/python3.11/site-packages/kedro/framework/project/__init__.py", line 269, in configure_project LOGGING.set_project_logging(PACKAGE_NAME) File "/Users/juan_cano/Projects/QuantumBlackLabs/kedro-mlflow-playground/spaceflights-mlflow3/.venv/lib/python3.11/site-packages/kedro/framework/project/__init__.py", line 238, in set_project_logging if package_name not in self.data["loggers"]: ~~~~~~~~~^^^^^^^^^^^ KeyError: 'loggers' During handling of the above exception, another exception occurred: Traceback (most recent call last): File "/Users/juan_cano/.vscode/extensions/kedro.kedro-0.0.1/bundled/libs/pygls/protocol/json_rpc.py", line 159, in _execute_notification_callback raise future.exception() File "/Users/juan_cano/.vscode/extensions/kedro.kedro-0.0.1/bundled/tool/lsp_server.py", line 240, in initialize _check_project() File "/Users/juan_cano/.vscode/extensions/kedro.kedro-0.0.1/bundled/tool/lsp_server.py", line 290, in _check_project LSP_SERVER._set_project_with_workspace() File "/Users/juan_cano/.vscode/extensions/kedro.kedro-0.0.1/bundled/tool/lsp_server.py", line 185, in _set_project_with_workspace self.project_metadata = project_metadata ^^^^^^^^^^^^^^^^ UnboundLocalError: cannot access local variable 'project_metadata' where it is not associated with a value ```
noklam commented 1 month ago

Again, are you able to kedro run this project with the same environment? Can you provide the steps to reproduce this error?

astrojuanlu commented 1 month ago
  1. kedro new --starter=spaceflights-pandas-viz --name test-kedro-vscode && cd test-kedro-vscode
  2. uv venv && uv pip install -r requirements.txt
  3. Set interpreter
  4. Verify that kedro run works
  5. Close IDE (just in case)
  6. Open it again. See the startup errors in the "Output" tab immediately.
astrojuanlu commented 1 month ago

Just in case I did uv pip uninstall kedro-telemetry, still same issue.

noklam commented 1 month ago

I release 0.0.2, please install it in a few minutes see if this persist.

p.s. updated, it's out now. image

astrojuanlu commented 1 month ago

I don't see startup errors anymore 👏🏼