Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

升级到4.x后开启任务调度,Client登录报错? #16

Open
zhaoweijie1213 opened this issue Dec 31, 2024 · 2 comments
Open

升级到4.x后开启任务调度,Client登录报错? #16

zhaoweijie1213 opened this issue Dec 31, 2024 · 2 comments

Comments

@zhaoweijie1213
Copy link

zhaoweijie1213 commented Dec 31, 2024

启动代码是这样的

      /// <summary>
      /// 开始任务调度
      /// </summary>
      /// <returns></returns>
      public Task StartAsync()
      {
          scheduler = new()
          {
              ServiceProvider = serviceProvider,
              // 使用分布式调度引擎替换默认的本地文件调度
              Provider = new NetworkJobProvider(antSetting.Value),
              Log = schedulerLogger
          };


          // 添加作业处理器
          var jobs = serviceProvider.GetServices<Handler>();
          scheduler.Handlers.AddRange(jobs);
          // 启动调度引擎,调度器内部多线程处理
          scheduler.Start();

          return Task.CompletedTask;
      }

AppID和Secret配置是正确的,报错信息是 ([Login]Value cannot be null. (Parameter 'User')),升级到4.0.2024.1216版本后才会出现,使用3.x为什么没问题?4.x是需要加哪些配置吗?

System.AggregateException
  HResult=0x80131500
  Message=One or more errors occurred. ([Login]Value cannot be null. (Parameter 'User'))
  Source=System.Private.CoreLib
  StackTrace:
   在 System.Threading.Tasks.Task.ThrowIfExceptional(Boolean includeTaskCanceledExceptions)
   在 System.Threading.Tasks.Task.Wait(Int32 millisecondsTimeout, CancellationToken cancellationToken)
   在 System.Threading.Tasks.Task.Wait()
   在 AntJob.Providers.NetworkJobProvider.Start()
   在 AntJob.Scheduler.OnStart()
   在 AntJob.Scheduler.Start()
   在 GameDataStatistics.Host.Services.SchedulerService.StartAsync() 在 F:\DataGather\GameDataStatistics\GameDataStatistics.Host\Services\SchedulerService.cs 中: 第 52 行
   在 GameDataStatistics.Host.Services.StartupService.<StartAsync>d__2.MoveNext() 在 F:\DataGather\GameDataStatistics\GameDataStatistics.Host\Services\StartupService.cs 中: 第 13 行
   在 Microsoft.Extensions.Hosting.Internal.Host.<<StartAsync>b__15_1>d.MoveNext()
   在 Microsoft.Extensions.Hosting.Internal.Host.<ForeachService>d__18`1.MoveNext()
   在 Microsoft.Extensions.Hosting.Internal.Host.<StartAsync>d__15.MoveNext()
   在 Microsoft.Extensions.Hosting.HostingAbstractionsHostExtensions.<RunAsync>d__4.MoveNext()
   在 Microsoft.Extensions.Hosting.HostingAbstractionsHostExtensions.<RunAsync>d__4.MoveNext()
   在 Microsoft.Extensions.Hosting.HostingAbstractionsHostExtensions.Run(IHost host)
   在 Program.<Main>$(String[] args) 在 F:\DataGather\GameDataStatistics\GameDataStatistics.Host\Program.cs 中: 第 23 行

  此异常最初是在此调用堆栈中引发的: 
    NewLife.Remoting.Clients.ClientBase.InvokeAsync<TResult>(string, object, System.Threading.CancellationToken)
    NewLife.Remoting.Clients.ClientBase.Login(System.Threading.CancellationToken)

内部异常 1:
ApiException: [Login]Value cannot be null. (Parameter 'User')

@nnhy
Copy link
Member

nnhy commented Jan 11, 2025

这是服务端有问题,你试试升级服务端到最新代码再测试。或者把服务端对其它NewLife组件的引用,升级到beta版。

@zhaoweijie1213
Copy link
Author

这是服务端有问题,你试试升级服务端到最新代码再测试。或者把服务端对其它NewLife组件的引用,升级到beta版。

升级服务端后,客户端旧版本不用升级吧?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants