question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

TimeoutError: Timeout while waiting for comm port.

See original GitHub issue

Issue Report Checklist

  • Searched the issues page for similar reports
  • Read the relevant sections of the Spyder Troubleshooting Guide and followed its advice
  • Reproduced the issue after updating with conda update spyder (or pip, if not using Anaconda)
  • Could not reproduce inside jupyter qtconsole (if console-related)
  • Tried basic troubleshooting (if a bug/error)
    • Restarted Spyder
    • Reset preferences with spyder --reset
    • Reinstalled the latest version of Anaconda
    • Tried the other applicable steps from the Troubleshooting Guide
  • Completed the Problem Description, Steps to Reproduce and Version sections below

Problem Description

this is a duplication of #11889 but as that one is closed, and the problem still persists, @goanpeca asked me to report this one next time it pops up.

The issue reporter however didn’t have the Submit to Github button enabled (not sure if that is a bug in itself) anyway, I’ll do it on Github itself 😉

What steps reproduce the problem?

On a Linux (Ubuntu 20.04) box, installed miniforge (so everything comes from conda-forge) and then I created a fresh environment like this:

(base) me@mybox:~$ conda create -n s4 python=3.7
(base) me@mybox:~$ conda activate s4
(s4) me@mybox:~$ conda install spyder
...
(s4) me@mybox:~$ conda list spyder
# packages in environment at /home/me/my-envs/s4:
#
# Name                    Version                   Build  Channel
spyder                    4.1.3                    py37_0  
spyder-kernels            1.9.1                    py37_0  
(s4) me@mybox:~$ spyder
libpng warning: bKGD: invalid
libpng warning: bKGD: invalid
libpng warning: bKGD: invalid
libpng warning: bKGD: invalid

the libpng warnings are probably not harmfull, but good to know I would say 😉 anyway, after a while the issue reporter pops up (best case), sometimes it doesn’t pop up, but one can see the exception on the internal console! (not sure what that is all about)

What is the expected output? What do you see instead?

N/A

Paste Traceback/Error Below (if applicable)

  File "/home/nerohmot/my-envs/s4/lib/python3.7/site-packages/qtconsole/base_frontend_mixin.py", line 138, in _dispatch
    handler(msg)
  File "/home/nerohmot/my-envs/s4/lib/python3.7/site-packages/spyder/plugins/ipythonconsole/widgets/namespacebrowser.py", line 172, in _handle_execute_reply
    self.refresh_namespacebrowser()
  File "/home/nerohmot/my-envs/s4/lib/python3.7/site-packages/spyder/plugins/ipythonconsole/widgets/namespacebrowser.py", line 63, in refresh_namespacebrowser
    callback=self.set_namespace_view
  File "/home/nerohmot/my-envs/s4/lib/python3.7/site-packages/spyder_kernels/comms/commbase.py", line 538, in __call__
    call_dict, call_data, self._comm_id)
  File "/home/nerohmot/my-envs/s4/lib/python3.7/site-packages/spyder/plugins/ipythonconsole/comms/kernelcomm.py", line 130, in _get_call_return_value
    with self.comm_channel_manager(comm_id, queue_message=not interrupt):
  File "/home/nerohmot/my-envs/s4/lib/python3.7/contextlib.py", line 112, in __enter__
    return next(self.gen)
  File "/home/nerohmot/my-envs/s4/lib/python3.7/site-packages/spyder/plugins/ipythonconsole/comms/kernelcomm.py", line 87, in comm_channel_manager
    timeout)
  File "/home/nerohmot/my-envs/s4/lib/python3.7/site-packages/spyder/plugins/ipythonconsole/comms/kernelcomm.py", line 168, in _wait
    raise TimeoutError(timeout_msg)
TimeoutError: Timeout while waiting for comm port.
Traceback (most recent call last):
  File "/home/nerohmot/my-envs/s4/lib/python3.7/site-packages/qtconsole/base_frontend_mixin.py", line 138, in _dispatch
    handler(msg)
  File "/home/nerohmot/my-envs/s4/lib/python3.7/site-packages/spyder/plugins/ipythonconsole/widgets/namespacebrowser.py", line 172, in _handle_execute_reply
    self.refresh_namespacebrowser()
  File "/home/nerohmot/my-envs/s4/lib/python3.7/site-packages/spyder/plugins/ipythonconsole/widgets/namespacebrowser.py", line 63, in refresh_namespacebrowser
    callback=self.set_namespace_view
  File "/home/nerohmot/my-envs/s4/lib/python3.7/site-packages/spyder_kernels/comms/commbase.py", line 538, in __call__
    call_dict, call_data, self._comm_id)
  File "/home/nerohmot/my-envs/s4/lib/python3.7/site-packages/spyder/plugins/ipythonconsole/comms/kernelcomm.py", line 130, in _get_call_return_value
    with self.comm_channel_manager(comm_id, queue_message=not interrupt):
  File "/home/nerohmot/my-envs/s4/lib/python3.7/contextlib.py", line 112, in __enter__
    return next(self.gen)
  File "/home/nerohmot/my-envs/s4/lib/python3.7/site-packages/spyder/plugins/ipythonconsole/comms/kernelcomm.py", line 87, in comm_channel_manager
    timeout)
  File "/home/nerohmot/my-envs/s4/lib/python3.7/site-packages/spyder/plugins/ipythonconsole/comms/kernelcomm.py", line 168, in _wait
    raise TimeoutError(timeout_msg)
TimeoutError: Timeout while waiting for comm port.
Traceback (most recent call last):
  File "/home/nerohmot/my-envs/s4/lib/python3.7/site-packages/spyder/plugins/ipythonconsole/plugin.py", line 554, in set_current_client_working_directory
    shellwidget.set_cwd(directory)
  File "/home/nerohmot/my-envs/s4/lib/python3.7/site-packages/spyder/plugins/ipythonconsole/widgets/shell.py", line 178, in set_cwd
    self.call_kernel(interrupt=True).set_cwd(dirname)
  File "/home/nerohmot/my-envs/s4/lib/python3.7/site-packages/spyder_kernels/comms/commbase.py", line 538, in __call__
    call_dict, call_data, self._comm_id)
  File "/home/nerohmot/my-envs/s4/lib/python3.7/site-packages/spyder/plugins/ipythonconsole/comms/kernelcomm.py", line 130, in _get_call_return_value
    with self.comm_channel_manager(comm_id, queue_message=not interrupt):
  File "/home/nerohmot/my-envs/s4/lib/python3.7/contextlib.py", line 112, in __enter__
    return next(self.gen)
  File "/home/nerohmot/my-envs/s4/lib/python3.7/site-packages/spyder/plugins/ipythonconsole/comms/kernelcomm.py", line 87, in comm_channel_manager
    timeout)
  File "/home/nerohmot/my-envs/s4/lib/python3.7/site-packages/spyder/plugins/ipythonconsole/comms/kernelcomm.py", line 168, in _wait
    raise TimeoutError(timeout_msg)
TimeoutError: Timeout while waiting for comm port.

Versions

  • Spyder version: 4.1.3
  • Python version: 3.7.6
  • Qt version: 5.9.7
  • PyQt version: 5.9.2
  • Operating System name/version: Linux Ubuntu 20.04 (x86_64)

Dependencies

# Mandatory:
atomicwrites >=1.2.0           :  1.4.0 (OK)
chardet >=2.0.0                :  3.0.4 (OK)
cloudpickle >=0.5.0            :  1.5.0 (OK)
diff_match_patch >=20181111    :  20181111 (OK)
intervaltree                   :  None (OK)
IPython >=4.0                  :  7.16.1 (OK)
jedi =0.15.2                   :  0.15.2 (OK)
keyring                        :  None (OK)
nbconvert >=4.0                :  5.6.1 (OK)
numpydoc >=0.6.0               :  1.1.0 (OK)
parso =0.5.2                   :  0.5.2 (OK)
pexpect >=4.4.0                :  4.8.0 (OK)
pickleshare >=0.4              :  0.7.5 (OK)
psutil >=5.3                   :  5.7.0 (OK)
pygments >=2.0                 :  2.6.1 (OK)
pylint >=0.25                  :  2.5.3 (OK)
pyls >=0.31.9;<0.32.0          :  0.31.10 (OK)
qdarkstyle >=2.8               :  2.8.1 (OK)
qtawesome >=0.5.7              :  0.7.2 (OK)
qtconsole >=4.6.0              :  4.7.5 (OK)
qtpy >=1.5.0                   :  1.9.0 (OK)
rtree >=0.8.3                  :  0.9.4 (OK)
sphinx >=0.6.6                 :  3.1.2 (OK)
spyder_kernels >=1.9.1;<1.10.0 :  1.9.1 (OK)
watchdog                       :  None (OK)
xdg >=0.26                     :  0.26 (OK)
zmq >=17                       :  19.0.1 (OK)

# Optional:
cython >=0.21                  :  None (OK)
matplotlib >=2.0.0             :  None (OK)
numpy >=1.7                    :  None (OK)
pandas >=0.13.1                :  None (OK)
scipy >=0.17.0                 :  None (OK)
sympy >=0.7.3                  :  None (OK)

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:22 (14 by maintainers)

github_iconTop GitHub Comments

1reaction
impact27commented, Nov 14, 2020

I think most of these timeout errors come from kernels that fail to launch for unrelated reasons.

Proposal:

  • The blocking=True option should automatically fail if the kernel is not connected.
  • Any function that calls blocking=True should handle the case where the kernel is not up yet.
  • The timeout error should only be displayed if the kernel is up and resonsive on the other comms. (And displayed in the shellwidget?)

I will try something on a PR

1reaction
nerohmotcommented, Jul 31, 2020

Hi @impact27

Ok, next time I have this situation again I will document it better. (don’t have anything anymore from that case)

Read more comments on GitHub >

github_iconTop Results From Across the Web

TimeoutError: Timeout while waiting for comm port #11851
This happens because your computer is too slow to start a kernel. Please open a new console and the problem will go away....
Read more >
Jupyter Notebook: Timeout waiting for kernel_info_reply
To resolve this, I started the SageMath Shell, then in the shell terminal, execute the below command: jupyter notebook --no-browser --ip=0.0.0.0 --port=8888.
Read more >
VISA Error -1073807339 (0xbfff0015) Timeout Expired Before ...
This error occurs when NI-VISA expects to receive a message or response from a device, but that message is not received within the...
Read more >
Timeout error or unable to start a service on a Windows server
A timeout was reached (30000 milliseconds) while waiting for the ServiceName service to connect (Event ID: 7009). Please make sure the below steps...
Read more >
Troubleshooting client response timeouts and errors with API ...
The Azure Network load balancer reclaims SNAT ports from closed connections only after waiting four minutes. A rapid succession of client ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found