Embedded Bokeh Server within Flask + Apache+Ubuntu

Hello
I am currently deploying a flask app with an embedded bokeh server on apache over ubuntu, but I have some issues:

If I define a proxy in apache, bokeh server responds ok rendering an html with all the charts, tables and widgets but without the flask app layout, it bypasses the flask app! .

If I do not define a proxy/reverseproxy in apache , I get either a "Failed to load resource: net::ERR_CONNECTION_TIMED_OUT " if I use my server IP in the url when calling server_document:

 
@bokehs.route("/bokeh", methods=[‘GET’])
@login_required
def bokeh():
   script = server_document(url=‘http://52.251.xxx.xxx:5006/bkapp’)
   return render_template(“embed.html”, script=script)

if I use instead 127.0.0.1 or localhost in script = server_document(url=‘http://127.0.0.1:5006/bkapp’) , I get the error :

bokeh:74 GET http://localhost:5006/bkapp/autoload.js?bokeh-autoload-element=1325&bokeh-app-path=/bkapp&bokeh-absolute-url=http://localhost:5006/bkapp net::ERR_CONNECTION_REFUSED

These are the two functions I use in order to define my embedded bokeh server within flask:

 
def bk_worker():
  server = Server(
      {’/bkapp’: run,
       ‘/grafos’: run_grafos
      },
     io_loop=IOLoop(),
     port=5006,
     allow_websocket_origin=["*"]
  )
 server.start()
 server.io_loop.start()

def create_app(config_class=Config):
    app = Flask(name)
    app.config.from_object(Config)
    db.init_app(app)
  bcrypt.init_app(app)
  login_manager.init_app(app)
  mail.init_app(app)

  from mutabis.bokeh.routes import bokehs
  from mutabis.users.routes import users

  app.register_blueprint(bokehs)
  app.register_blueprint(users)

  Thread(target=bk_worker).start()
  return app

the init.py file is :

 
from mutabis import create_app

app = create_app()

if __name__ == '__main__':
    app.run(debug=True)


I will appreciate any help or hint you could give me to solve this issue

Thanks

If the Bokeh server is refusing there connection there should be a console log message that has more information about why. If embedding as a library you may need to call bokeh.util.logging.basicConfig (not sure tho will have to just try)

Hello Bryan

On my local virtual environment ( flask with bokeh server as a library ) everything works fine, but when I deploy the flask app on apache-ubuntu I get the connection refused error as mentioned above.
I followed your suggestion and activated flask and bokeh logging. This is the file output I get:


11-23 20:46:48] p10249 {/var/www/html/mutabis/mutabis/__init__.py:119} INFO - Logging is set up.
[2020-11-23 20:46:48,867] p10249 {/var/www/html/mutabis/mutabis/__init__.py:119} INFO - Logging is set up.
[2020-11-23 20:46:49,019] p10249 {/usr/lib/python3.6/asyncio/selector_events.py:54} DEBUG - Using selector: EpollSelector
[2020-11-23 20:46:49,028] p10249 {/usr/local/lib/python3.6/dist-packages/bokeh/server/server.py:372} INFO - Starting Bokeh server version 2.2.3 (running on Tornado 6.1)
[2020-11-23 20:46:49,029] p10249 {/usr/local/lib/python3.6/dist-packages/bokeh/server/util.py:135} WARNING - Host wildcard '*' will allow connections originating from multiple (or possibly all) hostnames or IPs. Use non-wildcar
d values to restrict access explicitly
[2020-11-23 20:46:49,039] p10249 {/usr/local/lib/python3.6/dist-packages/bokeh/server/tornado.py:308} INFO - User authentication hooks NOT provided (default user enabled)
[2020-11-23 20:46:49,039] p10249 {/usr/local/lib/python3.6/dist-packages/bokeh/server/tornado.py:338} DEBUG - These host origins can connect to the websocket: ['*']
[2020-11-23 20:46:49,040] p10249 {/usr/local/lib/python3.6/dist-packages/bokeh/server/tornado.py:392} DEBUG - Patterns are:
[2020-11-23 20:46:49,041] p10249 {/usr/local/lib/python3.6/dist-packages/bokeh/server/tornado.py:394} DEBUG -   [('/bkapp/?',
[2020-11-23 20:46:49,041] p10249 {/usr/local/lib/python3.6/dist-packages/bokeh/server/tornado.py:394} DEBUG -     ,
[2020-11-23 20:46:49,041] p10249 {/usr/local/lib/python3.6/dist-packages/bokeh/server/tornado.py:394} DEBUG -     {'application_context': ,
[2020-11-23 20:46:49,041] p10249 {/usr/local/lib/python3.6/dist-packages/bokeh/server/tornado.py:394} DEBUG -      'bokeh_websocket_path': '/bkapp/ws'}),
[2020-11-23 20:46:49,041] p10249 {/usr/local/lib/python3.6/dist-packages/bokeh/server/tornado.py:394} DEBUG -    ('/bkapp/ws',
[2020-11-23 20:46:49,041] p10249 {/usr/local/lib/python3.6/dist-packages/bokeh/server/tornado.py:394} DEBUG -     ,
[2020-11-23 20:46:49,041] p10249 {/usr/local/lib/python3.6/dist-packages/bokeh/server/tornado.py:394} DEBUG -     {'application_context': ,
[2020-11-23 20:46:49,042] p10249 {/usr/local/lib/python3.6/dist-packages/bokeh/server/tornado.py:394} DEBUG -      'bokeh_websocket_path': '/bkapp/ws'}),
[2020-11-23 20:46:49,042] p10249 {/usr/local/lib/python3.6/dist-packages/bokeh/server/tornado.py:394} DEBUG -    ('/bkapp/metadata',
[2020-11-23 20:46:49,042] p10249 {/usr/local/lib/python3.6/dist-packages/bokeh/server/tornado.py:394} DEBUG -     ,
[2020-11-23 20:46:49,042] p10249 {/usr/local/lib/python3.6/dist-packages/bokeh/server/tornado.py:394} DEBUG -     {'application_context': ,
[2020-11-23 20:46:49,042] p10249 {/usr/local/lib/python3.6/dist-packages/bokeh/server/tornado.py:394} DEBUG -      'bokeh_websocket_path': '/bkapp/ws'}),
[2020-11-23 20:46:49,042] p10249 {/usr/local/lib/python3.6/dist-packages/bokeh/server/tornado.py:394} DEBUG -    ('/bkapp/autoload.js',
[2020-11-23 20:46:49,042] p10249 {/usr/local/lib/python3.6/dist-packages/bokeh/server/tornado.py:394} DEBUG -     ,
[2020-11-23 20:46:49,042] p10249 {/usr/local/lib/python3.6/dist-packages/bokeh/server/tornado.py:394} DEBUG -     {'application_context': ,
[2020-11-23 20:46:49,042] p10249 {/usr/local/lib/python3.6/dist-packages/bokeh/server/tornado.py:394} DEBUG -      'bokeh_websocket_path': '/bkapp/ws'}),
[2020-11-23 20:46:49,042] p10249 {/usr/local/lib/python3.6/dist-packages/bokeh/server/tornado.py:394} DEBUG -    ('/grafos/?',
[2020-11-23 20:46:49,042] p10249 {/usr/local/lib/python3.6/dist-packages/bokeh/server/tornado.py:394} DEBUG -     ,
[2020-11-23 20:46:49,042] p10249 {/usr/local/lib/python3.6/dist-packages/bokeh/server/tornado.py:394} DEBUG -     {'application_context': ,
[2020-11-23 20:46:49,048] p10249 {/usr/local/lib/python3.6/dist-packages/bokeh/server/tornado.py:394} DEBUG -      'bokeh_websocket_path': '/grafos/ws'}),
[2020-11-23 20:46:49,067] p10249 {/usr/local/lib/python3.6/dist-packages/bokeh/server/tornado.py:394} DEBUG -    ('/grafos/ws',
[2020-11-23 20:46:49,067] p10249 {/usr/local/lib/python3.6/dist-packages/bokeh/server/tornado.py:394} DEBUG -     ,
[2020-11-23 20:46:49,067] p10249 {/usr/local/lib/python3.6/dist-packages/bokeh/server/tornado.py:394} DEBUG -     {'application_context': ,
[2020-11-23 20:46:49,067] p10249 {/usr/local/lib/python3.6/dist-packages/bokeh/server/tornado.py:394} DEBUG -      'bokeh_websocket_path': '/grafos/ws'}),
[2020-11-23 20:46:49,067] p10249 {/usr/local/lib/python3.6/dist-packages/bokeh/server/tornado.py:394} DEBUG -    ('/grafos/metadata',
[2020-11-23 20:46:49,067] p10249 {/usr/local/lib/python3.6/dist-packages/bokeh/server/tornado.py:394} DEBUG -     ,
[2020-11-23 20:46:49,067] p10249 {/usr/local/lib/python3.6/dist-packages/bokeh/server/tornado.py:394} DEBUG -     {'application_context': ,
[2020-11-23 20:46:49,067] p10249 {/usr/local/lib/python3.6/dist-packages/bokeh/server/tornado.py:394} DEBUG -      'bokeh_websocket_path': '/grafos/ws'}),
[2020-11-23 20:46:49,067] p10249 {/usr/local/lib/python3.6/dist-packages/bokeh/server/tornado.py:394} DEBUG -    ('/grafos/autoload.js',
[2020-11-23 20:46:49,067] p10249 {/usr/local/lib/python3.6/dist-packages/bokeh/server/tornado.py:394} DEBUG -     ,
[2020-11-23 20:46:49,068] p10249 {/usr/local/lib/python3.6/dist-packages/bokeh/server/tornado.py:394} DEBUG -     {'application_context': ,
[2020-11-23 20:46:49,068] p10249 {/usr/local/lib/python3.6/dist-packages/bokeh/server/tornado.py:394} DEBUG -      'bokeh_websocket_path': '/grafos/ws'}),
[2020-11-23 20:46:49,068] p10249 {/usr/local/lib/python3.6/dist-packages/bokeh/server/tornado.py:394} DEBUG -    ('/?',
[2020-11-23 20:46:49,068] p10249 {/usr/local/lib/python3.6/dist-packages/bokeh/server/tornado.py:394} DEBUG -     ,
[2020-11-23 20:46:49,068] p10249 {/usr/local/lib/python3.6/dist-packages/bokeh/server/tornado.py:394} DEBUG -     {'applications': {'/bkapp': ,
[2020-11-23 20:46:49,068] p10249 {/usr/local/lib/python3.6/dist-packages/bokeh/server/tornado.py:394} DEBUG -                       '/grafos': },
[2020-11-23 20:46:49,068] p10249 {/usr/local/lib/python3.6/dist-packages/bokeh/server/tornado.py:394} DEBUG -      'index': None,
[2020-11-23 20:46:49,068] p10249 {/usr/local/lib/python3.6/dist-packages/bokeh/server/tornado.py:394} DEBUG -      'prefix': '',
[2020-11-23 20:46:49,068] p10249 {/usr/local/lib/python3.6/dist-packages/bokeh/server/tornado.py:394} DEBUG -      'use_redirect': True}),
[2020-11-23 20:46:49,068] p10249 {/usr/local/lib/python3.6/dist-packages/bokeh/server/tornado.py:394} DEBUG -    ('/static/extensions/(.*)',
[2020-11-23 20:46:49,068] p10249 {/usr/local/lib/python3.6/dist-packages/bokeh/server/tornado.py:394} DEBUG -     ,
[2020-11-23 20:46:49,068] p10249 {/usr/local/lib/python3.6/dist-packages/bokeh/server/tornado.py:394} DEBUG -     {'root': {}}),
[2020-11-23 20:46:49,068] p10249 {/usr/local/lib/python3.6/dist-packages/bokeh/server/tornado.py:394} DEBUG -    ('/static/(.*)',
[2020-11-23 20:46:49,068] p10249 {/usr/local/lib/python3.6/dist-packages/bokeh/server/tornado.py:394} DEBUG -     )]
[11-23 20:46:52] p10248 {/var/www/html/mutabis/mutabis/__init__.py:119} INFO - Logging is set up.
[2020-11-23 20:46:52,977] p10248 {/var/www/html/mutabis/mutabis/__init__.py:119} INFO - Logging is set up.
[2020-11-23 20:46:53,088] p10248 {/usr/lib/python3.6/asyncio/selector_events.py:54} DEBUG - Using selector: EpollSelector
[2020-11-23 20:46:53,089] p10248 {/usr/local/lib/python3.6/dist-packages/bokeh/server/server.py:372} INFO - Starting Bokeh server version 2.2.3 (running on Tornado 6.1)
[2020-11-23 20:47:04,085] p10249 {/usr/local/lib/python3.6/dist-packages/bokeh/server/tornado.py:658} DEBUG - [pid 10249] 0 clients connected
[2020-11-23 20:47:04,085] p10249 {/usr/local/lib/python3.6/dist-packages/bokeh/server/tornado.py:666} DEBUG - [pid 10249]   /bkapp has 0 sessions with 0 unused
[2020-11-23 20:47:04,085] p10249 {/usr/local/lib/python3.6/dist-packages/bokeh/server/tornado.py:666} DEBUG - [pid 10249]   /grafos has 0 sessions with 0 unused
[2020-11-23 20:47:19,084] p10249 {/usr/local/lib/python3.6/dist-packages/bokeh/server/tornado.py:658} DEBUG - [pid 10249] 0 clients connected
[2020-11-23 20:47:19,085] p10249 {/usr/local/lib/python3.6/dist-packages/bokeh/server/tornado.py:666} DEBUG - [pid 10249]   /bkapp has 0 sessions with 0 unused
[2020-11-23 20:47:19,085] p10249 {/usr/local/lib/python3.6/dist-packages/bokeh/server/tornado.py:666} DEBUG - [pid 10249]   /grafos has 0 sessions with 0 unused
[2020-11-23 20:47:34,078] p10249 {/usr/local/lib/python3.6/dist-packages/bokeh/server/tornado.py:658} DEBUG - [pid 10249] 0 clients connected
[2020-11-23 20:47:34,078] p10249 {/usr/local/lib/python3.6/dist-packages/bokeh/server/tornado.py:666} DEBUG - [pid 10249]   /bkapp has 0 sessions with 0 unused
[2020-11-23 20:47:34,078] p10249 {/usr/local/lib/python3.6/dist-packages/bokeh/server/tornado.py:666} DEBUG - [pid 10249]   /grafos has 0 sessions with 0 unused
[2020-11-23 20:47:49,079] p10249 {/usr/local/lib/python3.6/dist-packages/bokeh/server/tornado.py:658} DEBUG - [pid 10249] 0 clients connected
[2020-11-23 20:47:49,079] p10249 {/usr/local/lib/python3.6/dist-packages/bokeh/server/tornado.py:666} DEBUG - [pid 10249]   /bkapp has 0 sessions with 0 unused
[2020-11-23 20:47:49,080] p10249 {/usr/local/lib/python3.6/dist-packages/bokeh/server/tornado.py:666} DEBUG - [pid 10249]   /grafos has 0 sessions with 0 unused
[2020-11-23 20:48:04,071] p10249 {/usr/local/lib/python3.6/dist-packages/bokeh/server/tornado.py:658} DEBUG - [pid 10249] 0 clients connected
[2020-11-23 20:48:04,071] p10249 {/usr/local/lib/python3.6/dist-packages/bokeh/server/tornado.py:666} DEBUG - [pid 10249]   /bkapp has 0 sessions with 0 unused
[2020-11-23 20:48:04,071] p10249 {/usr/local/lib/python3.6/dist-packages/bokeh/server/tornado.py:666} DEBUG - [pid 10249]   /grafos has 0 sessions with 0 unused
[2020-11-23 21:20:19,074] p10249 {/usr/local/lib/python3.6/dist-packages/bokeh/server/tornado.py:666} DEBUG - [pid 10249]   /bkapp has 0 sessions with 0 unused
[2020-11-23 21:20:19,074] p10249 {/usr/local/lib/python3.6/dist-packages/bokeh/server/tornado.py:666} DEBUG - [pid 10249]   /grafos has 0 sessions with 0 unused
[11-23 21:21:24] p10646 {/var/www/html/mutabis/mutabis/__init__.py:122} INFO - Logging is set up.
[2020-11-23 21:21:24,184] p10646 {/var/www/html/mutabis/mutabis/__init__.py:122} INFO - Logging is set up.
[11-23 21:21:38] p10647 {/var/www/html/mutabis/mutabis/__init__.py:122} INFO - Logging is set up.
[2020-11-23 21:21:38,435] p10647 {/var/www/html/mutabis/mutabis/__init__.py:122} INFO - Logging is set up.

 

I do not see any type of error at the server side …it seems to be more related to front-end issue, websockects maybe

if I compare this log to the one generated on my local env , I noticed there are some differences in some lines :
for instance the following lines do not appear in the log file generated on the ubuntu apache server :


2020-11-23 15:49:59,996] p12212 {/usr/local/lib/python3.8/site-packages/tornado/web.py:2239} INFO - 200 GET /bkapp/autoload.js?bokeh-autoload-element=1001&bokeh-app-path=/bkapp&bokeh-absolute-url=http://localhost:5006/bkapp (::1) 1747.48ms
[2020-11-23 15:50:00,045] p12212 {/usr/local/lib/python3.8/site-packages/bokeh/server/views/ws.py:154} DEBUG - Subprotocol header received
[2020-11-23 15:50:00,046] p12212 {/usr/local/lib/python3.8/site-packages/tornado/web.py:2239} INFO - 101 GET /bkapp/ws (::1) 0.56ms
[2020-11-23 15:50:00,046] p12212 {/usr/local/lib/python3.8/site-packages/bokeh/server/views/ws.py:120} INFO - WebSocket connection opened
[2020-11-23 15:50:00,046] p12212 {/usr/local/lib/python3.8/site-packages/bokeh/server/views/ws.py:187} DEBUG - Receiver created for Protocol()
[2020-11-23 15:50:00,046] p12212 {/usr/local/lib/python3.8/site-packages/bokeh/server/views/ws.py:190} DEBUG - ProtocolHandler created for Protocol()
[2020-11-23 15:50:00,046] p12212 {/usr/local/lib/python3.8/site-packages/bokeh/server/views/ws.py:193} INFO - ServerConnection created
[2020-11-23 15:50:00,048] p12212 {/usr/local/lib/python3.8/site-packages/bokeh/server/session.py:231} DEBUG - Sending pull-doc-reply from session '03P7Q1i2Bc0RDOO5tiapVDFFj8tZca97eItwWye1FaI0'

  

this is the log file generated on my local env where the bokhe server as library works fine in flask app



.[11-23 15:49:40] p12212 {/Users/humbertozuluaga/Documents/PROYECTOS/PythonProjects/mutabis/mutabis/__init__.py:119} INFO - Logging is set up.
[2020-11-23 15:49:40,039] p12212 {/Users/humbertozuluaga/Documents/PROYECTOS/PythonProjects/mutabis/mutabis/__init__.py:119} INFO - Logging is set up.
[11-23 15:49:40] p12212 {/Users/humbertozuluaga/Documents/PROYECTOS/PythonProjects/mutabis/mutabis/__init__.py:123} INFO - creó la app!!
[2020-11-23 15:49:40,040] p12212 {/Users/humbertozuluaga/Documents/PROYECTOS/PythonProjects/mutabis/mutabis/__init__.py:123} INFO - creó la app!!
[2020-11-23 15:49:40,073] p12212 {/usr/local/Cellar/[email protected]/3.8.5/Frameworks/Python.framework/Versions/3.8/lib/python3.8/asyncio/selector_events.py:59} DEBUG - Using selector: KqueueSelector
[2020-11-23 15:49:40,073] p12212 {/usr/local/lib/python3.8/site-packages/bokeh/server/server.py:372} INFO - Starting Bokeh server version 2.2.3 (running on Tornado 6.1)
[2020-11-23 15:49:40,074] p12212 {/usr/local/lib/python3.8/site-packages/bokeh/server/util.py:132} WARNING - Host wildcard '*' will allow connections originating from multiple (or possibly all) hostnames or IPs. Use non-wildcard values to restrict access explicitly
[2020-11-23 15:49:40,082] p12212 {/usr/local/lib/python3.8/site-packages/werkzeug/_internal.py:113} INFO -  * Running on http://127.0.0.1:5000/ (Press CTRL+C to quit)
[2020-11-23 15:49:40,083] p12212 {/usr/local/lib/python3.8/site-packages/werkzeug/_internal.py:113} INFO -  * Restarting with stat
[2020-11-23 15:49:40,085] p12212 {/usr/local/lib/python3.8/site-packages/bokeh/server/tornado.py:308} INFO - User authentication hooks NOT provided (default user enabled)
[2020-11-23 15:49:40,085] p12212 {/usr/local/lib/python3.8/site-packages/bokeh/server/tornado.py:338} DEBUG - These host origins can connect to the websocket: ['*']
[2020-11-23 15:49:40,086] p12212 {/usr/local/lib/python3.8/site-packages/bokeh/server/tornado.py:392} DEBUG - Patterns are:
[2020-11-23 15:49:40,086] p12212 {/usr/local/lib/python3.8/site-packages/bokeh/server/tornado.py:394} DEBUG -   [('/bkapp/?',
[2020-11-23 15:49:40,086] p12212 {/usr/local/lib/python3.8/site-packages/bokeh/server/tornado.py:394} DEBUG -     ,
[2020-11-23 15:49:40,086] p12212 {/usr/local/lib/python3.8/site-packages/bokeh/server/tornado.py:394} DEBUG -     {'application_context': ,
[2020-11-23 15:49:40,086] p12212 {/usr/local/lib/python3.8/site-packages/bokeh/server/tornado.py:394} DEBUG -      'bokeh_websocket_path': '/bkapp/ws'}),
[2020-11-23 15:49:40,086] p12212 {/usr/local/lib/python3.8/site-packages/bokeh/server/tornado.py:394} DEBUG -    ('/bkapp/ws',
[2020-11-23 15:49:40,087] p12212 {/usr/local/lib/python3.8/site-packages/bokeh/server/tornado.py:394} DEBUG -     ,
[2020-11-23 15:49:40,087] p12212 {/usr/local/lib/python3.8/site-packages/bokeh/server/tornado.py:394} DEBUG -     {'application_context': ,
[2020-11-23 15:49:40,087] p12212 {/usr/local/lib/python3.8/site-packages/bokeh/server/tornado.py:394} DEBUG -      'bokeh_websocket_path': '/bkapp/ws'}),
[2020-11-23 15:49:40,087] p12212 {/usr/local/lib/python3.8/site-packages/bokeh/server/tornado.py:394} DEBUG -    ('/bkapp/metadata',
[2020-11-23 15:49:40,087] p12212 {/usr/local/lib/python3.8/site-packages/bokeh/server/tornado.py:394} DEBUG -     ,
[2020-11-23 15:49:40,087] p12212 {/usr/local/lib/python3.8/site-packages/bokeh/server/tornado.py:394} DEBUG -     {'application_context': ,
[2020-11-23 15:49:40,087] p12212 {/usr/local/lib/python3.8/site-packages/bokeh/server/tornado.py:394} DEBUG -      'bokeh_websocket_path': '/bkapp/ws'}),
[2020-11-23 15:49:40,087] p12212 {/usr/local/lib/python3.8/site-packages/bokeh/server/tornado.py:394} DEBUG -    ('/bkapp/autoload.js',
[2020-11-23 15:49:40,087] p12212 {/usr/local/lib/python3.8/site-packages/bokeh/server/tornado.py:394} DEBUG -     ,
[2020-11-23 15:49:40,087] p12212 {/usr/local/lib/python3.8/site-packages/bokeh/server/tornado.py:394} DEBUG -     {'application_context': ,
[2020-11-23 15:49:40,087] p12212 {/usr/local/lib/python3.8/site-packages/bokeh/server/tornado.py:394} DEBUG -      'bokeh_websocket_path': '/bkapp/ws'}),
[2020-11-23 15:49:40,087] p12212 {/usr/local/lib/python3.8/site-packages/bokeh/server/tornado.py:394} DEBUG -    ('/grafos/?',
[2020-11-23 15:49:40,087] p12212 {/usr/local/lib/python3.8/site-packages/bokeh/server/tornado.py:394} DEBUG -     ,
[2020-11-23 15:49:40,087] p12212 {/usr/local/lib/python3.8/site-packages/bokeh/server/tornado.py:394} DEBUG -     {'application_context': ,
[2020-11-23 15:49:40,087] p12212 {/usr/local/lib/python3.8/site-packages/bokeh/server/tornado.py:394} DEBUG -      'bokeh_websocket_path': '/grafos/ws'}),
[2020-11-23 15:49:40,087] p12212 {/usr/local/lib/python3.8/site-packages/bokeh/server/tornado.py:394} DEBUG -    ('/grafos/ws',
[2020-11-23 15:49:40,087] p12212 {/usr/local/lib/python3.8/site-packages/bokeh/server/tornado.py:394} DEBUG -     ,
[2020-11-23 15:49:40,087] p12212 {/usr/local/lib/python3.8/site-packages/bokeh/server/tornado.py:394} DEBUG -     {'application_context': ,
[2020-11-23 15:49:40,087] p12212 {/usr/local/lib/python3.8/site-packages/bokeh/server/tornado.py:394} DEBUG -      'bokeh_websocket_path': '/grafos/ws'}),
[2020-11-23 15:49:40,087] p12212 {/usr/local/lib/python3.8/site-packages/bokeh/server/tornado.py:394} DEBUG -    ('/grafos/metadata',
[2020-11-23 15:49:40,087] p12212 {/usr/local/lib/python3.8/site-packages/bokeh/server/tornado.py:394} DEBUG -     ,
[2020-11-23 15:49:40,087] p12212 {/usr/local/lib/python3.8/site-packages/bokeh/server/tornado.py:394} DEBUG -     {'application_context': ,
[2020-11-23 15:49:40,087] p12212 {/usr/local/lib/python3.8/site-packages/bokeh/server/tornado.py:394} DEBUG -      'bokeh_websocket_path': '/grafos/ws'}),
[2020-11-23 15:49:40,087] p12212 {/usr/local/lib/python3.8/site-packages/bokeh/server/tornado.py:394} DEBUG -    ('/grafos/autoload.js',
[2020-11-23 15:49:40,087] p12212 {/usr/local/lib/python3.8/site-packages/bokeh/server/tornado.py:394} DEBUG -     ,
[2020-11-23 15:49:40,087] p12212 {/usr/local/lib/python3.8/site-packages/bokeh/server/tornado.py:394} DEBUG -     {'application_context': ,
[2020-11-23 15:49:40,087] p12212 {/usr/local/lib/python3.8/site-packages/bokeh/server/tornado.py:394} DEBUG -      'bokeh_websocket_path': '/grafos/ws'}),
[2020-11-23 15:49:40,087] p12212 {/usr/local/lib/python3.8/site-packages/bokeh/server/tornado.py:394} DEBUG -    ('/?',
[2020-11-23 15:49:40,088] p12212 {/usr/local/lib/python3.8/site-packages/bokeh/server/tornado.py:394} DEBUG -     ,
[2020-11-23 15:49:40,088] p12212 {/usr/local/lib/python3.8/site-packages/bokeh/server/tornado.py:394} DEBUG -     {'applications': {'/bkapp': ,
[2020-11-23 15:49:40,088] p12212 {/usr/local/lib/python3.8/site-packages/bokeh/server/tornado.py:394} DEBUG -                       '/grafos': },
[2020-11-23 15:49:40,088] p12212 {/usr/local/lib/python3.8/site-packages/bokeh/server/tornado.py:394} DEBUG -      'index': None,
[2020-11-23 15:49:40,088] p12212 {/usr/local/lib/python3.8/site-packages/bokeh/server/tornado.py:394} DEBUG -      'prefix': '',
[2020-11-23 15:49:40,088] p12212 {/usr/local/lib/python3.8/site-packages/bokeh/server/tornado.py:394} DEBUG -      'use_redirect': True}),
[2020-11-23 15:49:40,088] p12212 {/usr/local/lib/python3.8/site-packages/bokeh/server/tornado.py:394} DEBUG -    ('/static/extensions/(.*)',
[2020-11-23 15:49:40,088] p12212 {/usr/local/lib/python3.8/site-packages/bokeh/server/tornado.py:394} DEBUG -     ,
[2020-11-23 15:49:40,088] p12212 {/usr/local/lib/python3.8/site-packages/bokeh/server/tornado.py:394} DEBUG -     {'root': {}}),
[2020-11-23 15:49:40,088] p12212 {/usr/local/lib/python3.8/site-packages/bokeh/server/tornado.py:394} DEBUG -    ('/static/(.*)',
[2020-11-23 15:49:40,088] p12212 {/usr/local/lib/python3.8/site-packages/bokeh/server/tornado.py:394} DEBUG -     )]
[11-23 15:49:42] p12216 {/Users/humbertozuluaga/Documents/PROYECTOS/PythonProjects/mutabis/mutabis/__init__.py:119} INFO - Logging is set up.
[2020-11-23 15:49:42,759] p12216 {/Users/humbertozuluaga/Documents/PROYECTOS/PythonProjects/mutabis/mutabis/__init__.py:119} INFO - Logging is set up.
[11-23 15:49:42] p12216 {/Users/humbertozuluaga/Documents/PROYECTOS/PythonProjects/mutabis/mutabis/__init__.py:123} INFO - creó la app!!
[2020-11-23 15:49:42,759] p12216 {/Users/humbertozuluaga/Documents/PROYECTOS/PythonProjects/mutabis/mutabis/__init__.py:123} INFO - creó la app!!
[2020-11-23 15:49:42,789] p12216 {/usr/local/Cellar/[email protected]/3.8.5/Frameworks/Python.framework/Versions/3.8/lib/python3.8/asyncio/selector_events.py:59} DEBUG - Using selector: KqueueSelector
[2020-11-23 15:49:42,789] p12216 {/usr/local/lib/python3.8/site-packages/bokeh/server/server.py:372} INFO - Starting Bokeh server version 2.2.3 (running on Tornado 6.1)
[2020-11-23 15:49:42,795] p12216 {/usr/local/lib/python3.8/site-packages/werkzeug/_internal.py:113} WARNING -  * Debugger is active!
[2020-11-23 15:49:42,802] p12216 {/usr/local/lib/python3.8/site-packages/werkzeug/_internal.py:113} INFO -  * Debugger PIN: 185-942-693
[2020-11-23 15:49:48,065] p12216 {/usr/local/lib/python3.8/site-packages/werkzeug/_internal.py:113} INFO - 127.0.0.1 - - [23/Nov/2020 15:49:48] "e[37mGET /account HTTP/1.1e[0m" 200 -
[2020-11-23 15:49:49,643] p12216 {/usr/local/lib/python3.8/site-packages/werkzeug/_internal.py:113} INFO - 127.0.0.1 - - [23/Nov/2020 15:49:49] "e[32mGET /logout HTTP/1.1e[0m" 302 -
[2020-11-23 15:49:49,659] p12216 {/usr/local/lib/python3.8/site-packages/werkzeug/_internal.py:113} INFO - 127.0.0.1 - - [23/Nov/2020 15:49:49] "e[37mGET /home HTTP/1.1e[0m" 200 -
[2020-11-23 15:49:50,674] p12216 {/usr/local/lib/python3.8/site-packages/werkzeug/_internal.py:113} INFO - 127.0.0.1 - - [23/Nov/2020 15:49:50] "e[37mGET /login HTTP/1.1e[0m" 200 -
[2020-11-23 15:49:54,634] p12216 {/usr/local/lib/python3.8/site-packages/werkzeug/_internal.py:113} INFO - 127.0.0.1 - - [23/Nov/2020 15:49:54] "e[32mPOST /login HTTP/1.1e[0m" 302 -
[2020-11-23 15:49:54,642] p12216 {/usr/local/lib/python3.8/site-packages/werkzeug/_internal.py:113} INFO - 127.0.0.1 - - [23/Nov/2020 15:49:54] "e[37mGET /home HTTP/1.1e[0m" 200 -
[2020-11-23 15:49:55,094] p12212 {/usr/local/lib/python3.8/site-packages/bokeh/server/tornado.py:658} DEBUG - [pid 12212] 0 clients connected
[2020-11-23 15:49:55,094] p12212 {/usr/local/lib/python3.8/site-packages/bokeh/server/tornado.py:665} DEBUG - [pid 12212]   /bkapp has 0 sessions with 0 unused
[2020-11-23 15:49:55,094] p12212 {/usr/local/lib/python3.8/site-packages/bokeh/server/tornado.py:665} DEBUG - [pid 12212]   /grafos has 0 sessions with 0 unused
[2020-11-23 15:49:58,216] p12216 {/usr/local/lib/python3.8/site-packages/werkzeug/_internal.py:113} INFO - 127.0.0.1 - - [23/Nov/2020 15:49:58] "e[37mGET /bokeh HTTP/1.1e[0m" 200 -
[2020-11-23 15:49:59,996] p12212 {/usr/local/lib/python3.8/site-packages/tornado/web.py:2239} INFO - 200 GET /bkapp/autoload.js?bokeh-autoload-element=1001&bokeh-app-path=/bkapp&bokeh-absolute-url=http://localhost:5006/bkapp (::1) 1747.48ms
[2020-11-23 15:50:00,045] p12212 {/usr/local/lib/python3.8/site-packages/bokeh/server/views/ws.py:154} DEBUG - Subprotocol header received
[2020-11-23 15:50:00,046] p12212 {/usr/local/lib/python3.8/site-packages/tornado/web.py:2239} INFO - 101 GET /bkapp/ws (::1) 0.56ms
[2020-11-23 15:50:00,046] p12212 {/usr/local/lib/python3.8/site-packages/bokeh/server/views/ws.py:120} INFO - WebSocket connection opened
[2020-11-23 15:50:00,046] p12212 {/usr/local/lib/python3.8/site-packages/bokeh/server/views/ws.py:187} DEBUG - Receiver created for Protocol()
[2020-11-23 15:50:00,046] p12212 {/usr/local/lib/python3.8/site-packages/bokeh/server/views/ws.py:190} DEBUG - ProtocolHandler created for Protocol()
[2020-11-23 15:50:00,046] p12212 {/usr/local/lib/python3.8/site-packages/bokeh/server/views/ws.py:193} INFO - ServerConnection created
[2020-11-23 15:50:00,048] p12212 {/usr/local/lib/python3.8/site-packages/bokeh/server/session.py:231} DEBUG - Sending pull-doc-reply from session '03P7Q1i2Bc0RDOO5tiapVDFFj8tZca97eItwWye1FaI0'
[2020-11-23 15:50:10,091] p12212 {/usr/local/lib/python3.8/site-packages/bokeh/server/tornado.py:658} DEBUG - [pid 12212] 1 clients connected
[2020-11-23 15:50:10,091] p12212 {/usr/local/lib/python3.8/site-packages/bokeh/server/tornado.py:665} DEBUG - [pid 12212]   /bkapp has 1 sessions with 0 unused
[2020-11-23 15:50:10,091] p12212 {/usr/local/lib/python3.8/site-packages/bokeh/server/tornado.py:665} DEBUG - [pid 12212]   /grafos has 0 sessions with 0 unused
[2020-11-23 15:50:25,094] p12212 {/usr/local/lib/python3.8/site-packages/bokeh/server/tornado.py:658} DEBUG - [pid 12212] 1 clients connected
[2020-11-23 15:50:25,094] p12212 {/usr/local/lib/python3.8/site-packages/bokeh/server/tornado.py:665} DEBUG - [pid 12212]   /bkapp has 1 sessions with 0 unused
[2020-11-23 15:50:25,094] p12212 {/usr/local/lib/python3.8/site-packages/bokeh/server/tornado.py:665} DEBUG - [pid 12212]   /grafos has 0 sessions with 0 unused
[2020-11-23 15:50:40,090] p12212 {/usr/local/lib/python3.8/site-packages/bokeh/server/tornado.py:658} DEBUG - [pid 12212] 1 clients connected
[2020-11-23 15:50:40,090] p12212 {/usr/local/lib/python3.8/site-packages/bokeh/server/tornado.py:665} DEBUG - [pid 12212]   /bkapp has 1 sessions with 0 unused

[2020-11-23 16:00:40,094] p12212 {/usr/local/lib/python3.8/site-packages/bokeh/server/tornado.py:665} DEBUG - [pid 12212]   /bkapp has 1 sessions with 0 unused
 

This is how it looks on my local env:

Bryan , do you know any Bokeh consultant we can hire in order to help us to setup our production environment?

Thanks

@Humberto_Zuluaga If you mean for a small one-off engangement, I don’t know anyone offhand. Looking at your log file, no connection attempt is ever even reaching the Bokeh server, so the problem almost certainly lies in the Apache proxy in front. Do the apache logs report denying a connection?