Skip to content

fix(jupyterlab): empty-positional-root-dir - #1027

Open
spapa013 wants to merge 1 commit into
coder:mainfrom
atlab:fix/jupyterlab-empty-positional-root-dir
Open

fix(jupyterlab): empty-positional-root-dir#1027
spapa013 wants to merge 1 commit into
coder:mainfrom
atlab:fix/jupyterlab-empty-positional-root-dir

Conversation

@spapa013

@spapa013 spapa013 commented Jul 24, 2026

Copy link
Copy Markdown

Description

The JupyterLab module's run.sh builds the launch command with a
BASE_URL_FLAG variable that is only set when base_url is non-empty.
With subdomain = true, base_url is empty, so the flag expands to an
empty argument. Jupyter reads that empty argument as a positional (the
directory to open), which overrides ServerApp.root_dir — so a
user-configured root_dir is silently ignored.

This drops BASE_URL_FLAG and passes --ServerApp.base_url=${BASE_URL}
inline. An empty value normalizes to / and is never treated as a
positional, so root_dir is respected in both the subdomain and
path-based cases.

Type of Change

  • Bug fix

Module Information

Path: registry/coder/modules/jupyterlab
New version: v1.2.3
Breaking change: No

Testing & Validation

  • Changes tested locally (Coder workspace, subdomain routing: launch
    line shows --ServerApp.base_url= with no empty positional, and
    root_dir is honored)

Related Issues

Closes #1026

Comment on lines 22 to 25

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change

printf "check logs at ${LOG_PATH}"
$JUPYTER --no-browser \
"$BASE_URL_FLAG" \
$BASE_URL_FLAG \

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
$BASE_URL_FLAG \
--ServerApp.base_url=${BASE_URL} \

may be drop BASE_URL_FLAG altogether and directly pass BASE_URL?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good call — done. Dropped BASE_URL_FLAG and now pass
--ServerApp.base_url=${BASE_URL} inline. Verified locally in a subdomain
workspace.

@spapa013
spapa013 force-pushed the fix/jupyterlab-empty-positional-root-dir branch from 0471e54 to 7e29fb4 Compare July 27, 2026 13:36
@matifali
matifali requested a review from 35C4n0r July 27, 2026 13:53
@matifali matifali changed the title registry:fix/jupyterlab-empty-positional-root-dir fix(jupyterlab): empty-positional-root-dir Jul 27, 2026
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

Successfully merging this pull request may close these issues.

jupyterlab: empty base_url passes an empty positional arg that overrides ServerApp.root_dir (subdomain = true)

2 participants