Got errors when connect conda R env with jupyterlab

Hi,

Recently I meet the errors with jupyterlab when I connect jupyterlab with my conda R environment on a server. My conda python connect perfectly with Jupyterlab. The errors seems related with tornado.websocket.WebSocketClosedError. As shown here:
[W 2024-02-07 22:39:50.237 ServerApp] kernel bcceed27-d986-4ab6-a8b5-95b3f741e0c7 restarted [E 2024-02-07 22:39:50.237 ServerApp] KernelRestarter: restart callback <bound method ZMQChannelsWebsocketConnection.on_kernel_restarted of <jupyter_server.services.kernels.connection.channels.ZMQChannelsWebsocketConnection object at 0x7f83a45e31f0>> failed Traceback (most recent call last): File "/hpc/pmc_stunnenberg/Zhijun/miniconda3/envs/python3.9/lib/python3.9/site-packages/jupyter_client/restarter.py", line 105, in _fire_callbacks callback() File "/hpc/pmc_stunnenberg/Zhijun/miniconda3/envs/python3.9/lib/python3.9/site-packages/jupyter_server/services/kernels/connection/channels.py", line 798, in on_kernel_restarted self._send_status_message("restarting") File "/hpc/pmc_stunnenberg/Zhijun/miniconda3/envs/python3.9/lib/python3.9/site-packages/jupyter_server/services/kernels/connection/channels.py", line 793, in _send_status_message self.write_message(json.dumps(msg, default=json_default)) File "/hpc/pmc_stunnenberg/Zhijun/miniconda3/envs/python3.9/lib/python3.9/site-packages/tornado/websocket.py", line 331, in write_message raise WebSocketClosedError() tornado.websocket.WebSocketClosedError [W 2024-02-07 22:39:50.237 ServerApp] kernel bcceed27-d986-4ab6-a8b5-95b3f741e0c7 restarted [E 2024-02-07 22:39:50.238 ServerApp] KernelRestarter: restart callback <bound method ZMQChannelsWebsocketConnection.on_kernel_restarted of <jupyter_server.services.kernels.connection.channels.ZMQChannelsWebsocketConnection object at 0x7f83a459ac70>> failed Traceback (most recent call last): File "/hpc/pmc_stunnenberg/Zhijun/miniconda3/envs/python3.9/lib/python3.9/site-packages/jupyter_client/restarter.py", line 105, in _fire_callbacks callback() File "/hpc/pmc_stunnenberg/Zhijun/miniconda3/envs/python3.9/lib/python3.9/site-packages/jupyter_server/services/kernels/connection/channels.py", line 798, in on_kernel_restarted self._send_status_message("restarting") File "/hpc/pmc_stunnenberg/Zhijun/miniconda3/envs/python3.9/lib/python3.9/site-packages/jupyter_server/services/kernels/connection/channels.py", line 793, in _send_status_message self.write_message(json.dumps(msg, default=json_default)) File "/hpc/pmc_stunnenberg/Zhijun/miniconda3/envs/python3.9/lib/python3.9/site-packages/tornado/websocket.py", line 331, in write_message raise WebSocketClosedError() tornado.websocket.WebSocketClosedError [W 2024-02-07 22:39:50.238 ServerApp] kernel bcceed27-d986-4ab6-a8b5-95b3f741e0c7 restarted [E 2024-02-07 22:39:50.238 ServerApp] KernelRestarter: restart callback <bound method ZMQChannelsWebsocketConnection.on_kernel_restarted of <jupyter_server.services.kernels.connection.channels.ZMQChannelsWebsocketConnection object at 0x7f83a454b520>> failed Traceback (most recent call last): File "/hpc/pmc_stunnenberg/Zhijun/miniconda3/envs/python3.9/lib/python3.9/site-packages/jupyter_client/restarter.py", line 105, in _fire_callbacks callback() File "/hpc/pmc_stunnenberg/Zhijun/miniconda3/envs/python3.9/lib/python3.9/site-packages/jupyter_server/services/kernels/connection/channels.py", line 798, in on_kernel_restarted self._send_status_message("restarting") File "/hpc/pmc_stunnenberg/Zhijun/miniconda3/envs/python3.9/lib/python3.9/site-packages/jupyter_server/services/kernels/connection/channels.py", line 793, in _send_status_message self.write_message(json.dumps(msg, default=json_default)) File "/hpc/pmc_stunnenberg/Zhijun/miniconda3/envs/python3.9/lib/python3.9/site-packages/tornado/websocket.py", line 331, in write_message raise WebSocketClosedError() tornado.websocket.WebSocketClosedError [W 2024-02-07 22:39:50.239 ServerApp] kernel bcceed27-d986-4ab6-a8b5-95b3f741e0c7 restarted [E 2024-02-07 22:39:50.239 ServerApp] KernelRestarter: restart callback <bound method ZMQChannelsWebsocketConnection.on_kernel_restarted of <jupyter_server.services.kernels.connection.channels.ZMQChannelsWebsocketConnection object at 0x7f83a4578460>> failed Traceback (most recent call last): File "/hpc/pmc_stunnenberg/Zhijun/miniconda3/envs/python3.9/lib/python3.9/site-packages/jupyter_client/restarter.py", line 105, in _fire_callbacks callback() File "/hpc/pmc_stunnenberg/Zhijun/miniconda3/envs/python3.9/lib/python3.9/site-packages/jupyter_server/services/kernels/connection/channels.py", line 798, in on_kernel_restarted self._send_status_message("restarting") File "/hpc/pmc_stunnenberg/Zhijun/miniconda3/envs/python3.9/lib/python3.9/site-packages/jupyter_server/services/kernels/connection/channels.py", line 793, in _send_status_message self.write_message(json.dumps(msg, default=json_default)) File "/hpc/pmc_stunnenberg/Zhijun/miniconda3/envs/python3.9/lib/python3.9/site-packages/tornado/websocket.py", line 331, in write_message raise WebSocketClosedError() tornado.websocket.WebSocketClosedError [W 2024-02-07 22:39:50.239 ServerApp] kernel bcceed27-d986-4ab6-a8b5-95b3f741e0c7 restarted [E 2024-02-07 22:39:50.239 ServerApp] KernelRestarter: restart callback <bound method ZMQChannelsWebsocketConnection.on_kernel_restarted of <jupyter_server.services.kernels.connection.channels.ZMQChannelsWebsocketConnection object at 0x7f83a4507f40>> failed Traceback (most recent call last): File "/hpc/pmc_stunnenberg/Zhijun/miniconda3/envs/python3.9/lib/python3.9/site-packages/jupyter_client/restarter.py", line 105, in _fire_callbacks callback() File "/hpc/pmc_stunnenberg/Zhijun/miniconda3/envs/python3.9/lib/python3.9/site-packages/jupyter_server/services/kernels/connection/channels.py", line 798, in on_kernel_restarted self._send_status_message("restarting") File "/hpc/pmc_stunnenberg/Zhijun/miniconda3/envs/python3.9/lib/python3.9/site-packages/jupyter_server/services/kernels/connection/channels.py", line 793, in _send_status_message self.write_message(json.dumps(msg, default=json_default)) File "/hpc/pmc_stunnenberg/Zhijun/miniconda3/envs/python3.9/lib/python3.9/site-packages/tornado/websocket.py", line 331, in write_message raise WebSocketClosedError() tornado.websocket.WebSocketClosedError [W 2024-02-07 22:39:50.240 ServerApp] kernel bcceed27-d986-4ab6-a8b5-95b3f741e0c7 restarted [E 2024-02-07 22:39:50.240 ServerApp] KernelRestarter: restart callback <bound method ZMQChannelsWebsocketConnection.on_kernel_restarted of <jupyter_server.services.kernels.connection.channels.ZMQChannelsWebsocketConnection object at 0x7f83a4538e20>> failed Traceback (most recent call last): File "/hpc/pmc_stunnenberg/Zhijun/miniconda3/envs/python3.9/lib/python3.9/site-packages/jupyter_client/restarter.py", line 105, in _fire_callbacks callback() File "/hpc/pmc_stunnenberg/Zhijun/miniconda3/envs/python3.9/lib/python3.9/site-packages/jupyter_server/services/kernels/connection/channels.py", line 798, in on_kernel_restarted self._send_status_message("restarting") File "/hpc/pmc_stunnenberg/Zhijun/miniconda3/envs/python3.9/lib/python3.9/site-packages/jupyter_server/services/kernels/connection/channels.py", line 793, in _send_status_message self.write_message(json.dumps(msg, default=json_default)) File "/hpc/pmc_stunnenberg/Zhijun/miniconda3/envs/python3.9/lib/python3.9/site-packages/tornado/websocket.py", line 331, in write_message raise WebSocketClosedError() tornado.websocket.WebSocketClosedError [W 2024-02-07 22:39:50.240 ServerApp] kernel bcceed27-d986-4ab6-a8b5-95b3f741e0c7 restarted [E 2024-02-07 22:39:50.240 ServerApp] KernelRestarter: restart callback <bound method ZMQChannelsWebsocketConnection.on_kernel_restarted of <jupyter_server.services.kernels.connection.channels.ZMQChannelsWebsocketConnection object at 0x7f83a4485ee0>> failed Traceback (most recent call last): File "/hpc/pmc_stunnenberg/Zhijun/miniconda3/envs/python3.9/lib/python3.9/site-packages/jupyter_client/restarter.py", line 105, in _fire_callbacks callback() File "/hpc/pmc_stunnenberg/Zhijun/miniconda3/envs/python3.9/lib/python3.9/site-packages/jupyter_server/services/kernels/connection/channels.py", line 798, in on_kernel_restarted self._send_status_message("restarting") File "/hpc/pmc_stunnenberg/Zhijun/miniconda3/envs/python3.9/lib/python3.9/site-packages/jupyter_server/services/kernels/connection/channels.py", line 793, in _send_status_message self.write_message(json.dumps(msg, default=json_default)) File "/hpc/pmc_stunnenberg/Zhijun/miniconda3/envs/python3.9/lib/python3.9/site-packages/tornado/websocket.py", line 331, in write_message raise WebSocketClosedError() tornado.websocket.WebSocketClosedError [W 2024-02-07 22:39:50.240 ServerApp] kernel bcceed27-d986-4ab6-a8b5-95b3f741e0c7 restarted [E 2024-02-07 22:39:50.240 ServerApp] KernelRestarter: restart callback <bound method ZMQChannelsWebsocketConnection.on_kernel_restarted of <jupyter_server.services.kernels.connection.channels.ZMQChannelsWebsocketConnection object at 0x7f83a44b58b0>> failed Traceback (most recent call last): File "/hpc/pmc_stunnenberg/Zhijun/miniconda3/envs/python3.9/lib/python3.9/site-packages/jupyter_client/restarter.py", line 105, in _fire_callbacks callback() File "/hpc/pmc_stunnenberg/Zhijun/miniconda3/envs/python3.9/lib/python3.9/site-packages/jupyter_server/services/kernels/connection/channels.py", line 798, in on_kernel_restarted self._send_status_message("restarting") File "/hpc/pmc_stunnenberg/Zhijun/miniconda3/envs/python3.9/lib/python3.9/site-packages/jupyter_server/services/kernels/connection/channels.py", line 793, in _send_status_message self.write_message(json.dumps(msg, default=json_default)) File "/hpc/pmc_stunnenberg/Zhijun/miniconda3/envs/python3.9/lib/python3.9/site-packages/tornado/websocket.py", line 331, in write_message raise WebSocketClosedError() tornado.websocket.WebSocketClosedError [W 2024-02-07 22:39:50.241 ServerApp] kernel bcceed27-d986-4ab6-a8b5-95b3f741e0c7 restarted [E 2024-02-07 22:39:50.241 ServerApp] KernelRestarter: restart callback <bound method ZMQChannelsWebsocketConnection.on_kernel_restarted of <jupyter_server.services.kernels.connection.channels.ZMQChannelsWebsocketConnection object at 0x7f83a4465580>> failed Traceback (most recent call last): File "/hpc/pmc_stunnenberg/Zhijun/miniconda3/envs/python3.9/lib/python3.9/site-packages/jupyter_client/restarter.py", line 105, in _fire_callbacks callback() File "/hpc/pmc_stunnenberg/Zhijun/miniconda3/envs/python3.9/lib/python3.9/site-packages/jupyter_server/services/kernels/connection/channels.py", line 798, in on_kernel_restarted self._send_status_message("restarting") File "/hpc/pmc_stunnenberg/Zhijun/miniconda3/envs/python3.9/lib/python3.9/site-packages/jupyter_server/services/kernels/connection/channels.py", line 793, in _send_status_message self.write_message(json.dumps(msg, default=json_default)) File "/hpc/pmc_stunnenberg/Zhijun/miniconda3/envs/python3.9/lib/python3.9/site-packages/tornado/websocket.py", line 331, in write_message raise WebSocketClosedError() tornado.websocket.WebSocketClosedError