ConnectionRefusedError: [Errno 111] Connection refused

Hi, I started testing with wandb by simply running a training round using a routine I got from your YouTube channel (“Integrating weights and biases with Keras”), I just made adaptations to read my data instead of CIFAR 10, which is used in the example. The first time I run a round, it works, but when I try to repeat it, it returns this error. It used to work fine before, I’m using Google Colab on my Windows machine. The error refers to the API. Here’s the log of it:
2024-03-19 12:40:03 ERROR Traceback (most recent call last):
File “/usr/local/lib/python3.10/dist-packages/wandb/sdk/wandb_manager.py”, line 116, in _service_connect
svc_iface._svc_connect(port=port)
File “/usr/local/lib/python3.10/dist-packages/wandb/sdk/service/service_sock.py”, line 30, in _svc_connect
self._sock_client.connect(port=port)
File “/usr/local/lib/python3.10/dist-packages/wandb/sdk/lib/sock_client.py”, line 102, in connect
s.connect((“localhost”, port))
ConnectionRefusedError: [Errno 111] Connection refused

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File “/usr/local/lib/python3.10/dist-packages/wandb/cli/cli.py”, line 105, in wrapper
return func(*args, **kwargs)
File “/usr/local/lib/python3.10/dist-packages/wandb/cli/cli.py”, line 244, in login
wandb.setup(settings=login_settings)
File “/usr/local/lib/python3.10/dist-packages/wandb/sdk/wandb_setup.py”, line 327, in setup
ret = _setup(settings=settings)
File “/usr/local/lib/python3.10/dist-packages/wandb/sdk/wandb_setup.py”, line 320, in _setup
wl = _WandbSetup(settings=settings)
File “/usr/local/lib/python3.10/dist-packages/wandb/sdk/wandb_setup.py”, line 303, in init
_WandbSetup._instance = _WandbSetup__WandbSetup(settings=settings, pid=pid)
File “/usr/local/lib/python3.10/dist-packages/wandb/sdk/wandb_setup.py”, line 114, in init
self._setup()
File “/usr/local/lib/python3.10/dist-packages/wandb/sdk/wandb_setup.py”, line 250, in _setup
self._setup_manager()
File “/usr/local/lib/python3.10/dist-packages/wandb/sdk/wandb_setup.py”, line 277, in _setup_manager
self._manager = wandb_manager._Manager(settings=self._settings)
File “/usr/local/lib/python3.10/dist-packages/wandb/sdk/wandb_manager.py”, line 153, in init
wandb._sentry.reraise(e)
File “/usr/local/lib/python3.10/dist-packages/wandb/analytics/sentry.py”, line 154, in reraise
raise exc.with_traceback(sys.exc_info()[2])
File “/usr/local/lib/python3.10/dist-packages/wandb/sdk/wandb_manager.py”, line 151, in init
self._service_connect()
File “/usr/local/lib/python3.10/dist-packages/wandb/sdk/wandb_manager.py”, line 125, in _service_connect
raise ManagerConnectionRefusedError(message)
wandb.sdk.wandb_manager.ManagerConnectionRefusedError: Connection to wandb service failed: [Errno 111] Connection refused.

2024-03-19 12:40:46 ERROR Traceback (most recent call last):
File “/usr/local/lib/python3.10/dist-packages/wandb/sdk/wandb_manager.py”, line 116, in _service_connect
svc_iface._svc_connect(port=port)
File “/usr/local/lib/python3.10/dist-packages/wandb/sdk/service/service_sock.py”, line 30, in _svc_connect
self._sock_client.connect(port=port)
File “/usr/local/lib/python3.10/dist-packages/wandb/sdk/lib/sock_client.py”, line 102, in connect
s.connect((“localhost”, port))
ConnectionRefusedError: [Errno 111] Connection refused

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File “/usr/local/lib/python3.10/dist-packages/wandb/cli/cli.py”, line 105, in wrapper
return func(*args, **kwargs)
File “/usr/local/lib/python3.10/dist-packages/wandb/cli/cli.py”, line 244, in login
wandb.setup(settings=login_settings)
File “/usr/local/lib/python3.10/dist-packages/wandb/sdk/wandb_setup.py”, line 327, in setup
ret = _setup(settings=settings)
File “/usr/local/lib/python3.10/dist-packages/wandb/sdk/wandb_setup.py”, line 320, in _setup
wl = _WandbSetup(settings=settings)
File “/usr/local/lib/python3.10/dist-packages/wandb/sdk/wandb_setup.py”, line 303, in init
_WandbSetup._instance = _WandbSetup__WandbSetup(settings=settings, pid=pid)
File “/usr/local/lib/python3.10/dist-packages/wandb/sdk/wandb_setup.py”, line 114, in init
self._setup()
File “/usr/local/lib/python3.10/dist-packages/wandb/sdk/wandb_setup.py”, line 250, in _setup
self._setup_manager()
File “/usr/local/lib/python3.10/dist-packages/wandb/sdk/wandb_setup.py”, line 277, in _setup_manager
self._manager = wandb_manager._Manager(settings=self._settings)
File “/usr/local/lib/python3.10/dist-packages/wandb/sdk/wandb_manager.py”, line 153, in init
wandb._sentry.reraise(e)
File “/usr/local/lib/python3.10/dist-packages/wandb/analytics/sentry.py”, line 154, in reraise
raise exc.with_traceback(sys.exc_info()[2])
File “/usr/local/lib/python3.10/dist-packages/wandb/sdk/wandb_manager.py”, line 151, in init
self._service_connect()
File “/usr/local/lib/python3.10/dist-packages/wandb/sdk/wandb_manager.py”, line 125, in _service_connect
raise ManagerConnectionRefusedError(message)
wandb.sdk.wandb_manager.ManagerConnectionRefusedError: Connection to wandb service failed: [Errno 111] Connection refused.

Hi Flora,

Happy to help you on this. The first thing I would try and suggest is to relogin in wandb from your collab project by running wandb login --relogin . You may be asked for an API key so please enter your API key to proceed.

Please try this and if the issue still persist, we would like to request for the debug-internal.log and debug.log. These files are under your collab folder wandb/run-_-/logs in the same directory where you’re running your code. These files will help us with more details about this error.

Is the issue behavior still the same where the repeated runs throws an error?

Hi @flora-ufsc24 , since we have not heard back from you we are going to close this request. If you would like to re-open the conversation, please let us know!

1 Like