liftbridge-io / go-liftbridge

Go client for Liftbridge. https://github.com/liftbridge-io/liftbridge
Apache License 2.0
66 stars 18 forks source link

v2 client isn't working with server v1.3.0 #94

Closed taosx closed 3 years ago

taosx commented 3 years ago

The code is from the basic usage code in the readme. The client version is v2.0.1.

I'm running the server inside a docker container from the get started guide on the liftbridge page: docker run -d --name=liftbridge-main -p 4222:4222 -p 9292:9292 -p 8222:8222 -p 6222:6222 liftbridge/standalone-dev:v1.3.0 If I change the version to v1.2.0 everything seems to be working.

❯ go run main.go
panic: rpc error: code = Unavailable desc = connection closed

goroutine 1 [running]:
main.main()
        /home/taosx/project/lbex/main.go:17 +0x413
exit status 2

The server doesn't show anything in the logs.

tylertreat commented 3 years ago

Thanks, will take a look and see if I can reproduce.

tylertreat commented 3 years ago

It looks like this is specific to the standalone image since the v1.3.0 binary works outside of Docker. Still investigating...

tylertreat commented 3 years ago

I've tracked the issue down to this PR, which changed the default host to localhost. Changing this to 0.0.0.0 fixes it. I'll create a PR with this fix.

tylertreat commented 3 years ago

This has been fixed in https://github.com/liftbridge-io/liftbridge/pull/287. The fix is available in the latest images:

docker pull liftbridge/standalone-dev:latest
docker run -d --name=liftbridge-main -p 4222:4222 -p 9292:9292 -p 8222:8222 -p 6222:6222 liftbridge/standalone-dev:latest

Alternatively, you can use the existing v1.3.0 image and just override the host:

docker run -d --name=liftbridge-main -p 4222:4222 -p 9292:9292 -p 8222:8222 -p 6222:6222 -eLIFTBRIDGE_HOST=0.0.0.0 liftbridge/standalone-dev:v1.3.0