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.

How to set http port & force client to use http not grpc

See original GitHub issue

await client.SaveStateAsync(storeName, stateKeyName, state, cancellationToken: cancellationToken);

I’m getting this crashing error, but I don’t want to use grpc, I want to use http.

| Message | “Status(StatusCode="Internal", Detail="Error starting gRPC call. HttpRequestException: No connection could be made because the target machine actively refused it. SocketException: No connection could be made because the target machine actively refused it.", DebugException="System.Net.Http.HttpRequestException: No connection could be made because the target machine actively refused it.\r\n —> System.Net.Sockets.SocketException (10061): No connection could be made because the target machine actively refused it.\r\n at System.Net.Http.ConnectHelper.ConnectAsync(String host, Int32 port, CancellationToken cancellationToken)\r\n — End of inner exception stack trace —\r\n at System.Net.Http.ConnectHelper.ConnectAsync(String host, Int32 port, CancellationToken cancellationToken)\r\n at System.Net.Http.HttpConnectionPool.ConnectAsync(HttpRequestMessage request, Boolean allowHttp2, CancellationToken cancellationToken)\r\n at System.Net.Http.HttpConnectionPool.GetHttp2ConnectionAsync(HttpRequestMessage request, CancellationToken cancellationToken)\r\n at System.Net.Http.HttpConnectionPool.SendWithRetryAsync(HttpRequestMessage request, Boolean doRequestAuth, CancellationToken cancellationToken)\r\n at System.Net.Http.RedirectHandler.SendAsync(HttpRequestMessage request, CancellationToken cancellationToken)\r\n at System.Net.Http.DiagnosticsHandler.SendAsync(HttpRequestMessage request, CancellationToken cancellationToken)\r\n at Grpc.Net.Client.Internal.GrpcCall2.RunCall(HttpRequestMessage request, Nullable1 timeout)")” | string

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:11

github_iconTop GitHub Comments

3reactions
rynowakcommented, Feb 25, 2021

We don’t provide an option to configure what protocol the SDK does (except service invocation). Can you tell us more about the scenario and why you think this is important?

1reaction
rynowakcommented, Feb 27, 2021

So for this approach to work, you’ll need to expose a port for grpc to and from the sidecar, and then configure that in your application or via the DAPR_GRPC_PORT or use the default (50001)

sam-dapr:
    image: "daprio/daprd:1.0.0"
    command: ["./daprd",
    "-app-id", "myapp",
    "-dapr-http-port", "3500",
    "-dapr-grpc-port", "50001",
    "-components-path", "/components"]
    volumes:
        - "./components/:/components"
    ports:
      - "3500:3500"
      - "50001:50001"
    expose:
      - "3500"
      - "50001"
    depends_on:
      - redis
Read more comments on GitHub >

github_iconTop Results From Across the Web

How to enforce HTTP (instead of HTTPS) while calling ...
How to enforce HTTP (instead of HTTPS) while calling gRPC service from Server-Side Blazor · Adding AppContext.SetSwitch("System.Net.Http.
Read more >
Troubleshoot gRPC on .NET
Insecure gRPC services must be hosted on a HTTP/2-only port. ... The gRPC client must also be configured to not use TLS.
Read more >
gRPC vs REST: Understanding gRPC, OpenAPI and REST ...
gRPC uses HTTP/2 under the covers, but HTTP is not exposed to the API designer ... The OpenAPI method of using HTTP requires...
Read more >
Routing GRPC through http router/service rules not working
When I attempt to use a GRPC client, it doesn't match the host nor PathPrefix name. It's like it doesn't hit any of...
Read more >
Authentication
An overview of gRPC authentication, including built-in auth mechanisms, and how to plug in your own authentication systems.
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