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

3 prompts to cancel loading a widget if CDNs are disabled #10618

Closed
amunger opened this issue Jun 28, 2022 · 5 comments · Fixed by #10678
Closed

3 prompts to cancel loading a widget if CDNs are disabled #10618

amunger opened this issue Jun 28, 2022 · 5 comments · Fixed by #10678
Assignees
Labels
bug Issue identified by VS Code Team member as probable bug ipywidgets Rendering, loading, saving, anything to do with IPyWidgets verified Verification succeeded
Milestone

Comments

@amunger
Copy link
Contributor

amunger commented Jun 28, 2022

Testing #10598
set "jupyter.widgetScriptSources": [] in settings to not allow widget downloads
Run a cell with a widget

Two of the samples from the test plan still load and are interactive after pressing cancel on a single pop-up

When running the code below, I have to press cancel 3 times, and then end up with a loading... widget

Widgets require us to download supporting files from a 3rd party website.

Widgets require us to download supporting files from a 3rd party website. (Error loading k3d:2.14.2).

Widgets require us to download supporting files from a 3rd party website. (Error loading k3d:2.14.2).

# Sample2
import k3d
import numpy as np
from numpy import sin,cos,pi
from ipywidgets import interact, interactive, fixed
import ipywidgets as widgets
import time
import math

plot = k3d.plot()

plot.camera_auto_fit = False

T = 1.618033988749895
r = 4.77
zmin,zmax = -r,r
xmin,xmax = -r,r
ymin,ymax = -r,r
Nx,Ny,Nz = 77,77,77

x = np.linspace(xmin,xmax,Nx)
y = np.linspace(ymin,ymax,Ny)
z = np.linspace(zmin,zmax,Nz)
x,y,z = np.meshgrid(x,y,z,indexing='ij')
p = 2 - (cos(x + T*y) + cos(x - T*y) + cos(y + T*z) + cos(y - T*z) + cos(z - T*x) + cos(z + T*x))
iso = k3d.marching_cubes(p.astype(np.float32),xmin=xmin,xmax=xmax,ymin=ymin,ymax=ymax, zmin=zmin, zmax=zmax, level=0.0)
plot += iso

plot.display()

@github-actions github-actions bot added the triage-needed Issue needs to be triaged label Jun 28, 2022
@DonJayamanne
Copy link
Contributor

@amunger
Sorry, I'm unable to repro this, please could you provide the exact steps (starting from when you have reloaded vscode)

@DonJayamanne DonJayamanne added info-needed Issue requires more information from poster ipywidgets Rendering, loading, saving, anything to do with IPyWidgets bug Issue identified by VS Code Team member as probable bug labels Jun 28, 2022
@DonJayamanne
Copy link
Contributor

Note: this would be an existing issue

@amunger
Copy link
Contributor Author

amunger commented Jun 28, 2022

  1. open/reload vscode
  2. create a new notebook
  3. select a kernel that has all the required package installed to run the code below
  4. paste in the code and run, selecting cancel on all prompts
# Sample2
import k3d
import numpy as np
from numpy import sin,cos,pi
from ipywidgets import interact, interactive, fixed
import ipywidgets as widgets
import time
import math

plot = k3d.plot()

plot.camera_auto_fit = False

T = 1.618033988749895
r = 4.77
zmin,zmax = -r,r
xmin,xmax = -r,r
ymin,ymax = -r,r
Nx,Ny,Nz = 77,77,77

x = np.linspace(xmin,xmax,Nx)
y = np.linspace(ymin,ymax,Ny)
z = np.linspace(zmin,zmax,Nz)
x,y,z = np.meshgrid(x,y,z,indexing='ij')
p = 2 - (cos(x + T*y) + cos(x - T*y) + cos(y + T*z) + cos(y - T*z) + cos(z - T*x) + cos(z + T*x))
iso = k3d.marching_cubes(p.astype(np.float32),xmin=xmin,xmax=xmax,ymin=ymin,ymax=ymax, zmin=zmin, zmax=zmax, level=0.0)
plot += iso

plot.display()

@DonJayamanne
Copy link
Contributor

DonJayamanne commented Jun 28, 2022

set "jupyter.widgetScriptSources": [] in settings to not allow widget downloads

When was this changed int he above steps?
Also, I'm assuming you are using a local kernel, is that right?
Also, please could you provide the output from the Jupyter output panel.

Thanks

@amunger
Copy link
Contributor Author

amunger commented Jun 28, 2022

jupyter logs
Visual Studio Code - Insiders (1.69.0-insider, undefined, desktop)
Jupyter Extension Version: 2022.6.1001811740.
Python Extension Version: 2022.9.11791004.
Workspace folder c:\src\test\3
info 15:53:58.312: ZMQ install verified.
User belongs to experiment group 'jupyterTest'
User belongs to experiment group 'jupyterEnhancedDataViewer'
info 15:53:58.940: LSP Notebooks experiment is disabled -- not in treatment group
info 15:53:59.148: Starting Jupyter Session id = 'startUsingPythonInterpreter:.jvsc74a57bd02a8bb579a3d276ed5ddfe14b8685f1986e420a0f5c411ab8f05c20e26ae95962.c:\src\test\3\.venv7\Scripts\python.exe.c:\src\test\3\.venv7\Scripts\python.exe.-m#ipykernel_launcher' (Python Path: c:\src\test\3\.venv7, EnvType: Venv, EnvName: '.venv7', Version: 3.9.13) for 'Untitled-1.ipynb' (disableUI=true)
info 15:53:59.150: Creating raw notebook for resource 'Untitled-1.ipynb'
info 15:53:59.150: Computing working directory for resource 'Untitled-1.ipynb'
info 15:53:59.163: Starting raw kernel '.venv7 (Python 3.9.13)' for interpreter c:\src\test\3\.venv7\Scripts\python.exe
info 15:53:59.512: Kernel launching with ports 9000,9001,9002,9003,9004. Start port is 9000
info 15:53:59.579: Process Execution: > c:\src\test\3\.venv7\Scripts\python.exe -m pip list
> c:\src\test\3\.venv7\Scripts\python.exe -m pip list
info 15:53:59.594: Process Execution: > c:\src\test\3\.venv7\Scripts\python.exe -c "import ipykernel; print(ipykernel.__version__); print("5dc3a68c-e34e-4080-9c3e-2a532b2ccb4d"); print(ipykernel.__file__)"
> c:\src\test\3\.venv7\Scripts\python.exe -c "import ipykernel; print(ipykernel.__version__); print("5dc3a68c-e34e-4080-9c3e-2a532b2ccb4d"); print(ipykernel.__file__)"
info 15:53:59.679: Experiment status for python is {"enabled":true,"optInto":[],"optOutFrom":[]}
info 15:53:59.865: Process Execution: > c:\venvs\venv2\Scripts\python.exe -m pip list
> c:\venvs\venv2\Scripts\python.exe -m pip list
info 15:53:59.879: Preferred Remote kernel for Untitled-1.ipynb is undefined
info 15:53:59.879: Find preferred kernel for Untitled-1.ipynb with metadata {"kernelspec":{"display_name":"Python 3.9.13 ('.venv7': venv)","language":"python","name":"python3"},"language_info":{"codemirror_mode":{"name":"ipython","version":3},"file_extension":".py","mimetype":"text/x-python","name":"python","nbconvert_exporter":"python","pygments_lexer":"ipython3","version":"3.9.13"},"orig_nbformat":4,"vscode":{"interpreter":{"hash":"2a8bb579a3d276ed5ddfe14b8685f1986e420a0f5c411ab8f05c20e26ae95962"}}} & preferred interpreter c:\venvs\venv2\Scripts\python.exe
info 15:53:59.883: Preferred Remote kernel for Untitled-1.ipynb is undefined
info 15:53:59.883: Preferred kernel .jvsc74a57bd02a8bb579a3d276ed5ddfe14b8685f1986e420a0f5c411ab8f05c20e26ae95962.c:\src\test\3\.venv7\Scripts\python.exe.c:\src\test\3\.venv7\Scripts\python.exe.-m#ipykernel_launcher is exact match
info 15:53:59.885: PreferredConnection: .jvsc74a57bd02a8bb579a3d276ed5ddfe14b8685f1986e420a0f5c411ab8f05c20e26ae95962.c:\src\test\3\.venv7\Scripts\python.exe.c:\src\test\3\.venv7\Scripts\python.exe.-m#ipykernel_launcher found for NotebookDocument: Untitled-1.ipynb
info 15:54:0.201: Creating daemon process for c:\src\test\3\.venv7\Scripts\python.exe with env variables count 63
info 15:54:0.210: Process Execution: > c:\src\test\3\.venv7\Scripts\python.exe -m vscode_datascience_helpers.daemon --daemon-module=vscode_datascience_helpers.kernel_interrupt_daemon -v --ppid 36416
> c:\src\test\3\.venv7\Scripts\python.exe -m vscode_datascience_helpers.daemon --daemon-module=vscode_datascience_helpers.kernel_interrupt_daemon -v --ppid 36416
info 15:54:1.170: Registering dummy command feature
info 15:54:1.315: ipykernel version 6.15.0 for c:\src\test\3\.venv7\Scripts\python.exe
info 15:54:1.316: ipykernel location c:\src\test\3\.venv7\lib\site-packages\ipykernel\__init__.py for c:\src\test\3\.venv7\Scripts\python.exe
info 15:54:1.536: Registering dummy command feature
info 15:54:4.31: get interrupthandle daemon
info 15:54:4.105: Process Execution: > c:\src\test\3\.venv7\Scripts\python.exe -m ipykernel_launcher --ip=127.0.0.1 --stdin=9003 --control=9001 --hb=9000 --Session.signature_scheme="hmac-sha256" --Session.key=b"d967177b-4728-4b69-a78b-c9dc765cfac6" --shell=9002 --transport="tcp" --iopub=9004 --f=c:\Users\aamunger\AppData\Roaming\jupyter\runtime\kernel-v2-364163knjpE4ZOZQd.json
> c:\src\test\3\.venv7\Scripts\python.exe -m ipykernel_launcher --ip=127.0.0.1 --stdin=9003 --control=9001 --hb=9000 --Session.signature_scheme="hmac-sha256" --Session.key=b"d967177b-4728-4b69-a78b-c9dc765cfac6" --shell=9002 --transport="tcp" --iopub=9004 --f=c:\Users\aamunger\AppData\Roaming\jupyter\runtime\kernel-v2-364163knjpE4ZOZQd.json
info 15:54:4.105: Process Execution: cwd: c:\src\test\3
cwd: c:\src\test\3
info 15:54:6.276: Execute Cell 0 Untitled-1.ipynb
warn 15:54:7.186: StdErr from Kernel Process c:\src\test\3\.venv7\lib\site-packages\traitlets\traitlets.py:2392: FutureWarning: Supporting extra quotes around strings is deprecated in traitlets 5.0. You can use 'hmac-sha256' instead of '"hmac-sha256"' if you require traitlets >=5.
  warn(
c:\src\test\3\.venv7\lib\site-packages\traitlets\traitlets.py:2346: FutureWarning: Supporting extra quotes around Bytes is deprecated in traitlets 5.0. Use 'd967177b-4728-4b69-a78b-c9dc765cfac6' instead of 'b"d967177b-4728-4b69-a78b-c9dc765cfac6"'.
  warn(

info 15:54:7.386: Kernel Output: NOTE: When using the `ipython kernel` entry point, Ctrl-C will not work.

To exit, you will have to explicitly quit this process, by either sending
"quit" from a client, or using Ctrl-\ in UNIX-like environments.

To read more about this, see https://github.com/ipython/ipython/issues/2049


To connect another client to this kernel, use:
    --existing c:\Users\aamunger\AppData\Roaming\jupyter\runtime\kernel-v2-364163knjpE4ZOZQd.json

info 15:54:7.574: Started kernel .venv7 (Python 3.9.13)., (Raw session started and connected)
info 15:54:7.576: Finished connecting ab500370-c11d-4f93-bed4-7270806cbd9d
info 15:54:7.583: Add SVG to matplotlib figure formats
info 15:54:7.584: Executing silently Code (idle) = __vsc_ipynb_file__ = "Untitled-1.ipynb"\n%config Completer.use_jedi = False\ntry:\nimport matplotli
info 15:54:9.42: Executing silently Code (completed) = __vsc_ipynb_file__ = "Untitled-1.ipynb"\n%config Completer.use_jedi = False\ntry:\nimport matplotli with 0 output(s)
info 15:54:9.44: Waiting for idle on (kernel): 478d570a-fe00-4aa8-b018-fe92901b5259 -> idle
info 15:54:9.44: Finished waiting for idle on (kernel): 478d570a-fe00-4aa8-b018-fe92901b5259 -> idle
info 15:54:9.56: Widget Message: Received IPyWidgets_kernelOptions in ScriptManager
info 15:54:9.58: Widget Message: Received IPyWidgetMessages.IPyWidgets_kernelOptions
info 15:54:9.330: Widget Message: WidgetManager: Loading class LayoutModel:@jupyter-widgets/base:1.2.0
info 15:54:9.342: Widget Message: WidgetManager: Loading class PlotModel:k3d:2.14.2
info 15:54:9.342: Widget Message: Fetch IPyWidget source for k3d
info 15:54:9.343: �[32mFetch Script for {"moduleName":"k3d","moduleVersion":"2.14.2","requestId":"k3d:2.14.2:1656456849340"}
info 15:54:9.343: �[32mFetch Script for k3d
info 15:54:9.343: �[32mSearching for Widget Script k3d#2.14.2 using cdns 
error 15:54:11.312: Script source for Widget k3d@2.14.2 not found
info 15:54:11.312: �[32mScript for k3d, is undefined from undefined
info 15:54:11.314: �[32mFetch Script for k3d
error 15:54:11.316: Script source for Widget k3d@2.14.2 not found
info 15:54:11.316: �[32mScript for k3d, is undefined from undefined
info 15:54:11.363: Widget Message: Received IPyWidget scripts [{"moduleName":"k3d"}]
info 15:54:11.365: Widget Message: Received IPyWidget scripts [{"moduleName":"bqplot","scriptUri":"https://file%2B.vscode-resource.vscode-cdn.net/c%3A/Users/aamunger/.vscode-insiders/extensions/ms-toolsai.jupyter-2022.6.1001811740/tmp/scripts/595a15b5ad743cc874042832f5fb9e6781ac4e9c3ac61f12ed9387e599fe1fa2/jupyter/nbextensions/bqplot/index","source":"local"}]
info 15:54:11.365: Widget Message: Source for IPyWidget bqplot found in local @ https://file%2B.vscode-resource.vscode-cdn.net/c%3A/Users/aamunger/.vscode-insiders/extensions/ms-toolsai.jupyter-2022.6.1001811740/tmp/scripts/595a15b5ad743cc874042832f5fb9e6781ac4e9c3ac61f12ed9387e599fe1fa2/jupyter/nbextensions/bqplot/index.
info 15:54:11.366: Widget Message: Registering IPyWidget bqplot found in https://file%2B.vscode-resource.vscode-cdn.net/c%3A/Users/aamunger/.vscode-insiders/extensions/ms-toolsai.jupyter-2022.6.1001811740/tmp/scripts/595a15b5ad743cc874042832f5fb9e6781ac4e9c3ac61f12ed9387e599fe1fa2/jupyter/nbextensions/bqplot/index.
info 15:54:11.366: Widget Message: Received IPyWidget scripts [{"moduleName":"jupyter-leaflet","scriptUri":"https://file%2B.vscode-resource.vscode-cdn.net/c%3A/Users/aamunger/.vscode-insiders/extensions/ms-toolsai.jupyter-2022.6.1001811740/tmp/scripts/595a15b5ad743cc874042832f5fb9e6781ac4e9c3ac61f12ed9387e599fe1fa2/jupyter/nbextensions/jupyter-leaflet/index","source":"local"}]
info 15:54:11.369: Widget Message: Source for IPyWidget jupyter-leaflet found in local @ https://file%2B.vscode-resource.vscode-cdn.net/c%3A/Users/aamunger/.vscode-insiders/extensions/ms-toolsai.jupyter-2022.6.1001811740/tmp/scripts/595a15b5ad743cc874042832f5fb9e6781ac4e9c3ac61f12ed9387e599fe1fa2/jupyter/nbextensions/jupyter-leaflet/index.
info 15:54:11.370: Widget Message: Registering IPyWidget jupyter-leaflet found in https://file%2B.vscode-resource.vscode-cdn.net/c%3A/Users/aamunger/.vscode-insiders/extensions/ms-toolsai.jupyter-2022.6.1001811740/tmp/scripts/595a15b5ad743cc874042832f5fb9e6781ac4e9c3ac61f12ed9387e599fe1fa2/jupyter/nbextensions/jupyter-leaflet/index.
info 15:54:11.371: Widget Message: Received IPyWidget scripts [{"moduleName":"k3d"}]
info 15:54:11.427: Widget Message: WidgetManager: failed, Loading class PlotModel:k3d:2.14.2
error 15:54:11.429: Widget load failure Widgets require us to download supporting files from a 3rd party website. (Error loading k3d:2.14.2). {
  className: 'PlotModel',
  moduleName: 'k3d',
  moduleVersion: '2.14.2',
  cdnsUsed: false,
  isOnline: true,
  timedout: false,
  error: '{}'
}
info 15:54:11.448: Widget Message: WidgetManager: Loading class ObjectModel:k3d:2.14.2
info 15:54:11.448: Widget Message: WidgetManager: failed, Loading class ObjectModel:k3d:2.14.2
error 15:54:11.449: Widget load failure Widgets require us to download supporting files from a 3rd party website. (Error loading k3d:2.14.2). {
  className: 'ObjectModel',
  moduleName: 'k3d',
  moduleVersion: '2.14.2',
  cdnsUsed: false,
  isOnline: true,
  timedout: false,
  error: '{}'
}
info 15:54:11.450: Widget Message: WidgetManager: Loading class LayoutModel:@jupyter-widgets/base:1.2.0
info 15:54:11.451: Widget Message: WidgetManager: Loading class OutputModel:@jupyter-widgets/output:1.0.0
info 15:54:11.506: Cell 0 executed with state Success
info 15:54:11.568: Widget Message: WidgetManager: Loading class OutputView:@jupyter-widgets/output:1.0.0
info 15:54:11.606: Widget Message: WidgetManager: Loading class LayoutView:@jupyter-widgets/base:1.2.0
info 15:54:13.645: Preferred Remote kernel for Untitled-1.ipynb is undefined
info 15:54:13.645: Find preferred kernel for Untitled-1.ipynb with metadata {"kernelspec":{"display_name":"Python 3.9.13 ('.venv7': venv)","language":"python","name":"python3"},"language_info":{"codemirror_mode":{"name":"ipython","version":3},"file_extension":".py","mimetype":"text/x-python","name":"python","nbconvert_exporter":"python","pygments_lexer":"ipython3","version":"3.9.13"},"orig_nbformat":4,"vscode":{"interpreter":{"hash":"2a8bb579a3d276ed5ddfe14b8685f1986e420a0f5c411ab8f05c20e26ae95962"}}} & preferred interpreter c:\venvs\venv2\Scripts\python.exe
info 15:54:13.650: Preferred Remote kernel for Untitled-1.ipynb is undefined
info 15:54:13.650: Preferred kernel .jvsc74a57bd02a8bb579a3d276ed5ddfe14b8685f1986e420a0f5c411ab8f05c20e26ae95962.c:\src\test\3\.venv7\Scripts\python.exe.c:\src\test\3\.venv7\Scripts\python.exe.-m#ipykernel_launcher is exact match
info 15:54:13.658: Preferred Remote kernel for Untitled-1.ipynb is undefined
info 15:54:16.974: Loading webview. View is notset
info 15:54:16.975: Loading web view...
info 15:54:16.976: Webview panel created.
info 15:54:17.397: Web view react rendered
info 15:54:17.439: Executing silently Code (idle) = def _VSCODE_getVariable(what_to_get, is_debugging, *args):\n# Query Jupyter server for the info
info 15:54:17.441: Executing silently Code (idle) = def _VSCODE_getVariable(what_to_get, is_debugging, *args):\n# Query Jupyter server for the info
info 15:54:17.472: Executing silently Code (completed) = def _VSCODE_getVariable(what_to_get, is_debugging, *args):\n# Query Jupyter server for the info with 1 output(s)
info 15:54:17.502: Executing silently Code (completed) = def _VSCODE_getVariable(what_to_get, is_debugging, *args):\n# Query Jupyter server for the info with 1 output(s)
info 15:54:17.694: Executing silently Code (idle) = def _VSCODE_getVariable(what_to_get, is_debugging, *args):\n# Query Jupyter server for the info
info 15:54:17.764: Executing silently Code (completed) = def _VSCODE_getVariable(what_to_get, is_debugging, *args):\n# Query Jupyter server for the info with 1 output(s)
info 15:54:17.811: Executing silently Code (idle) = def _VSCODE_getVariable(what_to_get, is_debugging, *args):\n# Query Jupyter server for the info
info 15:54:17.841: Executing silently Code (completed) = def _VSCODE_getVariable(what_to_get, is_debugging, *args):\n# Query Jupyter server for the info with 1 output(s)
info 15:54:17.859: Executing silently Code (idle) = def _VSCODE_getVariable(what_to_get, is_debugging, *args):\n# Query Jupyter server for the info
info 15:54:17.888: Executing silently Code (completed) = def _VSCODE_getVariable(what_to_get, is_debugging, *args):\n# Query Jupyter server for the info with 1 output(s)
info 15:54:17.911: Executing silently Code (idle) = def _VSCODE_getVariable(what_to_get, is_debugging, *args):\n# Query Jupyter server for the info
info 15:54:17.949: Executing silently Code (completed) = def _VSCODE_getVariable(what_to_get, is_debugging, *args):\n# Query Jupyter server for the info with 1 output(s)

Setting was set before opening vscode, but I can change it after opening vscode as well. This just always repros for me.
Yes, local kernel

@DonJayamanne DonJayamanne removed info-needed Issue requires more information from poster triage-needed Issue needs to be triaged labels Jun 30, 2022
@DonJayamanne DonJayamanne added this to the June 2022 milestone Jul 5, 2022
@amunger amunger added the verified Verification succeeded label Jul 5, 2022
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jul 6, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Issue identified by VS Code Team member as probable bug ipywidgets Rendering, loading, saving, anything to do with IPyWidgets verified Verification succeeded
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants