Issue connecting with bokeh serve under 3.2.0

Hello,

There seems to be an issue with bokeh serve under 3.2.0 and using an origin other than localhost.

I was contemplating to migrating to 3.2.0 from a bokeh version, and it failed at loading page, failing to load bokeh resources with a “ERR_CONNECTION_REFUSED”.

After trying different combinations I narrowed it specifically to 3.2.0 release.

Context :

  • Any application relying on --allow-websocket-origin=
  • Tornado 5.1 (or 6.x was also tested, with same outcome)
  • Python 3.9
  • Pattern under 3.1.0:

Application working, with:

Hovering on the js link, I get the full address from where he fetched it, and it is the host indicated in websocket-origin

And everything works.

  • Pattern in 3.2.0 (just calling python3 -m pip install bokeh==3.2.0 in between)

Application fails to load, without log on bokeh serve side, and with a fetch resources error on browser console side:

image

As you can see, he seemed to have not forwarded the request to the websocket origin, but instead went on with ‘localhost’, hence the fail.

2 additional checks:

  • Opening the app from a browser on the app host machine works, as the localhost request for resources logically works there.
  • Taking the resource request address e.g. http://localhost:12007/static/js/bokeh.min.js?v=c836b057bc9b401d63918fcc71d81351 , replacing localhost by the right remote websocket origin, and trying to open it directly in browser works, it returns the script. So with the right address the server let it through ok.

So it seems to me there was a regression in 3.2.0, with the resource request not being forwarded anymore to the websocket origin host.

What do you think ?

Thanks in advance,
Damien

Hello,

The issue arises really with any app. Sufficient reproducer:

from bokeh.models.widgets import Div
from bokeh.io import curdoc
curdoc().add_root(Div(text="test"))

launched using the --allow-websocket-origin argument

Would you have an idea ?
Thanks in advance,
Damien

@damien.thillou please file a bug report with full details: GitHub Issue

That’s done, thanks

1 Like

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.