`nb ls` occasionally hangs after not having used for awhile
I occasionally get an error where nb ls sometimes just shows the loading spinner indefinitely. This only seems to happen after I haven't used my computer/nb for awhile, although I admit I don't have a perfect way to reproduce this. On all subsequent runs after the first, nb ls works fine.
Here's uname -a:
Linux nixos 6.12.42 #1-NixOS SMP PREEMPT_DYNAMIC Fri Aug 15 10:14:14 UTC 2025 x86_64 GNU/Linux
and nb --version:
7.20.1
Thanks for the report. I don't know the cause yet. The spinner displays for git operations. If it's running before nb ls, that suggests it's likely trying to sync with a remote repo and somehow encountering an unexpected state. Currently, most error output from git is suppressed, but if you use the nb git sync command sometimes it will emit more output from git.
Can you confirm whether the notebook has a remote set (run: nb remote) and that NB_AUTO_SYNC is set to 1 (run: nb set get auto_sync)? Also, if possible, I recommend trying to run nb git sync some time after you haven't been using it to see whether any additional error output is emitted.
Interesting, nb remote did indeed have a remote set to a server that no longer exists, so that definitely could be involved. NB_AUTO_SYNC is set to 1 and nb git sync seems to hang indefinitely. So I wonder if nb ls is trying to do that the first time and abandoning it the second time.
I'll try removing the remote and seeing if that solves my issue. Thank you.
Thanks for the info. I'll have to take a closer look at the git error handling in nb and see if I can reproduce the issue in a test.