Bokeh server could not open websocket (worked previously)

I have a panel app which is deployed on Azure and was working previously (up until a month ago).

However, when I try to open the web app now, it shows me a blank page.
After some investigation, I saw that the problem is due to the bokeh server not being able to open the websocket for the page.

We didn’t change any settings, nor the script for the app.

The startup command for the app looks as follows:
python -m panel serve app.py --address 0.0.0.0 --port 8000 --allow-websocket-origin=xxx.azurewebsites.net, with xxx the name of the web app.

Not sure what’s happening here, would appreciate some help.

**Update: after degrading back to bokeh version 2.4.2, app is working as expected again.

Did things stop working randomly or did things stop working coincident with an upgrade to 2.4.3? You had previously said there were “no changes” so the timeline details are not clear.

I’m not 100% sure. One day it was working, the next it wasn’t and we received the bokeh server errors. As it stopped working around the date of the release, I assumed it had something to do with it.

Our requirements.txt file is defined as follows:
Flask>=2.0,<=2.1.1
bokeh>=2.4.1
pandas>=1.3.4
panel>=0.13.1
param>=1.12.0
plotly>=5.7.0

I got it working again on Friday by setting the bokeh version == 2.4.2, however now it is again not working anymore, and gives me the same bokeh server error.

It is an issue that is only present for the deployed web app, when I run the app locally it works just fine. (same package versions as the stated above)

There are two logs of interest I think you will have to discover how to access:

  • The bokeh server console log. This will show whether the connections are making it past whatever prozy azure has in place, and if so, whether the bokeh server is deciding to refuse or drop the connection.

  • The azure proxy log. I am not sure what or where that is. But in my experience with other cloud services, it has been necessary to explicitly enable websocket connections to an an app or instance. Is there a problem there? Is some limit being hit after which connections are being dropped?

Edit:

Also, what does this mean, exactly

After some investigation, I saw that the problem is due to the bokeh server not being able to open the websocket for the page.

Browser JS logs? other logs? What specifically, and precisely did they say?

When I run the html inspect on the web page, I see following errors:

I’ll try to find the logs!

It seems like the Bokeh server is still running and servicing the initial HTTP request, but then the WS connection is never opening. Will definitely need the logs to determine whether the Bokeh server is rejecting the WS connection, or experiencing some internal error during session creation, or whether Azure is blocking the WS connection.