Grpc and IPv6 Issue

Is there a way to prevent grpc from using IPv6? FYI, I have two Windows nodes with MS SQL behind a HA Proxy.
Grpc.Core.RpcException: Status(StatusCode=“Unknown”, Detail=“Exception was thrown by handler.”, DebugException=“Grpc.Core.Internal.CoreErrorDetailException: {“created”:”@1737443663.187000000",“description”:“Error received from peer ipv6:[::1]:50060”,“file”:“…....\src\core\lib\surface\call.cc”,“file_line”:953,“grpc_message”:“Exception was thrown by handler.”,“grpc_status”:2}“) —> Grpc.Core.Internal.CoreErrorDetailException: {“created”:”@1737443663.187000000",“description”:“Error received from peer ipv6:[::1]:50060”,“file”:“…....\src\core\lib\surface\call.cc”,“file_line”:953,“grpc_message”:“Exception was thrown by handler.”,“grpc_status”:2}

What are you trying to do when you get this error? It could just be inter-process communication on one node and resolving localhost to the IPv6 address.

Every once in a while, I get the same thing when scheduled script run, therefore causing it to fail. It tries doing IPv6 and then fails.

@adam Just had it happen causing script not to run: Status(StatusCode=“Unknown”, Detail=“Exception was thrown by handler.”, DebugException=“Grpc.Core.Internal.CoreErrorDetailException: {“created”:”@1738008084.457000000",“description”:“Error received from peer ipv6:[::1]:65052”,“file”:“…....\src\core\lib\surface\call.cc”,“file_line”:953,“grpc_message”:“Exception was thrown by handler.”,“grpc_status”:2}")

You could simply turn off IPv6 on the adapter. That would solve the issue (assuming that you’re not using IPv6 in other aspects).

Or you could turn it off globally, via the Registry:

  • Open the registry editor
  • Navigate to HKEY_LOCAL_MACHINE > SYSTEM > CurrentControlSet > Services > TCPIP6 > Parameters
  • Create a new DWORD
  • Right-click on Parameters and select New, then DWORD (32-bit)
  • Set the name to DisabledComponents and press Enter
  • Right-click on the new entry and select Modify
  • Set the Hex value to FFFFFFF and click OK

I will try that. I disabled it on the Net Adapters but didn’t try it from Registry.

I have set it and we will see. I noticed it still didn’t disable the loopback on Windows Server 2022. Can still ping ::1 even with the value set to FFFFFFFF

Still get another one: Status(StatusCode=“Unknown”, Detail=“Exception was thrown by handler.”, DebugException=“Grpc.Core.Internal.CoreErrorDetailException: {“created”:”@1738098061.402000000",“description”:“Error received from peer ipv6:[::1]:50081”,“file”:“…....\src\core\lib\surface\call.cc”,“file_line”:953,“grpc_message”:“Exception was thrown by handler.”,“grpc_status”:2}")

Do you have any other errors in system your log? I wonder if the handler is actually throwing an exception and isn’t actually IPv6 related.

That said, we could change how localhost is resolved. We could introduce a setting to specify the IPv4 loopback.

I might have found what it is. I am using permissive mode. I think one of the nodes is going unresponsive for a second when a bunch of jobs are queuing then gRPC tries to go through the loopback and then show the error. It doesn’t happen all the time but periodically (maybe 3-4 times a day). For context we probably run around 3,000 jobs a day.