应用数据清理报错

问答  收藏
7 / 190

应用数据清理异常 | HAP 社区 (mingdao.net)
按照私有部署的应用数据清理操作后报异常,然后找了相关的帖子,执行后还是异常:

执行时间 05/29/2024 11:42:00,删除10天之前的数据,删除应用范围: 05/19/2024 00:00:00 之前
AppActivityService_删除应用job执行异常,具体异常信息:
System.TimeoutException: A timeout occured after 30000ms selecting a server using CompositeServerSelector{ Selectors = MongoDB.Driver.MongoClient+AreSessionsSupportedServerSelector, LatencyLimitingServerSelector{ AllowedLatencyRange = 00:00:00.0150000 } }. Client view of cluster state is { ClusterId : "1", ConnectionMode : "Automatic", Type : "Unknown", State : "Disconnected", Servers : [{ ServerId: "{ ClusterId : 1, EndPoint : "Unspecified/app:27017" }", EndPoint: "Unspecified/app:27017", ReasonChanged: "Heartbeat", State: "Disconnected", ServerVersion: , TopologyVersion: , Type: "Unknown", HeartbeatException: "MongoDB.Driver.MongoConnectionException: An exception occurred while opening a connection to the server.
 ---> System.Net.Sockets.SocketException (111): Connection refused
   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.Threading.Tasks.ValueTask.ValueTaskSourceAsTask.<>c.<.cctor>b__4_0(Object state)
--- End of stack trace from previous location ---
   at MongoDB.Driver.Core.Connections.TcpStreamFactory.ConnectAsync(Socket socket, EndPoint endPoint, CancellationToken cancellationToken)
   at MongoDB.Driver.Core.Connections.TcpStreamFactory.CreateStreamAsync(EndPoint endPoint, CancellationToken cancellationToken)
   at MongoDB.Driver.Core.Connections.BinaryConnection.OpenHelperAsync(CancellationToken cancellationToken)
   --- End of inner exception stack trace ---
   at MongoDB.Driver.Core.Connections.BinaryConnection.OpenHelperAsync(CancellationToken cancellationToken)
   at MongoDB.Driver.Core.Servers.ServerMonitor.InitializeConnectionAsync(CancellationToken cancellationToken)
   at MongoDB.Driver.Core.Servers.ServerMonitor.HeartbeatAsync(CancellationToken cancellationToken)", LastHeartbeatTimestamp: "2024-05-29T03:42:30.0897289Z", LastUpdateTimestamp: "2024-05-29T03:42:30.0897290Z" }] }.
   at MongoDB.Driver.Core.Clusters.Cluster.ThrowTimeoutException(IServerSelector selector, ClusterDescription description)
   at MongoDB.Driver.Core.Clusters.Cluster.WaitForDescriptionChangedHelper.HandleCompletedTask(Task completedTask)
   at MongoDB.Driver.Core.Clusters.Cluster.WaitForDescriptionChanged(IServerSelector selector, ClusterDescription description, Task descriptionChangedTask, TimeSpan timeout, CancellationToken cancellationToken)
   at MongoDB.Driver.Core.Clusters.Cluster.SelectServer(IServerSelector selector, CancellationToken cancellationToken)
   at MongoDB.Driver.MongoClient.AreSessionsSupportedAfterServerSelection(CancellationToken cancellationToken)
   at MongoDB.Driver.MongoClient.AreSessionsSupported(CancellationToken cancellationToken)
   at MongoDB.Driver.MongoClient.StartImplicitSession(CancellationToken cancellationToken)
   at MongoDB.Driver.OperationExecutor.StartImplicitSession(CancellationToken cancellationToken)
   at MongoDB.Driver.MongoCollectionImpl`1.UsingImplicitSession[TResult](Func`2 func, CancellationToken cancellationToken)
   at MongoDB.Driver.MongoCollectionImpl`1.FindSync[TProjection](FilterDefinition`1 filter, FindOptions`2 options, CancellationToken cancellationToken)
   at MD.MongoDB.MongoBaseRepository`1.Find(FilterDefinition`1 filter, FindOptions`2 options, CancellationToken cancellationToken)
   at MD.AppActivityTask.Repositories.ApkRepository.GetAllApk(DateTime time) in /data/jenkins/workspace/private_schedulertool/MDSchedulerTools/MD.AppActivityTask/Repositories/ApkRepository.cs:line 85
   at MD.AppActivityTask.Services.AppActivityService.Run(Nullable`1 startDate, Nullable`1 endDate, Boolean isPrivate) in /data/jenkins/workspace/private_schedulertool/MDSchedulerTools/MD.AppActivityTask/Services/AppActivityService.cs:line 122
定时清理任务,执行完成!! time: 05/29/2024 11:42:30

注意到报错里有这个 Unspecified/app:27017,是哪里有什么问题吗
配置文件 dataclean.yaml:

services:
  app:
    image: registry.cn-hangzhou.aliyuncs.com/mdpublic/mingdaoyun-dataclean-app:1.0.0
    networks:
      - home_default
    volumes:
      - ./appsettings.json:/app/Config/appsettings.json

networks:
  home_default:
    external: true

appsettings.json:

"WorksheetConnStr": "mongodb://app:27017/mdworksheet",
 "MD_WSService1": "mongodb://app:27017/mdwsrows",
 "MD_WSService2": "mongodb://app:27017/mdwsrows",
 "MD_WSService3": "mongodb://app:27017/mdwsrows",
 "MD_WSService4": "mongodb://app:27017/mdwsrows",
 "MD_WSService5": "mongodb://app:27017/mdwsrows",
 "MD_WSService6": "mongodb://app:27017/mdwsrows",
 "MD_WSService7": "mongodb://app:27017/mdwsrows",
 "MD_WSService8": "mongodb://app:27017/mdwsrows",
 "MD_WSService9": "mongodb://app:27017/mdwsrows",
 "MD_WSService10": "mongodb://app:27017/mdwsrows",
 "MD_WSLogService1": "mongodb://app:27017/mdworksheetlog",
 "ApkConnStr": "mongodb://app:27017/mdapps", 
 "AppRoleConnStr": "mongodb://app:27017/mdapproles",
 "MD.Worksheet.DbName": "mdworksheet",
 "MD.WorksheetRow.DbName": "mdwsrows",
 "DeleteDay": 10, 
 "DeleteRowByNomal": 1,
 "DelateRowDay": 10, 
 "DelateRowTotal": 1000,
 "Corn": "0 52 16 28 5 * "
}