grpc / grpc-web

gRPC for Web Clients
https://grpc.io
Apache License 2.0
8.59k stars 765 forks source link

hello world example,503 service unavailable #1383

Closed xuleixie closed 9 months ago

xuleixie commented 10 months ago

image

sampajano commented 10 months ago

Hi!

503 Error seems to indicate that there's some mis-configuration on the backend, hence making it not available.

Could you try the following Echo example and see if it works for you? https://github.com/grpc/grpc-web#advanced-demo-browser-echo-app

And if it does, you can try compare what you're doing differently from the echo app, to understand what's wrong.

xuleixie commented 10 months ago

thank you,echo example running success!

xuleixie commented 10 months ago

thank you very much! image

sampajano commented 10 months ago

Aha ok! good to hear!

In that case, you can try comparing your Envoy config with what's used in the echo example, showed below:

https://github.com/grpc/grpc-web/blob/master/net/grpc/gateway/docker/envoy/Dockerfile https://github.com/grpc/grpc-web/blob/master/net/grpc/gateway/examples/echo/envoy.yaml

If nothing stands out, you can check the node server config below:

https://github.com/grpc/grpc-web/blob/master/net/grpc/gateway/docker/node_server/Dockerfile https://github.com/grpc/grpc-web/blob/master/net/grpc/gateway/examples/echo/node-server/server.js

Most likely, you'd have mis-configured one of the above in the hello world example, hence it wasn't working.

sampajano commented 9 months ago

Closing for now. Feel free to reopen if you still have issues :)