dapr / dapr/cli

Default Dapr gRPC port is inconsistent with documentation

Open
#1,023 3 comments 0 reactions 1 assignee Claimed by @shivam-51 View on GitHub
good first issue kind/bug P1 triaged/resolved
Dominant language
Go
Stars
353
Forks
221
Avg merge
3d 8h
Merged PRs (30d)
2

Description

According to [the `dapr run` documentation](https://docs.dapr.io/reference/cli/dapr-run/), the default value for `--dapr-grpc-port` is `50001`.

![image](https://user-images.githubusercontent.com/2704139/178075521-6925b662-36af-4f91-b84e-31b960e47a44.png)

## Expected Behavior

When invoking `dapr run` without specifying `--dapr-grpc-port` would cause it to listen on port 50001 for gRPC.

If using a random port is the prefered behavior, then I'd expect the documentation to say that the default port number is random and specify the expected port range.

## Actual Behavior

The actual behavior for `dapr run` seems to be to select a random gRPC port, which is different from what the documentation states.

NOTE: I did observe the .NET SDK assumes a default port of 50001. Not sure about other SDKs, but this does seem to indicate some sort of mismatched expectations between SDKs and the Dapr CLI.

## Steps to Reproduce the Problem

Using Dapr CLI v1.7, run a command similar to the following:

```bash
dapr run --app-id myapp --app-protocol http --dapr-http-port 3501 --app-port 5001
```

And observe the first line of output (it mentions gRPC port 53375):

```
Starting Dapr with id myapp. HTTP Port: 3501. gRPC Port: 53375
```

This was a problem for me because I run the Dapr CLI separately from my application code. This means my application code doesn't get a `DAPR_GRPC_PORT` specified and I have to know in advance what port Dapr is listening on. Since SDKs assume a default port (50001), it made logical sense to me that the Dapr CLI would default to the same port as the SDKs.

## Release Note

RELEASE NOTE: **FIX** Bug in runtime (or documentation).

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.