Server connection error in docker container

I am using a Docker container to run and work with JupyterLab on Windows 10 Home. In order to make Docker Desktop available on such Windows version I use WSL integration and it works well since the container is able to run and I have access to the JupyterLab interface on my browser. However, after the kernel is started, it can happen from time to time and not depending on what I am doing inside the notebook that I received the following error after the kernel is dead:
“Server Connection Error : A connection to the Jupyter server could not be established. JupyterLab will continue trying to reconnect. Check your network connection or Jupyter server configuration.”

I read on Github and around the web that this problem could be related to some incompatibility between Jupyter version (maybe notebook version) and tornado version, but it is not very clear to me. I started to receive such error after I deleted the container and its related images and I built it again. My dockerfile didn’t have specific versions to install and probably after reinstalling all the latest version of the packages I have created some problems. Here the actual list of packages and versions I am running:

Package Version


absl-py 0.9.0
argon2-cffi 20.1.0
astunparse 1.6.3
async-generator 1.10
attrs 19.3.0
backcall 0.2.0
backoff 1.10.0
bleach 3.1.5
blist 1.3.6
bokeh 2.1.1
Brotli 1.0.9
cachetools 4.1.1
certifi 2020.6.20
cffi 1.14.2
chardet 3.0.4
click 7.1.2
cryptography 3.0
cycler 0.10.0
dash 1.17.0
dash-bootstrap-components 0.10.7
dash-colorscales 0.0.4
dash-core-components 1.13.0
dash-daq 0.5.0
dash-html-components 1.1.1
dash-renderer 1.8.3
dash-table 4.11.0
decorator 4.4.2
defusedxml 0.6.0
dtale 1.21.0
entrypoints 0.3
Flask 1.1.2
Flask-Compress 1.8.0
flask-ngrok 0.0.25
future 0.18.2
gast 0.3.3
google-auth 1.20.1
google-auth-oauthlib 0.4.1
google-pasta 0.2.0
graphviz 0.14.1
grpcio 1.31.0
h5py 2.10.0
idna 2.10
ipykernel 5.3.4
ipython 7.17.0
ipython-genutils 0.2.0
ipywidgets 7.5.1
itsdangerous 1.1.0
jedi 0.17.2
jeepney 0.4.3
Jinja2 2.11.2
joblib 0.16.0
json5 0.9.5
jsonschema 3.2.0
jupyter 1.0.0
jupyter-client 6.1.6
jupyter-console 6.0.0
jupyter-core 4.6.3
jupyterlab 2.2.5
jupyterlab-pygments 0.1.2
jupyterlab-server 1.2.0
kaleido 0.0.3.post1
Keras-Preprocessing 1.1.2
keyring 21.3.0
keyrings.cryptfile 1.3.4
kiwisolver 1.2.0
lightgbm 2.3.1
lz4 3.1.0
Markdown 3.2.2
MarkupSafe 1.1.1
matplotlib 3.3.1
mistune 0.8.4
mysqlclient 2.0.1
nbclient 0.5.1
nbconvert 5.6.1
nbformat 5.0.7
nest-asyncio 1.4.3
notebook 6.1.3
numpy 1.18.5
oauthlib 3.1.0
opt-einsum 3.3.0
packaging 20.4
pandas 1.0.5
pandocfilters 1.4.2
parmap 1.5.2
parso 0.7.1
patsy 0.5.1
pexpect 4.8.0
pickleshare 0.7.5
Pillow 7.2.0
pip 20.2.4
plotly 4.12.0
prometheus-client 0.8.0
prompt-toolkit 2.0.1
protobuf 3.13.0
ptyprocess 0.6.0
pyarrow 1.0.0
pyasn1 0.4.8
pyasn1-modules 0.2.8
pycparser 2.20
pycryptodome 3.9.8
Pygments 2.6.1
pygobject 3.26.1
pyparsing 2.4.7
pyrsistent 0.16.0
python-apt 1.6.5+ubuntu0.3
python-dateutil 2.8.1
pytz 2020.1
PyYAML 5.3.1
pyzmq 19.0.2
qtconsole 4.7.7
QtPy 1.9.0
requests 2.24.0
requests-oauthlib 1.3.0
retrying 1.3.3
rsa 4.6
scikit-learn 0.23.2
scipy 1.4.1
seaborn 0.10.1
SecretStorage 3.1.2
Send2Trash 1.5.0
setuptools 50.3.2
shap 0.35.0
six 1.15.0
SQLAlchemy 1.3.18
squarify 0.4.3
statsmodels 0.11.1
strsimpy 0.1.9
tensorboard 2.3.0
tensorboard-plugin-wit 1.7.0
tensorflow 2.3.0
tensorflow-estimator 2.3.0
termcolor 1.1.0
terminado 0.8.3
testpath 0.4.4
threadpoolctl 2.1.0
torch 1.4.0+cpu
torchvision 0.5.0+cpu
tornado 6.0.4
tqdm 4.48.2
traitlets 4.3.3
typing-extensions 3.7.4.2
tz 0.2.2
urllib3 1.25.10
wcwidth 0.2.5
webencodings 0.5.1
Werkzeug 1.0.1
wheel 0.35.1
widgetsnbextension 3.5.1
wrapt 1.12.1
xarray 0.16.1

I wonder if there is any issue related to this configuration in Windows, since people that are using Linux/MacOS don’t have any problem to run JupyterLab in this container.