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 establish session with the server #49

Open
SergiVera opened this issue Nov 3, 2020 · 8 comments
Open

Failed to establish session with the server #49

SergiVera opened this issue Nov 3, 2020 · 8 comments

Comments

@SergiVera
Copy link

Hi everyone,

I have some issues when trying to run the p4runtime shell, as shown in the following figure:
p4runtime-shell-error
I have used the following command: sudo ./p4runtime-sh-docker --grpc-addr 0.0.0.0:50001 --device-id 0 --election-id 0,1 --config ../p4-tutorial/basic-forwarding/build/basic.p4.p4info.txt,../p4-tutorial/basic-forwarding/build/basic.json I guess the error is in the --grpc-addr but I don't know how to proceed. I have tested it with addresses 0.0.0.0 and localhost but I always obtain the same error. Thanks in advance!

@antoninbas
Copy link
Member

0.0.0.0:50001 is not a valid address - you need to pass the address of the P4Runtime server. 0.0.0.0 is used in a server when you want to listen on every available interface. p4runtime-sh-docker is a client. Because you are using the Docker wrapper, the following information from the README may also apply:

If you are using the Docker image to run p4runtime-shell and you are trying to connect to a P4Runtime server running natively on the same system and listening on the localhost interface, you will not be able to connect to the server using --grpc-addr localhost: or --grpc-addr 127.0.0.1:. Instead, you should have your P4Runtime server listen on all interfaces (0.0.0.0) and you will need to use the IP address assigned to the Docker bridge (docker0 by default) or the IP address assigned to the local network management interface (e.g. eth0).

@SergiVera
Copy link
Author

Yes, I have already read the README but I don't understand it. Which is the IP address assigned to the Docker bridge?

@SergiVera
Copy link
Author

I think I have found the error. The file p4runtime-sh-docker lacks of --grpc-addr argument to pass on. Since neither IP nor port is specified, the error is: Failed to connect to all addresses

@fatihusta
Copy link

Hi @SergiVera
I have same issue. Did you solve this problem?

@emdneto
Copy link

emdneto commented Mar 31, 2021

When running the P4 Switch Container, you need to expose ports with the -p 50001:50001 flag. This way, you can run p4runtime-shell for localhost: 50001.

For example, if you run a topology with mn-stratum, you can run p4runtime-shell for localhost:50001, localhost:50002, and localhost:50003, as your host's port has been bound to your container. Check this example:

docker run --privileged --rm -it -p 50001-50003:50001-50003 opennetworking/mn-stratum --topo linear,3

@SergiVera
Copy link
Author

Hi @SergiVera
I have same issue. Did you solve this problem?

Hello, thanks @fatihusta @emdneto for your time, I've been able to solve the problem.

Regards

@belenbrandino
Copy link

Hi @SergiVera

I have the same problem. How did you solve it?

Many thanks

@SergiVera
Copy link
Author

Hello @belenbrandino,

In the end, I haven't used p4 in my project, but I'm sure I solve it too but I don't remember it well. I'm glad that you've solved it too!

Thanks

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

No branches or pull requests

5 participants