Multiple applications interfering with each other

Hi everyone,

I stumbled upon a very unexpected behavior with two of our dash applications. In our current setup, we have 2 Dash applications running in production on a Linux server and they are being served with the WSGI server provided by Waitress.

The unexpected behavior I stumbled upon was when I had app1 open in my browser, and I opened app2, then app1 becomes unresponsive. The same holds true if I have app2 open in my browser and open app1 in a new tab.

Looking in the logs, I found the following exception:

Traceback (most recent call last):
  File "/root/local/lib/python3.8/site-packages/dash/dash.py", line 1208, in dispatch
    cb = self.callback_map[output]
KeyError: '..figure6.figure...figure7.figure...figure8.figure...pnl-bonds-markets-figure6-header.children...pnl-bonds-markets-figure7-header.children...pnl-bonds-markets-figure8-header.children..'

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/root/local/lib/python3.8/site-packages/flask/app.py", line 2525, in wsgi_app
    response = self.full_dispatch_request()
  File "/root/local/lib/python3.8/site-packages/flask/app.py", line 1822, in full_dispatch_request
    rv = self.handle_user_exception(e)
  File "/root/local/lib/python3.8/site-packages/flask/app.py", line 1820, in full_dispatch_request
    rv = self.dispatch_request()
  File "/root/local/lib/python3.8/site-packages/flask/app.py", line 1796, in dispatch_request
    return self.ensure_sync(self.view_functions[rule.endpoint])(**view_args)
  File "/root/local/lib/python3.8/site-packages/dash/dash.py", line 1255, in dispatch
    raise KeyError(msg) from missing_callback_function
KeyError: "Callback function not found for output '..figure6.figure...figure7.figure...figure8.figure...pnl-bonds-markets-figure6-header.children...pnl-bonds-markets-figure7-header.children...pnl-bonds-markets-figure8-header.children..', perhaps you forgot to prepend the '@'?"
2022-08-22 11:28:13,547 [ERROR] Exception on /_dash-update-component [POST]
Traceback (most recent call last):
  File "/root/local/lib/python3.8/site-packages/dash/dash.py", line 1208, in dispatch
    cb = self.callback_map[output]
KeyError: '..figure6.figure...figure7.figure...figure8.figure...pnl-bonds-markets-figure6-header.children...pnl-bonds-markets-figure7-header.children...pnl-bonds-markets-figure8-header.children..'

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/root/local/lib/python3.8/site-packages/flask/app.py", line 2525, in wsgi_app
    response = self.full_dispatch_request()
  File "/root/local/lib/python3.8/site-packages/flask/app.py", line 1822, in full_dispatch_request
    rv = self.handle_user_exception(e)
  File "/root/local/lib/python3.8/site-packages/flask/app.py", line 1820, in full_dispatch_request
    rv = self.dispatch_request()
  File "/root/local/lib/python3.8/site-packages/flask/app.py", line 1796, in dispatch_request
    return self.ensure_sync(self.view_functions[rule.endpoint])(**view_args)
  File "/root/local/lib/python3.8/site-packages/dash/dash.py", line 1255, in dispatch
    raise KeyError(msg) from missing_callback_function
KeyError: "Callback function not found for output '..figure6.figure...figure7.figure...figure8.figure...pnl-bonds-markets-figure6-header.children...pnl-bonds-markets-figure7-header.children...pnl-bonds-markets-figure8-header.children..', perhaps you forgot to prepend the '@'?"

From the logs of app1, that is provided above, I can see the error is caused due to missing callbacks but these missing callbacks are related to app2?! And this only occurs when I have both applications open in my browser. Do anyone have some input on how to overcome this issue?

It should be noted that the applications are running on different ports but on the same host.