traitlets
traitlets copied to clipboard
traitlets.py Type validate method ate what would have been a valuable error message to see
traitlets.py has a Type class with a validate method.
If this validate method fails, it just raises the error "must be a type".
I was trying to start Jupyter with a custom login class, and I would keep getting this error when trying to start Jupyter.
It turns out that the specific conda environment had problems, and I had to manually changed the traitlets.py code to except error as e, then raise an error of str(e). On then did I finally see what the root cause of the problem was in my logs.
Would it be possible to append a string output of the specific error so we can save everyone some troubleshooting/debugging time?
This seems like it's really only a problem in Python 2 since by default Python 3 will now show all exceptions that occurred in the stack. My suggestion would be to upgrade to Python 3 (if possible).
However, if you're working in Python 3 and it's still hiding the underlying error, then it's probably a problem with how the error is getting logged in the Jupyter application itself since this sort of failure should be at the ERROR logging level.
It's something inside Jupyter that is deciding what level of error it is, I guess.
[2019-11-29 09:51:51] Starting Jupyter Enterprisegateway.
[2019-11-29 09:51:52] Jupyter Enterprise Gateway started at https://hostname:####.
[C 09:51:53.141 NotebookApp] Bad config encountered during initialization:
[C 09:51:53.141 NotebookApp] The 'login_handler_class' trait of <notebook.notebookapp.NotebookApp object at 0x1000036c25c0> instance must be a type, but 'notebook.auth.loginauth.LoginHandler' could not be imported
Note: I haven't started running any application inside Jupyter yet - this is just starting a Jupyter instance.
EDIT: Yes, it was Python 3.
@rmorshea , based on the above information, would you say that the problem is likely because Jupyter code is not logging at an ERROR level? (i.e., I should be going to Jupyter to submit an issue?)
@stevehaertel since it's already logging the message I don't think changing the level will do anything. Jupyter is just suppressing the traceback even though it should have access to it. You could try using jupyter notebook --debug but as I said I don't expect that to work.
Post a message here and see if anyone can help: https://gitter.im/jupyter/jupyter