tonic icon indicating copy to clipboard operation
tonic copied to clipboard

Unable to connect to server

Open blagovestb2c2 opened this issue 4 years ago • 1 comments

Bug Report

Version

│   ├── redacted
│   │   └── tonic v0.5.2
│   │   └── tonic-build v0.5.2
│   ├── tonic-health v0.4.1
│   │   └── tonic v0.5.2 (*)
│   │   └── tonic-build v0.5.2 (*)
│   ├── tonic-web v0.1.0
│   │   ├── tonic v0.5.2 (*)
│   └── tonic-web v0.1.0 (*)
└── tonic-web v0.1.0 (*)
├── tonic v0.5.2 (*)
└── tonic-web v0.1.0 (*)

Platform

behind vpn (which i'm using when i try to connect) Darwin ip-???.???.???.???.eu-west-2.compute.internal 20.5.0 Darwin Kernel Version 20.5.0: Sat May 8 05:10:33 PDT 2021; root:xnu-7195.121.3~9/RELEASE_X86_64 x86_64

Description

I tried this code:

let mut client = vf::codegen_client::CodegenClient::connect(server_addr).await?;

let response = client.method(arg).await;

I expected to see this happen: have Response be Ok() and see logs on the other side

Instead, this happened: Err(Status { code: Unknown, message: "transport error", source: None })

I worked on this with devops. Our server is running in k8s on aws behind aws elb. We seem to have reached the conclusion that the problem comes from a missing Host header that makes the load balancer respond with 400 (in html) because it cannot resolve the virtual host. Since i am using the example code for the server, i was expecting the example code for the client to work but alas. I tried to see if i have any control over headers, but i got lost. I don't have in-depth knowledge of the grpc protocol. Am I doing something wrong?

blagovestb2c2 avatar Aug 23 '21 10:08 blagovestb2c2

hmmmm this seems like it is a bug with tonic-web maybe?

LucioFranco avatar Oct 13 '21 21:10 LucioFranco