ncar-xdev / jupyter-forward

Launch Jupyter Lab over SSH with a single command!
https://jupyter-forward.readthedocs.io/
Apache License 2.0
31 stars 12 forks source link

Launching jupyter lab fails silently #146

Open andersy005 opened 2 years ago

andersy005 commented 2 years ago

When verifying the existing of jupyter in user's environment, we rely on this command: https://github.com/ncar-xdev/jupyter-forward/blob/64a2c56405f781c0f40f2221aecb2708d80d7efb/jupyter_forward/core.py#L218

However, this command isn't robust enough because having jupyter install doesn't necessary mean that jupyterlab is also installed.

Due to this, when user's have jupyter installed and jupyterlab is not installed, this command

https://github.com/ncar-xdev/jupyter-forward/blob/64a2c56405f781c0f40f2221aecb2708d80d7efb/jupyter_forward/core.py#L187

when combined with the file redirection fails silently

/bin/bash -c "source activate environment && jupyter lab --no-browser --ip=casper-login1 > None/.jupyter_forward/log_2022-03-11T15-36-40.txt 2>&1"

We should look into more robust ways to check that jupyter lab is installed and not just jupyter

kmpaul commented 2 years ago

Are you checking the exit codes of the above commands? That might tell you if the commands succeeded or failed. You might also check if certain commands are actually working in sequence, such as first calling:

source activate environment

And checking the exit code to see if the command succeeded. If that doesn't succeed, then presumably the environment is missing or broken, which could be the source of the error. If that command succeeds, then try:

source activate environment && jupyter lab --help

And if that command succeeds, then presumably jupyter lab is installed.