Traceback content different on mac and linux for server errors

I do my development on a MacBook Pro, and when I have an error in a callback in my server app, I get a Javascript error message to my console, eg:

2019-12-11 10:59:04,070 error handling message Message ‘PATCH-DOC’ (revision 1) content: {‘events’: [{‘kind’: ‘ModelChanged’, ‘model’: {‘type’: ‘Selection’, ‘id’: ‘1413’}, ‘attr’: ‘indices’, ‘new’: }], ‘references’: }: IndexError(‘list index out of range’,)

A colleague of mine ran it on his RHEL7 machine and got a “normal” traceback, like (this may not be the same error, but gives the flavour):

File “heatmap/EO-plotsDisplays/python/renderFocalPlane.py”, line 529, in get_raft_content
for raft in range(len(raft_list)):
UnboundLocalError: local variable ‘raft_list’ referenced before assignment

That was so much more useful! Is there a flag or something to get this form of traceback on the Mac?

This is with bokeh 1.2.

Thanks,

Richard

@richardxdubois As of Bokeh 1.4 or later, a stack trace is now always emitted in this situation (see #9203). With earlier versions you will need to set the log level to "debug" in order to see that particular stack trace.

However, please also understand that the two situations above are different. In your colleague’s case, the exception was generated by their code, and the stack trace that is generated and printed in the Bokeh server console logs will always just point directly to the code they wrote that caused the exception. But your first message is not that at all. That is an exception generated by by the Bokeh server itself, because it encountered an issue while handling a protocol message. There are multiple potential avenues to that circumstance, and not all of them start with Python code. I.e. the ultimate source of the problem could originate from a user interaction or JavaScript code the browser, in which case a useful stack trace simply may not exist.

Thanks, Bryan. Super. I’ll update to 1.4!

For the linux vs mac - we were running the same code. And I think we were seeing the same error. Ah. He was using 1.4 (or whatever the latest is now), since he did a fresh install of bokeh.

Richard