☰Read-only archive⌕
Looking for help with Bokeh?

This is a read-only archive. Ask questions and join the conversation on GitHub.

Visit Community Support on GitHub →
Archived discussions · Captured October 28, 2026

How to prevent creation of a session on server start?

Community Support
Harm
Harm

When I start Bokeh with “bokeh serve DirName --show” I find that session_created is executed twice: once for the --show and once for the server startup.

The one for the server startup does however not make sense in the our use case where we want to see the app only from a web browser.

I tried to skip running on_session_created in the first pass, but then Bokeh raises an error as it still tries to fill in the session document.

Any ideas?

⌁   Link to post
Bryan
Bryan

I’m going to assume you are referring to the fact that Bokeh creates a session on the initial HTTP connect, and then, if the subsequent WS connection lands on a different process, then the session creation has to happen again (because the new process does not have access to the session created on the HTTP connect). That’s simply the way the Bokeh server currently operates. Making it do something different would require new feature development work. In particular, there are parts of the session document that are needed as early as the HTTP connect (e.g. any custom template for sure) so some mechanism would have to be found to allow access to that information without a “complete” session execution.

⌁   Link to post

End of archived discussion · Replies are disabled