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

Failed to work with plotly #36

Open
eromoe opened this issue May 19, 2020 · 11 comments
Open

Failed to work with plotly #36

eromoe opened this issue May 19, 2020 · 11 comments

Comments

@eromoe
Copy link

eromoe commented May 19, 2020

Hello,

This widget is amazing for preview in notebooks!

But I found it have some problem with plotly , plotly figure can't be ploted , turn on console found a lot of error :

start with voila-vuetify

voila --Voila.ip=0.0.0.0 --ExecutePreprocessor.timeout=180 --template vuetify-default  vue_dashboard.ipynb

image

start plain

plotly figure render fine without --template vuetify-default

voila --Voila.ip=0.0.0.0 --ExecutePreprocessor.timeout=180 vue_dashboard.ipynb

env:

voila                             0.1.21
voila-vuetify                     0.3.0
ipyvuetify                        1.4.0

Do you have any idea?

@eromoe
Copy link
Author

eromoe commented May 19, 2020

[Voila] Serving static files from /home/xxxx/.conda/envs/py3/lib/python3.7/site-packages/voila/static.

I looked into this folder, only found a file extension.js

@eromoe
Copy link
Author

eromoe commented May 19, 2020

Add option --VoilaConfiguration.file_whitelist="['.*']" , 403 change to 404

image

@vidartf
Copy link

vidartf commented Jun 16, 2020

I think you would need to enable nbextensions to make any non-default extensions to work.

@eromoe
Copy link
Author

eromoe commented Jun 17, 2020

@vidartf
nbextension is enabled

Did you refer this ?
image

@vidartf
Copy link

vidartf commented Jun 17, 2020

No, I meant running with voila --enable_nbextensions .... This might be rather under-documented atm unfortunately.

@eromoe
Copy link
Author

eromoe commented Jun 18, 2020

Still no effect .

voila --enable_nbextensions=True --template vuetify-default --Voila.ip=0.0.0.0 --ExecutePreprocessor.timeout=180 vue_dashboard.ipynb
Got 403

WARNING:tornado.access:404 GET /voila/nbextensions/nbextensions_configurator/config_menu/main.js (192.168.20.69) 55.05ms
WARNING:tornado.general:403 GET /voila/files/voila/jquery.js (192.168.20.69): File not whitelisted
WARNING:tornado.access:403 GET /voila/files/voila/jquery.js (192.168.20.69) 2.07ms
WARNING:tornado.general:403 GET /voila/files/voila/base/js/namespace.js (192.168.20.69): File not whitelisted
WARNING:tornado.access:403 GET /voila/files/voila/base/js/namespace.js (192.168.20.69) 1.11ms
WARNING:tornado.general:403 GET /voila/files/voila/moment.js (192.168.20.69): File not whitelisted
WARNING:tornado.access:403 GET /voila/files/voila/moment.js (192.168.20.69) 1.07ms
WARNING:tornado.general:403 GET /voila/files/voila/base/js/events.js (192.168.20.69): File not whitelisted
WARNING:tornado.access:403 GET /voila/files/voila/base/js/events.js (192.168.20.69) 0.64ms
WARNING:tornado.general:403 GET /voila/files/voila/notebook/js/codecell.js (192.168.20.69): File not whitelisted
WARNING:tornado.access:403 GET /voila/files/voila/notebook/js/codecell.js (192.168.20.69) 0.63ms
WARNING:tornado.general:403 GET /voila/files/voila/base/js/utils.js (192.168.20.69): File not whitelisted
WARNING:tornado.access:403 GET /voila/files/voila/base/js/utils.js (192.168.20.69) 0.63ms
WARNING:tornado.access:404 GET /voila/nbextensions/keyboard_shortcut_editor/quickhelp_shim (192.168.20.69) 0.93ms
WARNING:tornado.access:404 GET /voila/nbextensions/keyboard_shortcut_editor/kse_components (192.168.20.69) 0.88ms
WARNING:tornado.access:404 GET /voila/nbextensions/code_prettify/kernel_exec_on_cell (192.168.20.69) 0.89ms
WARNING:tornado.access:404 GET /voila/nbextensions/snippets_menu/snippets_submenu_python (192.168.20.69) 1.16ms
WARNING:tornado.access:404 GET /voila/nbextensions/snippets_menu/snippets_submenu_markdown (192.168.20.69) 0.62ms
WARNING:tornado.general:403 GET /voila/files/voila/base/js/dialog.js (192.168.20.69): File not whitelisted
WARNING:tornado.access:403 GET /voila/files/voila/base/js/dialog.js (192.168.20.69) 1.13ms
WARNING:tornado.general:403 GET /voila/files/voila/base/js/keyboard.js (192.168.20.69): File not whitelisted
WARNING:tornado.access:403 GET /voila/files/voila/base/js/keyboard.js (192.168.20.69) 1.14ms
WARNING:tornado.general:403 GET /voila/files/voila/notebook/js/quickhelp.js (192.168.20.69): File not whitelisted
WARNING:tornado.access:403 GET /voila/files/voila/notebook/js/quickhelp.js (192.168.20.69) 1.12ms
WARNING:tornado.general:403 GET /voila/files/voila/jqueryui.js (192.168.20.69): File not whitelisted
WARNING:tornado.access:403 GET /voila/files/voila/jqueryui.js (192.168.20.69) 0.69ms
WARNING:tornado.general:403 GET /voila/files/favicon.ico (192.168.20.69): File not whitelisted
WARNING:tornado.access:403 GET /voila/files/favicon.ico (192.168.20.69) 0.65ms

Add --VoilaConfiguration.file_whitelist="['.*']" got 404

WARNING:tornado.access:404 GET /voila/nbextensions/nbextensions_configurator/config_menu/main.js (192.168.20.69) 1.63ms
WARNING:tornado.access:404 GET /voila/files/voila/base/js/namespace.js (192.168.20.69) 1.74ms
WARNING:tornado.access:404 GET /voila/files/voila/jquery.js (192.168.20.69) 1.00ms
WARNING:tornado.access:404 GET /voila/files/voila/base/js/utils.js (192.168.20.69) 1.07ms
WARNING:tornado.access:404 GET /voila/files/voila/moment.js (192.168.20.69) 1.01ms
WARNING:tornado.access:404 GET /voila/files/voila/base/js/events.js (192.168.20.69) 0.65ms
WARNING:tornado.access:404 GET /voila/files/voila/notebook/js/codecell.js (192.168.20.69) 1.14ms
WARNING:tornado.access:404 GET /voila/nbextensions/snippets_menu/snippets_submenu_python (192.168.20.69) 2.12ms
WARNING:tornado.access:404 GET /voila/nbextensions/snippets_menu/snippets_submenu_markdown (192.168.20.69) 1.98ms
WARNING:tornado.access:404 GET /voila/nbextensions/keyboard_shortcut_editor/quickhelp_shim (192.168.20.69) 2.03ms
WARNING:tornado.access:404 GET /voila/nbextensions/keyboard_shortcut_editor/kse_components (192.168.20.69) 1.94ms
WARNING:tornado.access:404 GET /voila/nbextensions/code_prettify/kernel_exec_on_cell (192.168.20.69) 2.03ms
WARNING:tornado.access:404 GET /voila/files/voila/base/js/dialog.js (192.168.20.69) 1.23ms
WARNING:tornado.access:404 GET /voila/files/voila/base/js/keyboard.js (192.168.20.69) 1.08ms
WARNING:tornado.access:404 GET /voila/files/voila/notebook/js/quickhelp.js (192.168.20.69) 0.95ms
WARNING:tornado.access:404 GET /voila/files/voila/jqueryui.js (192.168.20.69) 1.00ms
WARNING:tornado.access:404 GET /voila/files/favicon.ico (192.168.20.69) 1.09ms

chrome log

Failed to load resource: net::ERR_CONNECTION_CLOSED
vuetify.min.js:6 Uncaught TypeError: Cannot read property 'extend' of undefined
    at Module.<anonymous> (vuetify.min.js:6)
    at i (vuetify.min.js:6)
    at vuetify.min.js:6
    at vuetify.min.js:6
    at vuetify.min.js:6
    at vuetify.min.js:6
(index):22 Uncaught ReferenceError: Vue is not defined
    at (index):22
(index):267 Uncaught ReferenceError: Vue is not defined
    at (index):267
(index):304 Uncaught TypeError: Cannot set property 'title' of undefined
    at (index):304
(index):315 Uncaught TypeError: voila_process is not a function
    at (index):315
(index):319 Uncaught TypeError: voila_process is not a function
    at (index):319
(index):323 Uncaught TypeError: voila_process is not a function
    at (index):323
(index):327 Uncaught TypeError: voila_process is not a function
    at (index):327
(index):331 Uncaught TypeError: voila_process is not a function
    at (index):331
(index):335 Uncaught TypeError: voila_process is not a function
    at (index):335
(index):339 Uncaught TypeError: voila_process is not a function
    at (index):339
(index):343 Uncaught TypeError: voila_process is not a function
    at (index):343
(index):347 Uncaught TypeError: voila_process is not a function
    at (index):347
(index):351 Uncaught TypeError: voila_process is not a function
    at (index):351
(index):355 Uncaught TypeError: voila_process is not a function
    at (index):355
(index):359 Uncaught TypeError: voila_process is not a function
    at (index):359
(index):363 Uncaught TypeError: voila_process is not a function
    at (index):363
(index):367 Uncaught TypeError: voila_process is not a function
    at (index):367
(index):371 Uncaught TypeError: voila_process is not a function
    at (index):371
(index):375 Uncaught TypeError: voila_process is not a function
    at (index):375
(index):379 Uncaught TypeError: voila_process is not a function
    at (index):379
(index):383 Uncaught TypeError: voila_process is not a function
    at (index):383
:8866/voila/nbextensions/nbextensions_configurator/config_menu/main.js:1 Failed to load resource: the server responded with a status of 404 (Not Found)
require.min.js:1 Uncaught Error: Script error for "/voila/nbextensions/nbextensions_configurator/config_menu/main.js"
http://requirejs.org/docs/errors.html#scripterror
    at makeError (require.min.js:1)
    at HTMLScriptElement.onScriptError (require.min.js:1)
core.js:43 [Nano] Nano Defender Activated :: dc42
(index):419 Uncaught ReferenceError: init is not defined
    at (index):419
    at Object.execCb (require.min.js:1)
    at b.check (require.min.js:1)
    at b.<anonymous> (require.min.js:1)
    at require.min.js:1
    at require.min.js:1
    at each (require.min.js:1)
    at b.emit (require.min.js:1)
    at b.check (require.min.js:1)
    at b.enable (require.min.js:1)
:8866/voila/files/voila/base/js/namespace.js:1 Failed to load resource: the server responded with a status of 404 (Not Found)
:8866/voila/files/voila/jquery.js:1 Failed to load resource: the server responded with a status of 404 (Not Found)
:8866/voila/files/voila/base/js/utils.js:1 Failed to load resource: the server responded with a status of 404 (Not Found)
:8866/voila/files/voila/moment.js:1 Failed to load resource: the server responded with a status of 404 (Not Found)
:8866/voila/files/voila/base/js/events.js:1 Failed to load resource: the server responded with a status of 404 (Not Found)
:8866/voila/files/voila/notebook/js/codecell.js:1 Failed to load resource: the server responded with a status of 404 (Not Found)
:8866/voila/nbextensions/snippets_menu/snippets_submenu_python:1 Failed to load resource: the server responded with a status of 404 (Not Found)
:8866/voila/nbextensions/snippets_menu/snippets_submenu_markdown:1 Failed to load resource: the server responded with a status of 404 (Not Found)
:8866/voila/nbextensions/keyboard_shortcut_editor/quickhelp_shim:1 Failed to load resource: the server responded with a status of 404 (Not Found)
:8866/voila/nbextensions/keyboard_shortcut_editor/kse_components:1 Failed to load resource: the server responded with a status of 404 (Not Found)
:8866/voila/nbextensions/code_prettify/kernel_exec_on_cell:1 Failed to load resource: the server responded with a status of 404 (Not Found)
require.min.js:1 Uncaught Error: Script error for "base/js/namespace", needed by: /voila/nbextensions/nbdime/index.js, /voila/nbextensions/contrib_nbextensions_help_item/main.js, /voila/nbextensions/execute_time/ExecuteTime.js, /voila/nbextensions/snippets_menu/main.js, /voila/nbextensions/keyboard_shortcut_editor/main.js, /voila/nbextensions/navigation-hotkeys/main.js, /voila/nbextensions/snippets/main.js, /voila/nbextensions/help_panel/help_panel.js, /voila/nbextensions/notify/notify.js, /voila/nbextensions/toc2/main.js, /voila/nbextensions/hide_input/main.js
http://requirejs.org/docs/errors.html#scripterror
    at makeError (require.min.js:1)
    at HTMLScriptElement.onScriptError (require.min.js:1)
require.min.js:1 Uncaught Error: Script error for "jquery", needed by: /voila/nbextensions/nbdime/index.js, /voila/nbextensions/contrib_nbextensions_help_item/main.js, /voila/nbextensions/execute_time/ExecuteTime.js, /voila/nbextensions/snippets_menu/main.js, /voila/nbextensions/keyboard_shortcut_editor/main.js, /voila/nbextensions/navigation-hotkeys/main.js, /voila/nbextensions/snippets/main.js, /voila/nbextensions/notify/notify.js, /voila/nbextensions/toc2/main.js, /voila/nbextensions/hide_input/main.js
http://requirejs.org/docs/errors.html#scripterror
    at makeError (require.min.js:1)
    at HTMLScriptElement.onScriptError (require.min.js:1)
require.min.js:1 Uncaught Error: Script error for "base/js/utils", needed by: /voila/nbextensions/nbdime/index.js
http://requirejs.org/docs/errors.html#scripterror
    at makeError (require.min.js:1)
    at HTMLScriptElement.onScriptError (require.min.js:1)
require.min.js:1 Uncaught Error: Script error for "moment", needed by: /voila/nbextensions/execute_time/ExecuteTime.js
http://requirejs.org/docs/errors.html#scripterror
    at makeError (require.min.js:1)
    at HTMLScriptElement.onScriptError (require.min.js:1)
require.min.js:1 Uncaught Error: Script error for "base/js/events", needed by: /voila/nbextensions/execute_time/ExecuteTime.js, /voila/nbextensions/keyboard_shortcut_editor/main.js, /voila/nbextensions/help_panel/help_panel.js, /voila/nbextensions/toc2/main.js, /voila/nbextensions/hide_input/main.js
http://requirejs.org/docs/errors.html#scripterror
    at makeError (require.min.js:1)
    at HTMLScriptElement.onScriptError (require.min.js:1)
require.min.js:1 Uncaught Error: Script error for "notebook/js/codecell", needed by: /voila/nbextensions/execute_time/ExecuteTime.js, /voila/nbextensions/toc2/main.js
http://requirejs.org/docs/errors.html#scripterror
    at makeError (require.min.js:1)
    at HTMLScriptElement.onScriptError (require.min.js:1)
require.min.js:1 Uncaught Error: Script error for "/voila/nbextensions/snippets_menu/snippets_submenu_python", needed by: /voila/nbextensions/snippets_menu/main.js
http://requirejs.org/docs/errors.html#scripterror
    at makeError (require.min.js:1)
    at HTMLScriptElement.onScriptError (require.min.js:1)
require.min.js:1 Uncaught Error: Script error for "/voila/nbextensions/snippets_menu/snippets_submenu_markdown", needed by: /voila/nbextensions/snippets_menu/main.js
http://requirejs.org/docs/errors.html#scripterror
    at makeError (require.min.js:1)
    at HTMLScriptElement.onScriptError (require.min.js:1)
require.min.js:1 Uncaught Error: Script error for "/voila/nbextensions/keyboard_shortcut_editor/quickhelp_shim", needed by: /voila/nbextensions/keyboard_shortcut_editor/main.js
http://requirejs.org/docs/errors.html#scripterror
    at makeError (require.min.js:1)
    at HTMLScriptElement.onScriptError (require.min.js:1)
require.min.js:1 Uncaught Error: Script error for "/voila/nbextensions/keyboard_shortcut_editor/kse_components", needed by: /voila/nbextensions/keyboard_shortcut_editor/main.js
http://requirejs.org/docs/errors.html#scripterror
    at makeError (require.min.js:1)
    at HTMLScriptElement.onScriptError (require.min.js:1)
require.min.js:1 Uncaught Error: Script error for "/voila/nbextensions/code_prettify/kernel_exec_on_cell", needed by: /voila/nbextensions/code_prettify/code_prettify.js
http://requirejs.org/docs/errors.html#scripterror
    at makeError (require.min.js:1)
    at HTMLScriptElement.onScriptError (require.min.js:1)
:8866/voila/files/voila/base/js/dialog.js:1 Failed to load resource: the server responded with a status of 404 (Not Found)
:8866/voila/files/voila/base/js/keyboard.js:1 Failed to load resource: the server responded with a status of 404 (Not Found)
:8866/voila/files/voila/notebook/js/quickhelp.js:1 Failed to load resource: the server responded with a status of 404 (Not Found)
:8866/voila/files/voila/jqueryui.js:1 Failed to load resource: the server responded with a status of 404 (Not Found)
require.min.js:1 Uncaught Error: Script error for "base/js/dialog", needed by: /voila/nbextensions/keyboard_shortcut_editor/main.js, /voila/nbextensions/snippets/main.js
http://requirejs.org/docs/errors.html#scripterror
    at makeError (require.min.js:1)
    at HTMLScriptElement.onScriptError (require.min.js:1)
require.min.js:1 Uncaught Error: Script error for "base/js/keyboard", needed by: /voila/nbextensions/keyboard_shortcut_editor/main.js
http://requirejs.org/docs/errors.html#scripterror
    at makeError (require.min.js:1)
    at HTMLScriptElement.onScriptError (require.min.js:1)
require.min.js:1 Uncaught Error: Script error for "notebook/js/quickhelp", needed by: /voila/nbextensions/keyboard_shortcut_editor/main.js
http://requirejs.org/docs/errors.html#scripterror
    at makeError (require.min.js:1)
    at HTMLScriptElement.onScriptError (require.min.js:1)
require.min.js:1 Uncaught Error: Script error for "jqueryui", needed by: /voila/nbextensions/help_panel/help_panel.js
http://requirejs.org/docs/errors.html#scripterror
    at makeError (require.min.js:1)
    at HTMLScriptElement.onScriptError (require.min.js:1)
29[Intervention] Slow network is detected. See <URL> for more details. Fallback font will be used while loading: <URL>
:8866/voila/files/favicon.ico:1 Failed to load resource: the server responded with a status of 404 (Not Found)
DevTools failed to load SourceMap: Could not load content for chrome-extension://hdokiejnpimakedhajhdlcegeplioahd/sourcemaps/onloadwff.js.map: HTTP error: status code 404, net::ERR_UNKNOWN_URL_SCHEME

@pgellert
Copy link

I am getting similar errors using standard voila (without vuetify) and plotly. The notebook gets executed, but the plots don't show up. It seems to only come up for voila versions >=0.2.

I am running voila with these parameters:

voila notebooks/Untitled.ipynb --enable_nbextensions=True --VoilaConfiguration.file_whitelist="['.*']"

(Adding and removing --VoilaConfiguration.file_whitelist="['.*']" only changes the error code I get between 500 and 404, similarly to what @eromoe got)

JS errors:

require.min.js:1 GET http://localhost:8866/voila/files/voila/plotly.js net::ERR_ABORTED 404 (Not Found)

Voila errors:

WARNING:tornado.access:404 GET /voila/files/voila/plotly.js (::1) 1.00ms

Platform: Windows
Python version: 3.6.6
Venv:

Package                 Version
----------------------- ---------
ansiwrap                0.8.4
appdirs                 1.4.4
argon2-cffi             20.1.0
async-generator         1.10
atomicwrites            1.4.0
attrs                   20.1.0
backcall                0.2.0
black                   20.8b1
bleach                  3.1.5
certifi                 2020.6.20
cffi                    1.14.2
chardet                 3.0.4
click                   7.1.2
colorama                0.4.3
cryptography            3.0
cycler                  0.10.0
dataclasses             0.7
decorator               4.4.2
defusedxml              0.6.0
distlib                 0.3.1
elasticsearch           7.9.1
elasticsearch-dsl       7.2.1
entrypoints             0.3
filelock                3.0.12
gr-qpo-util             3.4
idna                    2.10
importlib-metadata      1.7.0
importlib-resources     3.0.0
iniconfig               1.0.1
ipykernel               5.3.4
ipysheet                0.4.4
ipython                 7.16.1
ipython-genutils        0.2.0
ipywidgets              7.5.1
jedi                    0.17.2
Jinja2                  2.11.2
jira                    2.0.0
jsonschema              3.2.0
jupyter                 1.0.0
jupyter-client          6.1.7
jupyter-console         6.1.0
jupyter-core            4.6.3
jupyter-server          1.0.1
jupyterlab-pygments     0.1.1
kerberos-sspi           0.2
kiwisolver              1.2.0
MarkupSafe              1.1.1
matplotlib              3.3.1
mistune                 0.8.4
more-itertools          8.5.0
mypy-extensions         0.4.3
nbclient                0.5.0
nbconvert               6.0.6
nbformat                5.0.7
nest-asyncio            1.4.0
notebook                6.1.3
ntlm-auth               1.5.0
numpy                   1.19.2
oauthlib                3.1.0
packaging               20.4
pandas                  1.1.2
pandocfilters           1.4.2
papermill               2.1.3
parso                   0.7.1
pathspec                0.8.0
pbr                     5.5.0
pickleshare             0.7.5
Pillow                  7.2.0
pip                     20.2.2
plotly                  4.9.0
pluggy                  0.13.1
prometheus-client       0.8.0
prompt-toolkit          3.0.6
py                      1.9.0
pybind11                2.5.0
pycparser               2.20
Pygments                2.6.1
PyJWT                   1.7.1
pyodbc                  4.0.30
pyparsing               2.4.7
pypiwin32               223
pyrsistent              0.16.0
pytest                  6.0.1
python-dateutil         2.8.1
pytz                    2020.1
pywin32                 228
pywinpty                0.5.7
PyYAML                  5.3.1
pyzmq                   19.0.2
qtconsole               4.7.6
QtPy                    1.9.0
regex                   2020.7.14
requests                2.24.0
requests-kerberos       0.12.0
requests-negotiate-sspi 0.5.2
requests-ntlm           1.1.0
requests-oauthlib       1.3.0
requests-toolbelt       0.9.1
retrying                1.3.3
Send2Trash              1.5.0
setuptools              49.6.0
six                     1.15.0
SQLAlchemy              1.3.19
tenacity                6.2.0
terminado               0.8.3
testpath                0.4.4
textwrap3               0.9.2
toml                    0.10.1
tornado                 5.1.1
tox                     3.19.0
tqdm                    4.48.2
traitlets               4.3.3
typed-ast               1.4.1
typing-extensions       3.7.4.3
urllib3                 1.25.10
virtualenv              20.0.31
voila                   0.2.3
wcwidth                 0.2.5
webencodings            0.5.1
wheel                   0.35.1
widgetsnbextension      3.5.1
win32-setctime          1.0.1
winkerberos             0.7.0
zipp                    3.1.0

@jwminton
Copy link

jwminton commented Oct 5, 2020

This is due to require.min.js script element getting relocated to below notebook cell execution when the base.tpl file was reworked into index.html.j2 files. I've created a PR that addresses this:

voila-dashboards/voila#735

@stackedsax
Copy link

@eromoe have you tried out @jwminton's fix in voila-dashboards/voila#735?

@eromoe
Copy link
Author

eromoe commented Oct 14, 2020

Nope, I don't use this now .

@jeffyjefflabs
Copy link

I mentioned this in voila-dashboards/voila#619, but as a workaround, try wrapping your Plotly figure in a FigureWidget.

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

6 participants