jupyter / declarativewidgets

[RETIRED] Jupyter Declarative Widget Extension
http://jupyter.org/declarativewidgets/docs.html
Other
120 stars 38 forks source link

"Load failed, save is disabled" when loading a notebook with existing declarative widgets #526

Open Etiennepi opened 7 years ago

Etiennepi commented 7 years ago

Hi,

I created a few notebooks that use declarative widgets, but whenever I re-open one of them to work some more (Or simply refresh the page), I can no longer save my work. Neither through auto-save or through the floppy button or file menu.

I get a few errors in the browser console, the first being a 404 on whatever urth component I try to use, followed by a TypeError of some sort. I made a smaller notebook containing only a table with random data to limit the error output. Here's the whole output of the browser console:

loaded custom.js
Default extension for cell metadata editing loaded.
Raw Cell Format toolbar preset loaded.
Slideshow extension for metadata editing loaded.
actions jupyter-notebook:find-and-replace does not exist, still binding it in case it will be defined later...
load_extensions ["jupyter-vega/index", "jupyter-js-widgets/extension", "jupyter_cms/notebook/main", "jupyter_dashboards/notebook/main", "declarativewidgets/js/main"]
GET http://localhost:8888/notebooks/urth_components/urth-viz-table/urth-viz-table.html 404 (Not Found)
Session: kernel_created (f4b74936-7e4c-4b6d-8e17-7b26650919aa)
Starting WebSockets: ws://localhost:8888/api/kernels/596c917d-ded5-4720-b038-1f0a8fd42a0f
Uncaught (in promise) TypeError: Cannot read property 'document' of null(…)
Loading extension: declarativewidgets/js/main
Kernel: kernel_connected (596c917d-ded5-4720-b038-1f0a8fd42a0f)
Kernel: kernel_ready (596c917d-ded5-4720-b038-1f0a8fd42a0f)
Loading extension: jupyter-vega/index
Loading extension: jupyter-js-widgets/extension
loaded declarativewidgets
loaded widgets
Loading extension: jupyter_cms/notebook/main
Loading extension: jupyter_dashboards/notebook/main
jupyter_dashboards loaded
Server extension is available!
Widget backend and frontend versions are compatible
Uncaught (in promise) WrappedError {stack: "Error: Couldn't create model↵    at WrappedError (…js-widgets/extension.js?v=20161114140612:32352:34", message: "Couldn't create model", error_stack: Array[2]}error_stack: Array[2]0: Error: Class undefined not found in registry 
    at http://localhost:8888/nbextensions/jupyter-js-widgets/extension.js?v=20161114140612:31997:25
    at Object.loadClass (http://localhost:8888/nbextensions/jupyter-js-widgets/extension.js?v=20161114140612:31958:13)
    at WidgetManager.ManagerBase.new_model (http://localhost:8888/nbextensions/jupyter-js-widgets/extension.js?v=20161114140612:32336:32)
    at http://localhost:8888/nbextensions/jupyter-js-widgets/extension.js?v=20161114140612:217:30
    at Array.map (native)
    at http://localhost:8888/nbextensions/jupyter-js-widgets/extension.js?v=20161114140612:216:46message: "Class undefined not found in registry "stack: "Error: Class undefined not found in registry ↵    at http://localhost:8888/nbextensions/jupyter-js-widgets/extension.js?v=20161114140612:31997:25↵    at Object.loadClass (http://localhost:8888/nbextensions/jupyter-js-widgets/extension.js?v=20161114140612:31958:13)↵    at WidgetManager.ManagerBase.new_model (http://localhost:8888/nbextensions/jupyter-js-widgets/extension.js?v=20161114140612:32336:32)↵    at http://localhost:8888/nbextensions/jupyter-js-widgets/extension.js?v=20161114140612:217:30↵    at Array.map (native)↵    at http://localhost:8888/nbextensions/jupyter-js-widgets/extension.js?v=20161114140612:216:46"__proto__: Objectconstructor: Error()message: ""name: "Error"toString: toString()__proto__: Object__defineGetter__: __defineGetter__()__defineSetter__: __defineSetter__()__lookupGetter__: __lookupGetter__()__lookupSetter__: __lookupSetter__()constructor: Object()arguments: nullassign: assign()caller: nullcreate: create()defineProperties: defineProperties()defineProperty: defineProperty()entries: entries()freeze: freeze()getOwnPropertyDescriptor: getOwnPropertyDescriptor()getOwnPropertyDescriptors: getOwnPropertyDescriptors()getOwnPropertyNames: getOwnPropertyNames()getOwnPropertySymbols: getOwnPropertySymbols()getPrototypeOf: getPrototypeOf()is: is()isExtensible: isExtensible()isFrozen: isFrozen()isSealed: isSealed()keys: keys()length: 1name: "Object"preventExtensions: preventExtensions()prototype: Objectseal: seal()setPrototypeOf: setPrototypeOf()values: values()__proto__: ()[[FunctionLocation]]: <unknown>hasOwnProperty: hasOwnProperty()isPrototypeOf: isPrototypeOf()propertyIsEnumerable: propertyIsEnumerable()toLocaleString: toLocaleString()toString: toString()valueOf: valueOf()get __proto__: __proto__()set __proto__: __proto__()1: Error: Couldn't create model
    at WrappedError (http://localhost:8888/nbextensions/jupyter-js-widgets/extension.js?v=20161114140612:31924:22)
    at http://localhost:8888/nbextensions/jupyter-js-widgets/extension.js?v=20161114140612:32352:34message: "Couldn't create model"stack: "Error: Couldn't create model↵    at WrappedError (http://localhost:8888/nbextensions/jupyter-js-widgets/extension.js?v=20161114140612:31924:22)↵    at http://localhost:8888/nbextensions/jupyter-js-widgets/extension.js?v=20161114140612:32352:34"__proto__: Objectconstructor: Error()arguments: nullcaller: nullcaptureStackTrace: captureStackTrace()length: 1name: "Error"prototype: ObjectstackTraceLimit: 10__proto__: ()message: ""name: "Error"toString: toString()arguments: nullcaller: nulllength: 0name: "toString"__proto__: ()__proto__: Object__defineGetter__: __defineGetter__()__defineSetter__: __defineSetter__()__lookupGetter__: __lookupGetter__()__lookupSetter__: __lookupSetter__()constructor: Object()hasOwnProperty: hasOwnProperty()isPrototypeOf: isPrototypeOf()propertyIsEnumerable: propertyIsEnumerable()toLocaleString: toLocaleString()toString: toString()valueOf: valueOf()get __proto__: __proto__()set __proto__: __proto__()length: 2__proto__: Array[0]concat: concat()constructor: Array()copyWithin: copyWithin()entries: entries()every: every()fill: fill()filter: filter()find: find()findIndex: findIndex()forEach: forEach()includes: includes()indexOf: indexOf()join: join()keys: keys()lastIndexOf: lastIndexOf()length: 0map: map()pop: pop()push: push()reduce: reduce()reduceRight: reduceRight()reverse: reverse()shift: shift()slice: slice()some: some()sort: sort()splice: splice()toLocaleString: toLocaleString()toString: toString()unshift: unshift()Symbol(Symbol.iterator): values()Symbol(Symbol.unscopables): Object__proto__: Objectmessage: "Couldn't create model"stack: "Error: Couldn't create model↵    at WrappedError (http://localhost:8888/nbextensions/jupyter-js-widgets/extension.js?v=20161114140612:31924:22)↵    at http://localhost:8888/nbextensions/jupyter-js-widgets/extension.js?v=20161114140612:32352:34"__proto__: Error
Components root is:  /urth_components
GET http://localhost:8888/static/does/not/exist.js?v=20161114140612 
GET http://localhost:8888/nbextensions/widgets/widgets/js/widget.js?v=20161114140612 
Declarative widgets connected.
Polymer element requesting resize notifications
urth-core-function: Error while getting function signature: Invalid function name get_general_statistics
/deep/ combinator is deprecated. See https://www.chromestatus.com/features/6750456638341120 for more details.
Uncaught (in promise) Error: Load failed, save is disabled(…)

I'm currently running jupyter as a simple notebook server running on my local windows machine, Here's the output of a pip freeze:

alabaster==0.7.7
altair==1.0.0
anaconda-client==1.4.0
anaconda-navigator==1.1.0
argcomplete==1.0.0
astropy==1.1.2
avro==1.8.1
Babel==2.2.0
backports-abc==0.4
backports.shutil-get-terminal-size==1.0.0
backports.ssl-match-hostname==3.4.0.2
beautifulsoup4==4.5.1
bitarray==0.8.1
blaze==0.9.1
bokeh==0.11.1
boto==2.39.0
Bottleneck==1.0.0
brewer2mpl==1.4.1
cdecimal==2.3
certifi==2016.9.26
cffi==1.5.2
chest==0.2.3
click==6.6
click-plugins==1.0.3
cligj==0.4.0
cloudpickle==0.1.1
clyent==1.2.1
colorama==0.3.7
comtypes==1.1.2
conda==4.1.12
conda-build==1.20.0
conda-env==2.5.0a0
conda-manager==0.3.1
configobj==5.0.6
configparser==3.5.0
cryptography==1.3
cycler==0.10.0
Cython==0.23.4
cytoolz==0.7.5
dask==0.8.1
datashape==0.5.1
decorator==4.0.10
descartes==1.0.2
dill==0.2.5
Django==1.10.2
docutils==0.12
entrypoints==0.2.2
enum34==1.1.6
et-xmlfile==1.0.1
fastcache==1.0.2
Fiona==1.7.0
Flask==0.11.1
Flask-Cors==2.1.2
folium==0.2.1
funcsigs==1.0.2
functools32==3.2.3.post2
futures==3.0.5
GDAL==2.0.3
geopandas==0+unknown
gevent==1.1.0
ggplot==0.11.5
google-api-python-client==1.5.3
google-apitools==0.5.4
greenlet==0.4.9
grin==1.2.1
h5py==2.5.0
HeapDict==1.0.0
html5lib==0.999999999
httplib2==0.9.2
idna==2.0
ipaddress==1.0.14
ipykernel==4.3.1
ipython==4.1.2
ipython-genutils==0.1.0
ipywidgets==5.2.2
itsdangerous==0.24
jdcal==1.2
jedi==0.9.0
Jinja2==2.8
jsonschema==2.5.1
jupyter==1.0.0
jupyter-client==4.2.2
jupyter-cms==0.6.1
jupyter-console==4.1.1
jupyter-core==4.2.0
jupyter-dashboards==0.6.1
jupyter-dashboards-bundlers==0.8.1
jupyter-declarativewidgets==0.7.0
jupyterlab==0.7.0
llvmlite==0.9.0
locket==0.2.0
lxml==3.6.4
MarkupSafe==0.23
matplotlib==1.5.1
menuinst==1.3.2
mistune==0.7.3
mock==2.0.0
mpmath==0.19
multipledispatch==0.4.8
munch==2.0.4
nbconvert==4.2.0
nbformat==4.1.0
networkx==1.11
nltk==3.2
nose==1.3.7
notebook==4.2.3
numba==0.24.0
numexpr==2.6.1
numpy==1.11.2
oauth2client==2.2.0
odo==0.4.2
openpyxl==2.3.2
pandas==0.19.0
partd==0.3.2
path.py==0.0.0
pathlib2==2.1.0
patsy==0.4.0
pbr==1.10.0
pep8==1.7.0
pickleshare==0.7.4
Pillow==3.1.1
pivottablejs==0.1.0
plotly==1.12.4
ply==3.8
prompt-toolkit==1.0.8
protorpc==0.11.1
psutil==4.1.0
py==1.4.31
pyasn1==0.1.9
pyasn1-modules==0.0.8
pycosat==0.6.1
pycparser==2.14
pycrypto==2.6.1
pyflakes==1.1.0
Pygments==2.1.3
pyOpenSSL==0.15.1
pyparsing==2.0.3
pyproj==1.9.5
pyreadline==2.1
pytest==2.8.5
python-dataflow==0.2.7
python-dateutil==2.5.3
python-gflags==3.0.5
pytz==2016.7
pywin32==220
PyYAML==3.11
pyzmq==15.2.0
QtAwesome==0.3.2
qtconsole==4.2.0
QtPy==1.0
requests==2.9.1
rope==0.9.4
rsa==3.4.2
ruamel-yaml===-VERSION
scandir==1.4
scikit-image==0.12.3
scikit-learn==0.17.1
scipy==0.17.1
seaborn==0.7.1
Shapely==1.5.16
simplegeneric==0.8.1
simplejson==3.8.2
singledispatch==3.4.0.3
six==1.10.0
snowballstemmer==1.2.1
sockjs-tornado==1.0.1
sphinx==1.3.5
sphinx-rtd-theme==0.1.9
spyder==2.3.8
SQLAlchemy==1.0.12
statsmodels==0.6.1
sympy==1.0
tables==3.2.2
toolz==0.7.4
tornado==4.4.2
traitlets==4.3.1
unicodecsv==0.14.1
uritemplate==0.6
vega==0.4.4
vincent==0.4.4
virtualenv==15.0.2
virtualenvwrapper-powershell==12.7.8
wcwidth==0.1.7
webencodings==0.5
Werkzeug==0.11.11
Whoosh==2.7.4
widgetsnbextension==1.2.6
win-unicode-console==0.5
xlrd==0.9.4
XlsxWriter==0.8.4
xlwings==0.7.0
xlwt==1.0.0

And finally, the output of jupyter nbextension list:

Known nbextensions:
  config dir: C:\Users\epicard\.jupyter\nbconfig
    notebook section
      jupyter-js-widgets/extension enabled
      - Validating: ok
  config dir: D:\Anaconda2\etc\jupyter\nbconfig
    notebook section
      jupyter-vega/index enabled
      - Validating: ok
      jupyter-js-widgets/extension enabled
      - Validating: ok
      jupyter_cms/notebook/main enabled
      - Validating: ok
      jupyter_dashboards/notebook/main enabled
      - Validating: ok
      declarativewidgets/js/main enabled
      - Validating: ok
    tree section
      jupyter_cms/dashboard/main enabled
      - Validating: ok
    edit section
      jupyter_cms/editor/main enabled
      - Validating: ok

If there's anything else you guys can use to troubleshoot this, let me know. Any help would be greatly appreciated.

MattKravetz commented 7 years ago

+1

I've encountered this issue too. I'm running off the docker_deploy repo - whenever this occurs, I have only had success at clearing the error by destroying and rebuilding the "notebook" docker container.

This seems to occur in certain notebooks more frequently than others, and I haven't been able to pinpoint why.

peller commented 7 years ago

I think this is a known issue. @lbustelo?

Etiennepi commented 7 years ago

Is there a known workaround for this?

peller commented 7 years ago

I remember this being an intermittent problem, usually resolved by a reload

Etiennepi commented 7 years ago

Hmmm, I've reloaded the notebooks on which I've had that a lot of times. In my case, when a notebook is affected, there doesn't seem to be any way to avoid it.

peller commented 7 years ago

I think I usually had to both restart the kernel and clear the output cells to get past this problem

Etiennepi commented 7 years ago

I just tried that and simply restarting the kernel and clearing the output didn't work. I did manage to get it to work by making sure all the outputs were cleared before saving and closing the notebook. If any of the declarativewidgets outputs are around when I save, it breaks when I try to reload/re-open it.

b11z commented 7 years ago

I'm seeing this too and tried to track it down (without success). So far I traced it to the the value of _model_name being undefined here: manager.js:69 but don't know how to troubleshoot from there.

lbustelo commented 7 years ago

@b11z That is interesting... We partially use ipywidgets... Maybe they are storing something in metadata and we expose some issue.

/cc @SylvainCorlay