question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Error on helloworld example

See original GitHub issue

Hi!

I just try to run the hello world example to try this project but I’m facing a upstream connect error or disconnect/reset before headers error when I try to fetch http://localhost:8081/ in my browser.

The code of my helloworld project is identical to those you give in the README.md (I ended up copying/plasting files). The compilation of the protoc-gen-grpc-web and the generation with protoc are well done too.

The only issue happens when I try to run the envoy image with this command: docker run -d -p 8080:8080 --network=host helloworld/envoy. I have:

  • this warning from Docker: WARNING: Published ports are discarded when using host network mode
  • this error in my browser: Http response at 400 or 500 level.

So I tried without the host network (like this: docker run -d -p 8080:8080 helloworld/envoy) and it’s a bit better: no more Docker warning and a 200 on the http://localhost:8080/helloworld.Greeter/SayHello but I have this error now: upstream connect error or disconnect/reset before headers.

Also, when I watch the /clusters it seems that the greeter_service::[::]:0::cx_connect_fail is incremented on each try. So it seems to be a connection problem.

Does someone have an idea? Thanks a lot! 😃

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:4
  • Comments:7

github_iconTop GitHub Comments

5reactions
QuentinBrossecommented, Nov 18, 2018

Thanks @stanley-cheung for your quick answer! Indeed, I’m using MacOs. Your advice was really helpful, thanks!

In order to make it work, I created a docker compose file. I think it could be a good idea to include it in the helloworld guide in order to reduce the friction during the onboarding of new users. What do you think?

Here is the changes that I have made:

docker-compose.yaml

Note that link is a legacy feature so I rather chose a network. Can you confirm that it will work on other OS (Linux, Windows, etc.)?

version: '3'

services:
  envoy:
    build:
      context: .
      dockerfile: envoy.Dockerfile
    ports:
      - '8080:8080'
      - '9901:9901'
    networks:
      - server-net
  server:
    build:
      context: .
      dockerfile: server.Dockerfile
    ports:
      - '9090:9090'
    networks:
      - server-net

networks:
  server-net:

server.Dockerfile

FROM node

WORKDIR /helloworld

COPY ./package.json ./package.json
RUN npm install

COPY ./helloworld.proto ./helloworld.proto
COPY ./server.js ./server.js

CMD node ./server.js

envoy.yaml:

  clusters:
  - name: greeter_service
    connect_timeout: 0.25s
    type: logical_dns
    http2_protocol_options: {}
    lb_policy: round_robin
-    hosts: [{ socket_address: { address: localhost, port_value: 9090 }}]
+    hosts: [{ socket_address: { address: server, port_value: 9090 }}]

Tell me if you are interested by these changes, I could make a PR. 😃

2reactions
chiamtccommented, Jan 16, 2019

issue #436 helped me if anyone in the future isn’t using docker-compose.yaml

Read more comments on GitHub >

github_iconTop Results From Across the Web

Errors in “Hello World” program - Emblogic
Errors in “Hello World” program.
Read more >
'Hello'/Text undeclared while printing Hello world using printf()
While printing "Hello world", if this error 'Hello' undeclared occurred that means Hello is supplied to the compiler as a variable not as...
Read more >
Hello World Run Error – IDEs Support (IntelliJ Platform)
Hello, i am new to programming and my hello world is not running as expected. i would appreciate all your help so that...
Read more >
Java Hello World First Program and Java Vm Error Fixing
In this tutorial I will show you how to write your java first hello world program in notepad and then how to compile...
Read more >
Hello World error | Cloud Functions Documentation
Demonstrates how to report an error. Explore further. For detailed documentation that includes this code sample, see the following: Report errors · Reporting ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found