Debug output on user kernels? Trying to determine why widgets aren't displaying, looking for debug output

Is it possible to get advanced debug level output on a jupyter notebook run? I’m running a ipynb file from SpyCloud which generates its own GUI via widgets, but the notebook is failing to execute/run properly in JupyterHub and is instead just looking like it’s executed every line without error but widgets don’t display, and the web browser (Firefox) shows this in the console logs:

Failed to fetch ipywidgets through the “jupyter.widget.control” comm channel, fallback to fetching individual model state. Reason: Control comm was closed too early

… and this is the only reason I can think of which would cause widgets to fail.

I guess I have the same question about jupyterlab that we start via jupyterhub. In the journal I can only find output from jupyterhub, but not from the jupyterlabs that are started for the users.

In our case we had the problem that a python kernel was just not starting and we couldn’t figure out why because there was no log output anywhere.

What we finally did was starting the jupyterlab manually from the juypyterhub installation by /opt/jhub/bin/jupyter lab --debug --no-browser and then connect to it via the browser. I.e., we start the same jupyterlab as jupyterhub would do it. That might help you also perhaps…

But the question remains:
a) where does jupyterhub pipe the output from the notebooks/labs to and
b) is it possible to pass parameters to notebook/lab to add the --debug parameter?

It depends on your JupyterHub configuration, in particular which spawner you’ve configured. For example, the default spawner will result in the singleuser logs going to the same place as the main hub process, whereas if you’re using DockerSpawner or KubeSpawner the logs are handled by your container runtime.

You can set c.Spawner.args:

It works indeed. The “since the single-user server is an instance of jupyter notebook…” explains why and I just wasn’t aware of that before. So, thanks a lot!

Feels like you derailed my thread with a different issue, but this does answer my question about per-debug instances. Which didn’t help my original problem.

Sorry! I thought you were mainly asking about the debugging, not about why the widgets failed…

It was both, but this helped figure out the debugging part which didn’t yield anything. So that part is answered. As for the widgets now, well, I’ve opened up a separate thread for that one now as that’s the remaining issue.