dapr/dapr · error

the 'dapr-grpc-port' argument value %d conflicts with 'app-p

Error message

the 'dapr-grpc-port' argument value %d conflicts with 'app-port'

What it means

Config init rejects the combination where the application port equals the sidecar gRPC API port (pkg/runtime/config.go:464). The app's listener and the Dapr gRPC API cannot share a port; the check fires immediately with the conflicting value.

Source

Thrown at pkg/runtime/config.go:464

			return nil, fmt.Errorf("error parsing dapr-public-port: %w", err)
		}

		intc.publicPort = &port
	}

	if c.ApplicationPort != "" {
		intc.appConnectionConfig.Port, err = strconv.Atoi(c.ApplicationPort)
		if err != nil {
			return nil, fmt.Errorf("error parsing app-port: %w", err)
		}
	}

	if intc.appConnectionConfig.Port == intc.httpPort {
		return nil, fmt.Errorf("the 'dapr-http-port' argument value %d conflicts with 'app-port'", intc.httpPort)
	}

	if intc.appConnectionConfig.Port == intc.apiGRPCPort {
		return nil, fmt.Errorf("the 'dapr-grpc-port' argument value %d conflicts with 'app-port'", intc.apiGRPCPort)
	}

	if intc.maxRequestBodySize == -1 {
		intc.maxRequestBodySize = DefaultMaxRequestBodySize
	}

	if intc.readBufferSize == -1 {
		intc.readBufferSize = DefaultReadBufferSize
	}

	if c.DaprGracefulShutdownSeconds < 0 {
		intc.gracefulShutdownDuration = DefaultGracefulShutdownDuration
	} else {
		intc.gracefulShutdownDuration = time.Duration(c.DaprGracefulShutdownSeconds) * time.Second
	}

	if intc.actorsDisseminationTimeout <= 0 {
		intc.actorsDisseminationTimeout = DefaultActorsDisseminationTimeout

View on GitHub (pinned to 74ad417027)

Solutions

  1. Move the app to a different port (e.g. 50000 or 3000) or set --dapr-grpc-port to another free port
  2. Keep convention: app gRPC on its own port, sidecar gRPC on 50001

Example fix

# before
dapr run --app-id myapp --app-protocol grpc --app-port 50001

# after
dapr run --app-id myapp --app-protocol grpc --app-port 50000
Defensive patterns

Strategy: validation

Validate before calling

if c.ApplicationPort != "" {
	appPort, _ := strconv.Atoi(c.ApplicationPort)
	grpcPort, _ := strconv.Atoi(c.DaprAPIGRPCPort)
	if appPort == grpcPort {
		return fmt.Errorf("app-port %d collides with dapr-grpc-port; change one", appPort)
	}
}

Type guard

func portsConflict(app, sidecar int) bool { return app != 0 && app == sidecar }

Prevention

When it happens

Trigger: Passing --app-port N where N == --dapr-grpc-port (default 50001) — e.g. a gRPC app on 50001 with the default sidecar gRPC port.

Common situations: gRPC apps that copied 50001 as their own port; swapping an app from HTTP to gRPC without re-checking the sidecar gRPC port.

Related errors


AI-assisted analysis of dapr/dapr@74ad417027 (2026-08-16). Data as JSON: /api/errors/9a4b9c9cc4879e3a. Report an issue: GitHub.