ni / grpc-labview

gRPC client and server support for LabVIEW
MIT License
85 stars 60 forks source link

Error when connecting LabVIEW gRPC client to C# server #374

Open suresh06-lv opened 1 month ago

suresh06-lv commented 1 month ago

Description Timeout error when trying to connect LabVIEW gRPC client to C# gRPC Server.
Encountered this problem when attempting to use the LabVIEW client to simulate TestStand operations by connecting to a C# server. This issue was first seen when trying to connect to the C# server provided in https://github.com/ni/grpc-teststand-api. I discovered that the problem persists even with a basic C# greeter gRPC service.

Steps to Reproduce

  1. Create a C# greeter service based on the tutorial from https://learn.microsoft.com/en-us/aspnet/core/tutorials/grpc/grpc-start?view=aspnetcore-8.0&tabs=visual-studio.
  2. Create a LabVIEW client using the proto file generated from step1.
  3. Build a sample gRPC client VI.
  4. Run the service.
  5. Connect LabVIEW greeter client using the address shown in the terminal and Run VI.

Expected Result Greeter response string concatenated with 'Hello' as prefix to client message input. "Hello " + Client Message

Actual Result image

Version LabVIEW - 2023 Q3

Images image

AB#2832543

j-medland commented 1 month ago

I don't think you want to specify the protocol in the server address just hostname:port

suresh06-lv commented 1 month ago

Thanks j-medland. That works for simple greeter service. But with the C# project for teststand services we're still seeing the error -1014 but with a different error message. image

jasonmreding commented 1 month ago

Double check there isn't an http proxy configured on your network. If there is one, you might need to bypass the proxy for your grpc server.

suresh06-lv commented 1 month ago

Hi Jason, Thanks for the comment.
Checked now and found that the proxy server is not configured already. So the previous attempts were also executed by bypassing the proxy server.

Franky-86 commented 4 weeks ago

If you‘re using https you need to provide the public part of a certificate (.crt). During creation of the C# project there was a popup that asked you to accept the user signed developer certificate. This certificate as a file should be used to create the client.

jasonmreding commented 19 hours ago

FWIW, I have successfully connected LV clients to a server written in C# (ASP.NET Core) so this is likely a network/setup issue and not a general issue with grpc-labview. Error -1014 corresponds to the UNAVAILABLE gRPC status code. From my experience, that error code happens if the server isn't running on that port, there is a proxy/firewall preventing connection to that machine, you are using the wrong scheme in the URL (http vs https), or there is something else in the server configuration that is causing the connection to get rejected. Usually console logging on the server can help diagnose some of this.