Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"failed to connect to all addresses" #1212

Open
lepangdan opened this issue May 12, 2022 · 3 comments
Open

"failed to connect to all addresses" #1212

lepangdan opened this issue May 12, 2022 · 3 comments
Labels
question Further information is requested

Comments

@lepangdan
Copy link

lepangdan commented May 12, 2022

##"failed to connect to all addresses"

hi, I have tried to run the example quickstart_pytorch, and encounter a bug shown as follows,

Traceback (most recent call last):
  File "client.py", line 106, in <module>
    fl.client.start_numpy_client(server_address="[::]:8081", client=FlowerClient())
  File "/opt/conda/envs/ml-federated-3.7.12/lib/python3.7/site-packages/flwr/client/app.py", line 115, in start_numpy_client
    grpc_max_message_length=grpc_max_message_length,
  File "/opt/conda/envs/ml-federated-3.7.12/lib/python3.7/site-packages/flwr/client/app.py", line 64, in start_client
    server_message = receive()
  File "/opt/conda/envs/ml-federated-3.7.12/lib/python3.7/site-packages/flwr/client/grpc_client/connection.py", line 60, in <lambda>
    receive: Callable[[], ServerMessage] = lambda: next(server_message_iterator)
  File "/opt/conda/envs/ml-federated-3.7.12/lib/python3.7/site-packages/grpc/_channel.py", line 426, in __next__
    return self._next()
  File "/opt/conda/envs/ml-federated-3.7.12/lib/python3.7/site-packages/grpc/_channel.py", line 809, in _next
    raise self
grpc._channel._MultiThreadedRendezvous: <_MultiThreadedRendezvous of RPC that terminated with:
        status = StatusCode.UNAVAILABLE
        details = "failed to connect to all addresses"
        debug_error_string = "{"created":"@1652340915.644527504","description":"Failed to pick subchannel","file":"src/core/ext/filters/client_channel/client_channel.cc","file_line":3128,"referenced_errors":[{"created":"@1652340915.644526921","description":"failed to connect to all addresses","file":"src/core/lib/transport/error_utils.cc","file_line":163,"grpc_status":14}]}"
>

please help

@lepangdan lepangdan added the question Further information is requested label May 12, 2022
@ZHTushar23
Copy link

Having the same issue with Raspberry Pi 400. "failed to connect to all addresses".

@MKZuziak
Copy link

Hi lepangdan,

I had the same issue when I started to experiment with the Flower framework. As far as I've discovered, the issue may be arising due to the grpc insecure connection. May I ask about the environment in which you are trying to perform the test? Especially the OS.

What I may suggest and what has worked for me is installing WSL2 (if you are on Windows 10/11) and following the instructions posted in the [https://github.com/adap/flower/tree/main/examples/quickstart_tensorflow](relevant folder in the flower's repository), so:

  • clone the repository;
  • resolve dependencies through poetry;
  • modify the code if needed.

Generally, the poetry-built environment on WSL2 should allow you to use Flower without running into Failed to pick subchannel error.

You may be also interested in checking ticket no. https://github.com/adap/flower/issues/537 and https://github.com/adap/flower/discussions/757

If you have more time on hand, you can also try to create a rework around that error (please refer to the GRPC core documentation ) - the issue, as I've said before, may be connected to the Windows 10/11 firewall.

@EliasBrohammer
Copy link

I had this issue too, but found a way to fix it.
My setup looks like this:

  1. Docker image with ubuntu 20.04 with an exposed port (like 8080)
  2. open three container of the image
  3. in my server script i get the ip address via
    # server.py
    import socket
    ip_address = socket.gethostbyname((socket.gethostname()))
    server_address=ip_address + ':8080'
    
    # do some stuff
    
    fl.server.start_server(server_address=server_address, .... )
  4. in my client script I set the ip address of the server
    # client.py
    ip_address = '0.0.0.0'  # here you should write the server ip-address
    server_address=ip_address + ':8080'
    
    # do some stuff
    
    fl.client.start_numpy_client(ip_address, client=MnistClient())

I'm using the sklearn example.
Hopefully this helps someone.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

4 participants