anurag008w commited on
Commit
467fd00
Β·
1 Parent(s): 622b18a

fix(jupyter): stop overriding JUPYTERLAB_DIR (assets not found)

Browse files

JupyterLab 4 ships its prebuilt application assets (static/, schemas/,
staging/) inside the pip package and installs them to the system share
path (e.g. /usr/local/share/jupyter/lab). JUPYTERLAB_DIR points at that
assets directory β€” it is NOT a user settings/extensions dir.

Commit d085e58 ("Fix JupyterLab writable extension paths") redirected
JUPYTERLAB_DIR to an empty user-writable folder
($HC_WRITABLE_BASE/.local/share/jupyter/lab), which has no assets, so
JupyterLab died on every boot with:

JupyterLab application assets not found in
"/home/node/.huggingclaw-runtime/.local/share/jupyter/lab"
Please run `jlpm run build:core` then `jupyter lab build`
or use a different app directory

The settings/extensions persistence that d085e58 actually wanted is
already handled by JUPYTERLAB_SETTINGS_DIR / JUPYTERLAB_WORKSPACES_DIR /
JUPYTER_CONFIG_DIR / JUPYTER_DATA_DIR, which are all kept intact. Only
the JUPYTERLAB_DIR override was wrong.

Removed the override in all three export blocks, dropped it from the
pre-create mkdir (which would otherwise call mkdir with an empty arg),
and stopped creating the now-pointless empty lab/ dir.

Files changed (1) hide show
  1. start.sh +9 -6
start.sh CHANGED
@@ -568,7 +568,7 @@ mkdir -p /home/node/.openclaw/memory
568
  mkdir -p /home/node/.openclaw/extensions
569
  mkdir -p /home/node/.openclaw/workspace
570
  mkdir -p "$HC_WRITABLE_BASE/.local/bin" "$HC_WRITABLE_BASE/.local/lib" "$HC_WRITABLE_BASE/.npm-global"
571
- mkdir -p "$HC_WRITABLE_BASE/.jupyter" "$HC_WRITABLE_BASE/.local/share/jupyter" "$HC_WRITABLE_BASE/.local/share/jupyter/runtime" "$HC_WRITABLE_BASE/.local/share/jupyter/lab"
572
  chmod 700 /home/node/.openclaw
573
  chmod 700 /home/node/.openclaw/credentials
574
 
@@ -640,7 +640,9 @@ export PIP_USER="${PIP_USER:-1}"
640
  export JUPYTER_CONFIG_DIR="${JUPYTER_CONFIG_DIR:-$HC_WRITABLE_BASE/.jupyter}"
641
  export JUPYTER_DATA_DIR="${JUPYTER_DATA_DIR:-$HC_WRITABLE_BASE/.local/share/jupyter}"
642
  export JUPYTER_RUNTIME_DIR="${JUPYTER_RUNTIME_DIR:-$HC_WRITABLE_BASE/.local/share/jupyter/runtime}"
643
- export JUPYTERLAB_DIR="${JUPYTERLAB_DIR:-$HC_WRITABLE_BASE/.local/share/jupyter/lab}"
 
 
644
  export JUPYTERLAB_SETTINGS_DIR="${JUPYTERLAB_SETTINGS_DIR:-$JUPYTER_CONFIG_DIR/lab/user-settings}"
645
  export JUPYTERLAB_WORKSPACES_DIR="${JUPYTERLAB_WORKSPACES_DIR:-$JUPYTER_CONFIG_DIR/lab/workspaces}"
646
  export JUPYTER_PREFER_ENV_PATH="${JUPYTER_PREFER_ENV_PATH:-0}"
@@ -1799,8 +1801,9 @@ start_jupyter_once() {
1799
  fi
1800
  fi
1801
 
1802
- # Pre-create runtime directory
1803
- mkdir -p "$JUPYTER_ROOT_DIR/.jupyter" "$JUPYTER_CONFIG_DIR" "$JUPYTER_DATA_DIR" "$JUPYTER_RUNTIME_DIR" "$JUPYTERLAB_DIR" "$JUPYTERLAB_SETTINGS_DIR" "$JUPYTERLAB_WORKSPACES_DIR"
 
1804
 
1805
  echo "Terminal : starting (root: $JUPYTER_ROOT_DIR)"
1806
  JUPYTER_LOG_FILE="/tmp/jupyterlab.log"
@@ -1819,7 +1822,7 @@ start_jupyter_once() {
1819
  export JUPYTER_CONFIG_DIR="${JUPYTER_CONFIG_DIR:-$HC_WRITABLE_BASE/.jupyter}"
1820
  export JUPYTER_DATA_DIR="${JUPYTER_DATA_DIR:-$HC_WRITABLE_BASE/.local/share/jupyter}"
1821
  export JUPYTER_RUNTIME_DIR="${JUPYTER_RUNTIME_DIR:-$HC_WRITABLE_BASE/.local/share/jupyter/runtime}"
1822
- export JUPYTERLAB_DIR="${JUPYTERLAB_DIR:-$HC_WRITABLE_BASE/.local/share/jupyter/lab}"
1823
  export JUPYTERLAB_SETTINGS_DIR="${JUPYTERLAB_SETTINGS_DIR:-$JUPYTER_CONFIG_DIR/lab/user-settings}"
1824
  export JUPYTERLAB_WORKSPACES_DIR="${JUPYTERLAB_WORKSPACES_DIR:-$JUPYTER_CONFIG_DIR/lab/workspaces}"
1825
  export JUPYTER_PREFER_ENV_PATH="${JUPYTER_PREFER_ENV_PATH:-0}"
@@ -1914,7 +1917,7 @@ export PIP_USER="${PIP_USER:-1}"
1914
  export JUPYTER_CONFIG_DIR="${JUPYTER_CONFIG_DIR:-$HC_WRITABLE_BASE/.jupyter}"
1915
  export JUPYTER_DATA_DIR="${JUPYTER_DATA_DIR:-$HC_WRITABLE_BASE/.local/share/jupyter}"
1916
  export JUPYTER_RUNTIME_DIR="${JUPYTER_RUNTIME_DIR:-$HC_WRITABLE_BASE/.local/share/jupyter/runtime}"
1917
- export JUPYTERLAB_DIR="${JUPYTERLAB_DIR:-$HC_WRITABLE_BASE/.local/share/jupyter/lab}"
1918
  export JUPYTERLAB_SETTINGS_DIR="${JUPYTERLAB_SETTINGS_DIR:-$JUPYTER_CONFIG_DIR/lab/user-settings}"
1919
  export JUPYTERLAB_WORKSPACES_DIR="${JUPYTERLAB_WORKSPACES_DIR:-$JUPYTER_CONFIG_DIR/lab/workspaces}"
1920
  export JUPYTER_PREFER_ENV_PATH="${JUPYTER_PREFER_ENV_PATH:-0}"
 
568
  mkdir -p /home/node/.openclaw/extensions
569
  mkdir -p /home/node/.openclaw/workspace
570
  mkdir -p "$HC_WRITABLE_BASE/.local/bin" "$HC_WRITABLE_BASE/.local/lib" "$HC_WRITABLE_BASE/.npm-global"
571
+ mkdir -p "$HC_WRITABLE_BASE/.jupyter" "$HC_WRITABLE_BASE/.local/share/jupyter" "$HC_WRITABLE_BASE/.local/share/jupyter/runtime"
572
  chmod 700 /home/node/.openclaw
573
  chmod 700 /home/node/.openclaw/credentials
574
 
 
640
  export JUPYTER_CONFIG_DIR="${JUPYTER_CONFIG_DIR:-$HC_WRITABLE_BASE/.jupyter}"
641
  export JUPYTER_DATA_DIR="${JUPYTER_DATA_DIR:-$HC_WRITABLE_BASE/.local/share/jupyter}"
642
  export JUPYTER_RUNTIME_DIR="${JUPYTER_RUNTIME_DIR:-$HC_WRITABLE_BASE/.local/share/jupyter/runtime}"
643
+ # NOTE: JUPYTERLAB_DIR must stay unset β€” it is JupyterLab's prebuilt application
644
+ # assets dir (shipped with the pip package), not a settings dir. Overriding it
645
+ # (as d085e58 did) breaks the UI with "application assets not found".
646
  export JUPYTERLAB_SETTINGS_DIR="${JUPYTERLAB_SETTINGS_DIR:-$JUPYTER_CONFIG_DIR/lab/user-settings}"
647
  export JUPYTERLAB_WORKSPACES_DIR="${JUPYTERLAB_WORKSPACES_DIR:-$JUPYTER_CONFIG_DIR/lab/workspaces}"
648
  export JUPYTER_PREFER_ENV_PATH="${JUPYTER_PREFER_ENV_PATH:-0}"
 
1801
  fi
1802
  fi
1803
 
1804
+ # Pre-create runtime directory. JUPYTERLAB_DIR is intentionally absent β€” it
1805
+ # is the system prebuilt assets dir, owned by the package, not user-writable.
1806
+ mkdir -p "$JUPYTER_ROOT_DIR/.jupyter" "$JUPYTER_CONFIG_DIR" "$JUPYTER_DATA_DIR" "$JUPYTER_RUNTIME_DIR" "$JUPYTERLAB_SETTINGS_DIR" "$JUPYTERLAB_WORKSPACES_DIR"
1807
 
1808
  echo "Terminal : starting (root: $JUPYTER_ROOT_DIR)"
1809
  JUPYTER_LOG_FILE="/tmp/jupyterlab.log"
 
1822
  export JUPYTER_CONFIG_DIR="${JUPYTER_CONFIG_DIR:-$HC_WRITABLE_BASE/.jupyter}"
1823
  export JUPYTER_DATA_DIR="${JUPYTER_DATA_DIR:-$HC_WRITABLE_BASE/.local/share/jupyter}"
1824
  export JUPYTER_RUNTIME_DIR="${JUPYTER_RUNTIME_DIR:-$HC_WRITABLE_BASE/.local/share/jupyter/runtime}"
1825
+ # JUPYTERLAB_DIR intentionally unset β€” see top-level env block.
1826
  export JUPYTERLAB_SETTINGS_DIR="${JUPYTERLAB_SETTINGS_DIR:-$JUPYTER_CONFIG_DIR/lab/user-settings}"
1827
  export JUPYTERLAB_WORKSPACES_DIR="${JUPYTERLAB_WORKSPACES_DIR:-$JUPYTER_CONFIG_DIR/lab/workspaces}"
1828
  export JUPYTER_PREFER_ENV_PATH="${JUPYTER_PREFER_ENV_PATH:-0}"
 
1917
  export JUPYTER_CONFIG_DIR="${JUPYTER_CONFIG_DIR:-$HC_WRITABLE_BASE/.jupyter}"
1918
  export JUPYTER_DATA_DIR="${JUPYTER_DATA_DIR:-$HC_WRITABLE_BASE/.local/share/jupyter}"
1919
  export JUPYTER_RUNTIME_DIR="${JUPYTER_RUNTIME_DIR:-$HC_WRITABLE_BASE/.local/share/jupyter/runtime}"
1920
+ # Do NOT override JUPYTERLAB_DIR β€” see top-level env block for the reason.
1921
  export JUPYTERLAB_SETTINGS_DIR="${JUPYTERLAB_SETTINGS_DIR:-$JUPYTER_CONFIG_DIR/lab/user-settings}"
1922
  export JUPYTERLAB_WORKSPACES_DIR="${JUPYTERLAB_WORKSPACES_DIR:-$JUPYTER_CONFIG_DIR/lab/workspaces}"
1923
  export JUPYTER_PREFER_ENV_PATH="${JUPYTER_PREFER_ENV_PATH:-0}"