Allan Chain
Allan Chain

Reputation: 2845

Jupyter lab fails to install any extension: Assertion `data' failed

I tried to install @jupyter-widgets/jupyterlab-manager:

Building jupyterlab assets (build:prod:minimize)
An error occured.
RuntimeError: JupyterLab failed to build
See the log file for details:  /tmp/jupyterlab-debug-vs3sn2l7.log

Other extensions cannot be installed either, and give the same error. Installing from web client gives 500 error.

I have googled around but cannot find the same error. Also, none of the solutions for similar error seem to work.

My environment:

Raspbian GNU/Linux 10 (buster)

$ node --version
v10.15.2

$ python3 -V
Python 3.7.3

$ jupyter --version
jupyter core     : 4.6.1
jupyter-notebook : 6.0.2
qtconsole        : 4.6.0
ipython          : 7.11.1
ipykernel        : 5.1.3
jupyter client   : 5.3.4
jupyter lab      : 1.2.6
nbconvert        : 5.6.1
ipywidgets       : 7.5.1
nbformat         : 5.0.3
traitlets        : 4.3.3

$ which jupyter
/usr/local/bin/jupyter

Here is the log file:

Yarn configuration loaded.
Node v10.15.2

> /usr/local/bin/npm pack @jupyter-widgets/jupyterlab-manager
npm notice 
npm notice 📦  @jupyter-widgets/[email protected]
npm notice === Tarball Contents === 
npm notice 2.3kB  package.json        
npm notice 1.5kB  LICENSE             
npm notice 1.9kB  README.md           
npm notice 277B   lib/index.d.ts      
npm notice 380B   lib/index.js        
npm notice 5.9kB  lib/manager.d.ts    
npm notice 14.5kB lib/manager.js      
npm notice 1.9kB  lib/output.d.ts     
npm notice 5.2kB  lib/output.js       
npm notice 830B   lib/plugin.d.ts     
npm notice 7.8kB  lib/plugin.js       
npm notice 956B   lib/renderer.d.ts   
npm notice 3.3kB  lib/renderer.js     
npm notice 216B   lib/semvercache.d.ts
npm notice 862B   lib/semvercache.js  
npm notice 375B   schema/plugin.json  
npm notice === Tarball Details === 
npm notice name:          @jupyter-widgets/jupyterlab-manager         
npm notice version:       1.1.0                                       
npm notice filename:      jupyter-widgets-jupyterlab-manager-1.1.0.tgz
npm notice package size:  12.2 kB                                     
npm notice unpacked size: 48.3 kB                                     
npm notice shasum:        6196b9e3df314d488180fb5ed3bfb11df2dfdeaf    
npm notice integrity:     sha512-2dKdzl43nMvmr[...]53y1/ADuNbzhg==    
npm notice total files:   16                                          
npm notice 
jupyter-widgets-jupyterlab-manager-1.1.0.tgz

Yarn configuration loaded.
Node v10.15.2

Building jupyterlab assets (build:prod:minimize)
> node /usr/local/lib/python3.7/dist-packages/jupyterlab/staging/yarn.js install --non-interactive
yarn install v1.15.2
[1/5] Validating package.json...
[2/5] Resolving packages...
[3/5] Fetching packages...
info [email protected]: The platform "linux" is incompatible with this module.
info "[email protected]" is an optional dependency and failed compatibility check. Excluding it from installation.
[4/5] Linking dependencies...
[5/5] Building fresh packages...
success Saved lockfile.
Done in 49.55s.

> node /usr/local/lib/python3.7/dist-packages/jupyterlab/staging/yarn.js yarn-deduplicate -s fewer
yarn run v1.15.2
$ /usr/local/share/jupyter/lab/staging/node_modules/.bin/yarn-deduplicate -s fewer
Done in 15.72s.

> node /usr/local/lib/python3.7/dist-packages/jupyterlab/staging/yarn.js run build:prod:minimize
yarn run v1.15.2
$ ensure-max-old-space webpack --config webpack.prod.minimize.config.js
/usr/bin/node[26503]: ../src/node_platform.cc:414:std::shared_ptr<node::PerIsolatePlatformData> node::NodePlatform::ForIsolate(v8::Isolate*): Assertion `data' failed.
child_process.js:637
    throw err;
    ^

Error: Command failed: /usr/local/share/jupyter/lab/staging/node_modules/.bin/webpack --config webpack.prod.minimize.config.js
    at checkExecSyncError (child_process.js:616:11)
    at Object.execFileSync (child_process.js:634:13)
    at Object.<anonymous> (/usr/local/share/jupyter/lab/staging/node_modules/@jupyterlab/buildutils/lib/ensure-max-old-space.js:38:17)
    at Module._compile (internal/modules/cjs/loader.js:689:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:700:10)
    at Module.load (internal/modules/cjs/loader.js:599:32)
    at tryModuleLoad (internal/modules/cjs/loader.js:538:12)
    at Function.Module._load (internal/modules/cjs/loader.js:530:3)
    at Function.Module.runMain (internal/modules/cjs/loader.js:742:12)
    at startup (internal/bootstrap/node.js:283:19)
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

JupyterLab failed to build
Traceback (most recent call last):

  File "/usr/local/lib/python3.7/dist-packages/jupyterlab/debuglog.py", line 47, in debug_logging
    yield

  File "/usr/local/lib/python3.7/dist-packages/jupyterlab/labextensions.py", line 105, in start
    command=command, app_options=app_options)

  File "/usr/local/lib/python3.7/dist-packages/jupyterlab/commands.py", line 459, in build
    command=command, clean_staging=clean_staging)

  File "/usr/local/lib/python3.7/dist-packages/jupyterlab/commands.py", line 669, in build
    raise RuntimeError(msg)

RuntimeError: JupyterLab failed to build

Exiting application: jupyter

Upvotes: 3

Views: 4244

Answers (1)

Allan Chain
Allan Chain

Reputation: 2845

JupyterLab 1.x checks memory size before build (ensure-max-old-space line), and the default was 4GB. As I am using Raspberry Pi, the memory did not meet this requirement. That's why the assertion failed.

But JupyterLab 2.0.0 changed this behavior because Node 12+ handles the memory. (changelog, PR). And I successfully built JupyterLab 2.0.1 with Node v10.15.2 after change swap size to 1000 MB (500 MB is enough, I think).

However JupyterLab 2.1.0, reverted that PR to support Node 10+ again.

To bypass the check with less than 4 GB memory, you can either:

  • install jupyterlab>=2.0.0,<2.1.0
  • or set environment variable NODE_OPTIONS=--max_old_space_size=2048 when building. You may want to change 2048 to a proper MB of memory based on your system. This option was added after 1.2.0.

And make sure you do have enough memory to build :)

Upvotes: 3

Related Questions