Hi All,
I have a Dash multi-tab app (NOT built on the new pages based feature) that recently started hanging, when used with computers running different Windows OS versions. I confirm that it had been working fine across different computers and OS’s/browsers.
CONTEXT:
App automates analysis of various .txt files with eventual production of plots, tables and images served to the web-app. Additionally, all plots/tables/images written to disk. I use Anaconda for version control using venvs.
DEPENDENCIES:
Python 3.8.18
pandas==2.0.3
numpy==1.24.4
scikit-learn==1.3.0
scipy==1.10.1
plotly==5.14.1
dash==2.13.0
dash-core-components==2.0.0
dash-html-components==2.0.0
dash-extensions==0.0.58
dash-uploader==0.5.0
dash-bootstrap-components==1.4.2
flask==2.2.3
kaleido==0.1.0post1
VARIOUS SYSTEM DETAILS
Used for work/home/travel working.
PC1 - Windows 10 Pro (latest updates)
FireFox (124.0.2 (64-bit)
Anaconda (2.5.2)
PC2 - Windows 11 Home Edition (latest updates)
FireFox (124.0.2 - 64-bit)
Anaconda (2.4.2)
Laptop - Windows 11 Pro (latest updates)
FireFox (124.0.2 (64-bit)
Anaconda (2.5.2)
PROBLEM:
The app only runs fully on PC2. However, it hangs part the way through a callback chain in PC1 and laptop set-ups - see attached image showing a summarised callback chain in my app.
The place where the app hangs is at callback 1 with no crashes or errors generated.
I confirm that the same dependencies are set-up on each system.
WHAT I’VE TRIED:
1- The code in callback 2 and parallel callbacks works fine, if run from a script manually. Since the app runs fully in PC2, I assume there aren’t issues with layout discrepencies i.e. missing object in layout.
2 - Inserted small piece of code that writes a dataframe to file at the end of callback 2, just before outputs are returned from the callback function. I confirm that the file writes to disk, therefore it reaches the end of the callback. Here I assume that something is stuck, such that the the next callback in the chain isn’t triggered. However, no crash or errors reported…just hangs on loading indefinitely.
3 - I inserted the same piece of file write code in the parallel callbacks that follow callback 2 and nothing happens. It seems that the parallel callbacks aren’t triggered at all.
No outputs from callback 2? Server has comms issue?
4 - I haven’t re-installed Anaconda on PC2, so that versions are the same as other systems, because I don’t want to break my only working version. See further investigation.
5 - Same issue on Chrome and Edge browsers.
6 - Tried MWE’s from Dash examples and they seem to work fine across systems.
FURTHER INVESTIGATION
The environment paths in Anaconda are different between PC2 and PC1/laptop:
PC2:
(app) C:\Users\me\Desktop\Projects\APP>where python
C:\Users\me\anaconda3\envs\APP\python.exe
C:\Users\me\anaconda3\python.exe
C:\Users\me\AppData\Local\Microsoft\WindowsApps\python.exe
PC1/laptop:
(app) C:\Users\me\AppData\Local\APP>where python
C:\Users\me\AppData\Local\anaconda3\envs\APP\python.exe
C:\Users\me\AppData\Local\anaconda3\python.exe
C:\Users\me\AppData\Local\Microsoft\WindowsAPPs\python.exe
Is this an issue? The app starts and partly works in PC1/laptop, so I assume not.
I’ve seen related issues with respect to OS’s. See one of my own where Kaleido version was the issue - https://github.com/plotly/dash/issues/2503.
Here there is a hanging at loading issue, but OP didn’t post update:
https://community.plotly.com/t/dash-app-stuck-at-loading/82309
My best guess is that there is some Windows OS/browser version combination that gives rise to this issue. Pretty stuck as currently I can only fully test/develop code on one of my machines.
Does anyone have experience with this issue?