jupyterhub / mybinder.org-deploy

Deployment config files for mybinder.org
https://mybinder-sre.readthedocs.io/en/latest/index.html
BSD 3-Clause "New" or "Revised" License
76 stars 75 forks source link

Launching lab in recent builds shows a "Build Recommended" dialog #1607

Closed manics closed 4 years ago

manics commented 4 years ago

As pointed out in https://discourse.jupyter.org/t/list-of-supported-dependency-version-for-binder/5945/4 If you launch JupyterLab in: http://mybinder.org/v2/gh/binder-examples/conda_environment/master?urlpath=lab and some other repos you'll see this dialog:

Build Recommended
JupyterLab build is suggested:
jupyter-offlinenotebook needs to be included in build

image

This occurs on gke and ovh, but not on gesis, nor when it's built locally with repo2docker which makes this tricky to track down.

meeseeksmachine commented 4 years ago

This issue has been mentioned on Jupyter Community Forum. There might be relevant details there:

https://discourse.jupyter.org/t/list-of-supported-dependency-version-for-binder/5945/8

betatim commented 4 years ago

The repo got rebuilt just before I posted on the forum so it should be using the latest version of repo2docker. This is super weird :-/

manics commented 4 years ago

Jupyterlab and offlinenotebook are installed in an earlier build step, so although the repo is rebuilt the earlier steps will have been cached and could be quite old. One possibility is there was a issue with one of the intermediate dependencies which has now been "locked in" to the cached image. I'll try and figure out how JupyterLab dependencies work....

manics commented 4 years ago

jupyter labextension install jupyter-offlinenotebook sometimes fails, example of the debug logs when it fails /tmp/jupyterlab-debug-2qo3sy0z.log:

``` Node v10.22.0 Yarn configuration loaded. > /usr/bin/npm pack jupyter-offlinenotebook npm notice npm notice 📦 jupyter-offlinenotebook@0.1.0 npm notice === Tarball Contents === npm notice 1.5kB package.json npm notice 1.5kB LICENSE npm notice 11.3kB LICENSE.dexie npm notice 4.5kB README.md npm notice 246B jupyter_offlinenotebook/static/style/index.css npm notice 225.8kB lib/dexie.js npm notice 154.0kB lib/dexie.js.map npm notice 75.9kB lib/dexie.min.js npm notice 133.1kB lib/dexie.min.js.map npm notice 8.8kB lib/index.js npm notice 6.9kB lib/index.js.map npm notice 3.4kB lib/offlinenotebook.js npm notice 3.2kB lib/offlinenotebook.js.map npm notice === Tarball Details === npm notice name: jupyter-offlinenotebook npm notice version: 0.1.0 npm notice filename: jupyter-offlinenotebook-0.1.0.tgz npm notice package size: 127.8 kB npm notice unpacked size: 630.3 kB npm notice shasum: 93640a1d5015906881ce37d529a5b7337c5283a9 npm notice integrity: sha512-1/XAD24zXamxp[...]WTcoAgq+AnTpg== npm notice total files: 13 npm notice jupyter-offlinenotebook-0.1.0.tgz Node v10.22.0 Yarn configuration loaded. Building jupyterlab assets (build:prod:minimize) > node /srv/conda/envs/notebook/lib/python3.7/site-packages/jupyterlab/staging/yarn.js install --non-interactive yarn install v1.21.1 [1/5] Validating package.json... [2/5] Resolving packages... [3/5] Fetching packages... warning @blueprintjs/core@3.29.0: Invalid bin entry for "upgrade-blueprint-2.0.0-rename" (in "@blueprintjs/core"). warning @blueprintjs/core@3.29.0: Invalid bin entry for "upgrade-blueprint-3.0.0-rename" (in "@blueprintjs/core"). warning sha.js@2.4.11: Invalid bin entry for "sha.js" (in "sha.js"). info fsevents@2.1.3: The platform "linux" is incompatible with this module. info "fsevents@2.1.3" is an optional dependency and failed compatibility check. Excluding it from installation. info fsevents@1.2.13: The platform "linux" is incompatible with this module. info "fsevents@1.2.13" is an optional dependency and failed compatibility check. Excluding it from installation. [4/5] Linking dependencies... warning " > @lumino/coreutils@1.5.2" has unmet peer dependency "crypto@1.0.1". [5/5] Building fresh packages... success Saved lockfile. Done in 35.97s. > node /srv/conda/envs/notebook/lib/python3.7/site-packages/jupyterlab/staging/yarn.js yarn-deduplicate -s fewer --fail yarn run v1.21.1 $ /srv/conda/envs/notebook/share/jupyter/lab/staging/node_modules/.bin/yarn-deduplicate -s fewer --fail Done in 0.74s. > node /srv/conda/envs/notebook/lib/python3.7/site-packages/jupyterlab/staging/yarn.js run build:prod:minimize yarn run v1.21.1 $ ensure-max-old-space webpack --config webpack.prod.minimize.config.js child_process.js:650 throw err; ^ Error: Command failed: /srv/conda/envs/notebook/share/jupyter/lab/staging/node_modules/.bin/webpack --config webpack.prod.minimize.config.js at checkExecSyncError (child_process.js:629:11) at Object.execFileSync (child_process.js:647:13) at Object. (/srv/conda/envs/notebook/share/jupyter/lab/staging/node_modules/@jupyterlab/buildutils/lib/ensure-max-old-space.js:38:17) at Module._compile (internal/modules/cjs/loader.js:778:30) at Object.Module._extensions..js (internal/modules/cjs/loader.js:789:10) at Module.load (internal/modules/cjs/loader.js:653:32) at tryModuleLoad (internal/modules/cjs/loader.js:593:12) at Function.Module._load (internal/modules/cjs/loader.js:585:3) at Function.Module.runMain (internal/modules/cjs/loader.js:831: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 "/srv/conda/envs/notebook/lib/python3.7/site-packages/jupyterlab/debuglog.py", line 47, in debug_logging yield File "/srv/conda/envs/notebook/lib/python3.7/site-packages/jupyterlab/labextensions.py", line 105, in start command=command, app_options=app_options) File "/srv/conda/envs/notebook/lib/python3.7/site-packages/jupyterlab/commands.py", line 460, in build command=command, clean_staging=clean_staging) File "/srv/conda/envs/notebook/lib/python3.7/site-packages/jupyterlab/commands.py", line 661, in build raise RuntimeError(msg) RuntimeError: JupyterLab failed to build Exiting application: jupyter ```

There's a few other reports of this error, e.g. https://github.com/jupyterlab/jupyterlab/issues/7608

This error is hidden during the repo2docker build due to || true in case an incompatible version of JupyterLab is installed in the repo: https://github.com/jupyterhub/repo2docker/blob/8fe59166acf964cfc74d313b2c974bce48905225/repo2docker/buildpacks/conda/install-miniforge.bash#L50-L52

I've no idea why it only occurs sometimes on mybinder, and never locally :-/

If it does occur, running

$NB_PYTHON_PREFIX/bin/jupyter lab build --debug

also fails with the same error, however clicking the Build button in the dialog does work. Disabling minimisation for production builds on the command line also works:

$NB_PYTHON_PREFIX/bin/jupyter lab build --minimize=False

Possible solutions (we may want more than one):

manics commented 4 years ago

My discovery that $NB_PYTHON_PREFIX/bin/jupyter lab build --minimize=False seemed to fix things wasn't a fluke, there's some justification for it:

I've opened https://github.com/jupyterhub/repo2docker/pull/963