首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >状态操作失败: Dapr端点指示失败

状态操作失败: Dapr端点指示失败
EN

Stack Overflow用户
提问于 2022-11-23 09:52:30
回答 1查看 38关注 0票数 2

在本教程.Net 6之后,我正在使用https://www.gokhan-gokalp.com/en/building-microservices-by-using-dapr-and-net-with-minimum-effort-01/ 6使用Dapr和状态管理做一个小项目。但有一个例外,我不知道如何处理。请告诉我,任何想法我都会非常感激的。

当我调用这个方法

像这样抛出一个异常

代码语言:javascript
复制
Dapr.DaprException: 'State operation failed: the Dapr endpoint indicated a failure. See InnerException for details.'

Inner Exception
RpcException: Status(StatusCode="Unavailable", Detail="Error connecting to subchannel.", DebugException="System.Net.Sockets.SocketException (10061): No connection could be made because the target machine actively refused it.
   at System.Net.Sockets.Socket.AwaitableSocketAsyncEventArgs.ThrowException(SocketError error, CancellationToken cancellationToken)
   at System.Net.Sockets.Socket.AwaitableSocketAsyncEventArgs.System.Threading.Tasks.Sources.IValueTaskSource.GetResult(Int16 token)
   at System.Net.Sockets.Socket.<ConnectAsync>g__WaitForConnectWithCancellation|277_0(AwaitableSocketAsyncEventArgs saea, ValueTask connectTask, CancellationToken cancellationToken)
   at Grpc.Net.Client.Balancer.Internal.SocketConnectivitySubchannelTransport.TryConnectAsync(CancellationToken cancellationToken)")

下面是运行dapr的命令

代码语言:javascript
复制
start dapr run --app-id shoppingcartapi --app-port 5001 --dapr-http-port 50001 --components-path "./components" -- dotnet run --project "./Dapr.ShoppingCart/Dapr.ShoppingCart.csproj"
start dapr run --app-id recommendationapi --app-port 6000 --dapr-http-port 50002 --components-path "./components" -- dotnet run --project "./Dapr.Recommendation/Dapr.Recommendation.csproj"

这是pubsub文件

代码语言:javascript
复制
apiVersion: dapr.io/v1alpha1
kind: Component
metadata:
  name: eventbus
spec:
  type: pubsub.redis
  version: v1
  metadata:
  - name: redisHost
    value: localhost:6379
  - name: redisPassword
    value: ""

和statestore yaml文件

代码语言:javascript
复制
apiVersion: dapr.io/v1alpha1
kind: Component
metadata:
  name: redisstore
spec:
  type: state.redis
  metadata:
  - name: redisHost
    value: localhost:6379
  - name: redisPassword
    value: ""
  - name: actorStateStore
    value: "true"
EN

回答 1

Stack Overflow用户

发布于 2022-12-02 08:07:19

在我的Program.cs文件中,我忘记添加这个管道app.MapActorsHandlers();。加上这个,问题就解决了。

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/74544801

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档