paiqo / Databricks-VSCode

VSCode extension to work with Databricks
GNU General Public License v3.0
121 stars 27 forks source link

After running some notebooks cells gives an error "TypeError: Cannot read properties of undefined (reading 'status')" #196

Open ktakanopy opened 1 month ago

ktakanopy commented 1 month ago

Describe the bug After running some notebooks cells gives an error "TypeError: Cannot read properties of undefined (reading 'status')"

To Reproduce Steps to reproduce the behavior:

  1. Download Databricks extension and databricks power tools
  2. Connect to a cluster
  3. Create a notebook.ipynb
  4. Run some cells in the notebook connected to a cluster.
  5. You will receive an error "TypeError: Cannot read properties of undefined (reading 'status')"

Screenshots Screenshot 2024-07-05 at 10 48 41

System information:

  1. MacOs Sonoma 14.5
  2. Databricks Extension Version: 1.3.1

Databricks Extension Logs

Additional context

kupalinka-lis commented 1 month ago

I have the same issue with the same system info

gbrueckl commented 1 month ago

Please check the logs under Outputs -> databricks.vscode and post the here (remove sensitive information if necessary)

Get Outlook for Androidhttps://aka.ms/AAb9ysg


From: Nika @.> Sent: Thursday, July 18, 2024 11:05:33 AM To: paiqo/Databricks-VSCode @.> Cc: Subscribed @.***> Subject: Re: [paiqo/Databricks-VSCode] After running some notebooks cells gives an error "TypeError: Cannot read properties of undefined (reading 'status')" (Issue #196)

I have the same issue with the same system info

— Reply to this email directly, view it on GitHubhttps://github.com/paiqo/Databricks-VSCode/issues/196#issuecomment-2236003329, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AC2VO4S4FBREVK5W3YB4TUDZM6AN3AVCNFSM6AAAAABLBPN4LWVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDEMZWGAYDGMZSHE. You are receiving this because you are subscribed to this thread.Message ID: @.***>

ktakanopy commented 1 month ago

Hi @gbrueckl here the logs (I think it's the correct, please tell me if not)

    at parseErrorFromResponse (/path/to/.vscode/extensions/databricks.databricks-1.3.1-darwin-x64/out/extension.js:1855:14)
    at fn (/path/to/.vscode/extensions/databricks.databricks-1.3.1-darwin-x64/out/extension.js:2386:63)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async retry3 (/path/to/.vscode/extensions/databricks.databricks-1.3.1-darwin-x64/out/extension.js:1735:20)
    at async ApiClient8.request (/path/to/.vscode/extensions/databricks.databricks-1.3.1-darwin-x64/out/extension.js:2362:26)
    at async ClustersService._get (/path/to/.vscode/extensions/databricks.databricks-1.3.1-darwin-x64/out/extension.js:27967:16)
    at async ClustersService.get (/path/to/.vscode/extensions/databricks.databricks-1.3.1-darwin-x64/out/extension.js:27978:32)
    at async _Cluster.refresh (/path/to/.vscode/extensions/databricks.databricks-1.3.1-darwin-x64/out/extension.js:116965:20)
    at async Timeout._onTimeout (/path/to/.vscode/extensions/databricks.databricks-1.3.1-darwin-x64/out/extension.js:119248:7)
gbrueckl commented 1 month ago

so the error message you posted comes from the original Databricks extension [databricks.databricks](https://marketplace.visualstudio.com/items?itemName=databricks.databricks) and is not related to this extension. Can you check which Kernel you are using for your Notebook?

the logs related to this extension can be found here: image

rgalljamov commented 1 month ago

I have the same issue on Windows and get the following logs (@gbrueckl, thank you for explaining where to find the right logs):

POST 1.2/commands/execute --> {"clusterId":"0326-150543-8brhnzrc","language":"python","contextId":"2674181048795868090","command":"import numpy as np\n\nimport matplotlib.pyplot as plt\n\n# %matplotlib inline\n\n# Generate random values\nx = np.random.rand(1000)\ny = np.random.rand(1000)\n\n# Create scatter plot\nplt.scatter(x, y, alpha=0.0125)\n\n# Add labels and title\nplt.xlabel('X')\nplt.ylabel('Y')\nplt.title('Random Scatter Plot')\n\n# Display the plot\nplt.show()"}
Response: {"error_code":403,"message":"JWT has expired"} ...
GET 1.2/commands/status --> {"clusterId":"0326-150543-8brhnzrc","contextId":"2674181048795868090"}
GET 1.2/commands/status failed! ERROR: " (403) Forbidden
ERROR: Error - Forbidden

It always happens when you pause programming for some time and come back later. Restarting VS Code solves the issue, but it would be great if the restart wouldn't be required.

Thank you for the great extension and in advance for the support.

gbrueckl commented 1 month ago

@rgalljamov so this error is related to this extension and i can have a look. its basically complaining about an expired JWT token which I guess comes from the OAuth that used behind the scenes. You are using the Azure Connection Manager, right?

the token probably expires after 1 hour and we dont have any refresh in place yet as this only happens for the Azure Connection Manager but we should be able to fix this :)

rgalljamov commented 1 month ago

Thank you very much for the swift reply and support @gbrueckl!

I'm using the official Databricks Extension in the newest version and OAuth U2M authentification. Therefore, your extension worked right away after installation, which was a great positive surprise. The expiration duration might be below an hour but I have not tested it yet.

kupalinka-lis commented 1 month ago

Just checked the error logs - I have the same JWT issue

Response: {"error_code":403,"message":"JWT has expired"} ...
GET 1.2/commands/status --> {"clusterId":"...","contextId":"..."}
GET 1.2/commands/status failed! ERROR: " (403) Forbidden
ERROR: Error - Forbidden

Thanks for looking on it!

sreekanth9999 commented 3 weeks ago

were anyone able to fix this issue?

gbrueckl commented 3 days ago

I just published v2.3.5 to the marketplace which should hopefully fix this issue we are now updating the JWT token every 30 minutes