To determine the reason for the connection problems with the server, the following questions should be clarified:
Is the gRPC server running?
The gRPC server runs on a local port (for example, 9000) by default. You can easily check whether the server is accessible via PowerShell.
Command in PowerShell:
Test-NetConnection 127.0.0.1 -Port 9000
Typical output:
ComputerName : 127.0.0.1
RemoteAddress : 127.0.0.1
RemotePort : 9000
InterfaceAlias : Loopback Pseudo-Interface 1
SourceAddress : 127.0.0.1
TcpTestSucceeded : True
Important:
If TcpTestSucceeded : True is displayed, the gRPC server can be reached and is running.
If False, the server is either not started or the port is not available.
What does a gRPC connection error mean when establishing a connection?
In the FEP environment, the following (at first glance cryptic) error message may appear when the gRPC connection is established:
gRPC Connection error: Unavailable - Error starting gRPC call.
HttpRequestException: An HTTP/2 connection could not be established because
the server did not complete the HTTP/2 handshake. (InvalidResponse)
HttpIOException: The response ended prematurely while waiting for the next frame
from the server. (ResponseEnded)
Possible cause:
The configured port (for example, 9000) is already occupied by another process. In this case, the gRPC server cannot perform the HTTP/2 handshake correctly.
How can I check whether a port is already in use?
The netstat command in PowerShell can be used to display all processes that use a specific port.
Command in PowerShell:
netstat -ano | findstr :9000
Sample output:
Proto Local Address Foreign Address State PID
TCP 0.0.0.0:9000 0.0.0.0:0 LISTENING 17616
Meaning of the columns:
Local Address: Local IP and port
State: Status (for example, LISTENING)
PID: Process ID using the port
How do I find out which process is using a specific port?
With the PID determined, the associated process can be queried via PowerShell to obtain the process name and other details.
Command in PowerShell:
get-process -id 17616
Info:
As an alternative, the process can also be identified via the Windows Task Manager using the PID.
Recommended Solutions
- Configure an alternative, free port for the gRPC server.
- Or (if possible) adjust the port configuration of the blocking software.
- After the change, restart the server and test the connection.