Grpc error after installing flow rules

Hi

I wrote a controller in Python that installs flow rules along multiple paths. According to my output logs, everything works fine for a while — flow rules are installed successfully on switch s12 during the first few times. However, at some point, when installing flow rules, I start getting a gRPC error for s12.

I’m not sure why this is happening, and I would really appreciate any help or suggestions. Thanks in advance!
·[11, 29, 30, 12]
Installed ipv4 rule on s11
Installed ipv4 rule on s12
Installed add rule on s11
Installed delete rule on s12
[12, 30, 31, 14]
Installed ipv4 rule on s12
Installed ipv4 rule on s13
Installed add rule on s12
Installed delete rule on s13
[18, 35, 31, 13]
Installed ipv4 rule on s17
Installed ipv4 rule on s13
Installed add rule on s17
Installed delete rule on s13
[1, 36, 21, 25, 26, 35, 29, 30, 31, 14]
Installed ipv4 rule on s18
Installed ipv4 rule on s3
Installed ipv4 rule on s7
Installed ipv4 rule on s8
Installed ipv4 rule on s17
Installed ipv4 rule on s11
gRPC Error: (UNKNOWN) [/home/p4/tutorials/exercises/myp4/controller.py:396]·

It appears you are using the p4lang/tutorials repository code from the error message you show.

Most or all of the exercises there create files with names like s1-p4runtime-requests.txt in the logs directory, which shows the contents of all P4Runtime API messages between the controller and that switch, if the connection between your controller and the switch was created with the right option. For example, the p4runtime exercise does this, using this Python call to create the connection to the switch:

I do not know if any details about grpc errors will appear in that file or not, but it should at least let yo uknow details about the successful ones.