{"record":{"id":"9a4b9c9cc4879e3a","repo":"dapr/dapr","slug":"the-dapr-grpc-port-argument-value-d-conflicts-w","errorCode":null,"errorMessage":"the 'dapr-grpc-port' argument value %d conflicts with 'app-port'","messagePattern":"the 'dapr-grpc-port' argument value (.+?) conflicts with 'app-port'","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/runtime/config.go","lineNumber":464,"sourceCode":"\t\t\treturn nil, fmt.Errorf(\"error parsing dapr-public-port: %w\", err)\n\t\t}\n\n\t\tintc.publicPort = &port\n\t}\n\n\tif c.ApplicationPort != \"\" {\n\t\tintc.appConnectionConfig.Port, err = strconv.Atoi(c.ApplicationPort)\n\t\tif err != nil {\n\t\t\treturn nil, fmt.Errorf(\"error parsing app-port: %w\", err)\n\t\t}\n\t}\n\n\tif intc.appConnectionConfig.Port == intc.httpPort {\n\t\treturn nil, fmt.Errorf(\"the 'dapr-http-port' argument value %d conflicts with 'app-port'\", intc.httpPort)\n\t}\n\n\tif intc.appConnectionConfig.Port == intc.apiGRPCPort {\n\t\treturn nil, fmt.Errorf(\"the 'dapr-grpc-port' argument value %d conflicts with 'app-port'\", intc.apiGRPCPort)\n\t}\n\n\tif intc.maxRequestBodySize == -1 {\n\t\tintc.maxRequestBodySize = DefaultMaxRequestBodySize\n\t}\n\n\tif intc.readBufferSize == -1 {\n\t\tintc.readBufferSize = DefaultReadBufferSize\n\t}\n\n\tif c.DaprGracefulShutdownSeconds < 0 {\n\t\tintc.gracefulShutdownDuration = DefaultGracefulShutdownDuration\n\t} else {\n\t\tintc.gracefulShutdownDuration = time.Duration(c.DaprGracefulShutdownSeconds) * time.Second\n\t}\n\n\tif intc.actorsDisseminationTimeout <= 0 {\n\t\tintc.actorsDisseminationTimeout = DefaultActorsDisseminationTimeout","sourceCodeStart":446,"sourceCodeEnd":482,"githubUrl":"https://github.com/dapr/dapr/blob/74ad41702745709bb15fe2114ff693b8c59bc3cc/pkg/runtime/config.go#L446-L482","documentation":"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.","triggerScenarios":"Passing --app-port N where N == --dapr-grpc-port (default 50001) — e.g. a gRPC app on 50001 with the default sidecar gRPC port.","commonSituations":"gRPC apps that copied 50001 as their own port; swapping an app from HTTP to gRPC without re-checking the sidecar gRPC port.","solutions":["Move the app to a different port (e.g. 50000 or 3000) or set --dapr-grpc-port to another free port","Keep convention: app gRPC on its own port, sidecar gRPC on 50001"],"exampleFix":"# before\ndapr run --app-id myapp --app-protocol grpc --app-port 50001\n\n# after\ndapr run --app-id myapp --app-protocol grpc --app-port 50000","handlingStrategy":"validation","validationCode":"if c.ApplicationPort != \"\" {\n\tappPort, _ := strconv.Atoi(c.ApplicationPort)\n\tgrpcPort, _ := strconv.Atoi(c.DaprAPIGRPCPort)\n\tif appPort == grpcPort {\n\t\treturn fmt.Errorf(\"app-port %d collides with dapr-grpc-port; change one\", appPort)\n\t}\n}","typeGuard":"func portsConflict(app, sidecar int) bool { return app != 0 && app == sidecar }","tryCatchPattern":null,"preventionTips":["Never reuse 50001 as the app's gRPC port; assign app gRPC its own port","When switching an app from HTTP to gRPC, re-check it against the sidecar gRPC port"],"tags":["go","dapr","ports","conflict","grpc","startup"],"backgroundTag":null,"analyzedSha":"74ad41702745709bb15fe2114ff693b8c59bc3cc","analyzedAt":"2026-08-16T04:22:26.543Z","schemaVersion":2},"datasetVersion":"2026-08-16T08:17:34.114Z"}