quickstarts icon indicating copy to clipboard operation
quickstarts copied to clipboard

Service Invocation demo can not invoke http request as expected

Open HackToday opened this issue 3 years ago • 1 comments

Expected Behavior

checkout service and order-processor service can get request and response output

Actual Behavior

ℹ️ Updating metadata for app command: go run app.go ✅ You're up and running! Both Dapr and your app logs will appear here.

== APP == exit status 1 == APP == Post "http://localhost:3500/orders": context deadline exceeded (Client.Timeout exceeded while awaiting headers) ❌ The App process exited with error code: exit status 1

Steps to Reproduce the Problem

Just follow this guide: https://docs.dapr.io/getting-started/quickstarts/serviceinvocation-quickstart/

My environment have http proxy setting, and I have no_proxy=127.0.0.1,localhost set.

HackToday avatar Aug 29 '22 07:08 HackToday

Since the original code have no timeout set, I set timeout to make sure it fail quickly(not wait too long for error)

                client := &http.Client{
                        Timeout: 60 * time.Second,
                }
                req, err := http.NewRequest("POST", DAPR_HOST+":"+DAPR_HTTP_PORT+"/orders", strings.NewReader(order))
                if err != nil {
                        fmt.Print(err.Error())
                        os.Exit(1)
                }

HackToday avatar Aug 29 '22 07:08 HackToday

Hi @HackToday

It looks like this was fixed back in https://github.com/dapr/go-sdk/pull/310 Any chance you could try a later/current release with the fix?

paulyuk avatar Jun 02 '23 08:06 paulyuk

Closing issue. Can not repo.

msfussell avatar Sep 21 '23 00:09 msfussell