1

I have a GRPC service that I've implemented with TypeScript, and I'm interactively testing with BloomRPC. I've set it up (both client and server) with insecure connections to get things up and running. When I run the service locally (on port 3333), I'm able to interact with the service perfectly using BloomRPC - make requests, get responses.

However, when I include the service into a Docker container, and expose the same ports to the local machine, BloomRPC returns an error:

{
    "error": "2 UNKNOWN: Stream removed"
}

I've double checked the ports, and they're open. I've enabled the additional GRPC debugging output logging, and tried tracing the network connections. I see a network connection through to the service on Docker, but then it terminates immediately. When I looked at tcpdump traces, I could see the connection coming in, but no response is provided from my service back out.

I've found other references to 2 UNKNOWN: Stream removed which appear to primarily be related to SSL/TLS setup, but as I'm trying to connect this in an insecure fashion, I'm uncertain what's happening in the course of this failure. I have also verified the service is actively running and logging in the docker container, and it responds perfectly well to HTTP requests on another port from the same process.

I'm at a loss as to what's causing the error and how to further debug it. I'm running the container using docker-compose, alongside a Postgres database.

My docker-compose.yaml looks akin to:

services:
  sampleservice:
    image: myserviceimage
    environment:
      NODE_ENV: development
      GRPC_PORT: 3333
      HTTP_PORT: 8080
      GRPC_VERBOSITY: DEBUG
      GRPC_TRACE: all
    ports:
      - 8080:8080
      - 3333:3333
  db:
    image: postgres
    ports:
      - 5432:5432

Any suggestions on how I could further debug this, or that might explain what's happening so that I can run this service reliably within a container and interact with it from outside the container?

heckj
  • 7,136
  • 3
  • 39
  • 50
  • i'm not sure whether you're familiar with `grpc` or `docker`. if not familiar with docker, you can simply try a http rest api instead of grpc, it is much easier. and can you put more information on why you think TLS is related, are you using https anywhere? – Lei Yang Jun 25 '21 at 01:36
  • It's the GRPC side of this that I'm not familiar with. I'd love to stick with just HTTP/HTTPS with the container, as I'm super-comfortable with how that works, but GRPC is the requirement here. – heckj Jun 25 '21 at 16:10
  • Did you ever work this out? I have the same issue – Fred Johnson Apr 22 '22 at 08:09
  • I never did work out the specifics - after various attempts, we switched our development setup to avoid using Docker with the services an an internal network. I've since seen references to specific named networks with Docker, but the details were unclear on how you reference it out to allow the communications. – heckj Apr 23 '22 at 21:56

0 Answers0