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

0.3.11 fails to start when a schedule definition exists in the DB #312

Closed
bvandewe opened this issue Nov 7, 2022 · 3 comments
Closed

0.3.11 fails to start when a schedule definition exists in the DB #312

bvandewe opened this issue Nov 7, 2022 · 3 comments
Assignees
Labels
app: server Concerns the server priority: high Indicates a high priority issue type: bug Something isn't working weight: 1 An issue that has a very low development impact
Projects
Milestone

Comments

@bvandewe
Copy link

bvandewe commented Nov 7, 2022

What happened:

Synapse server 0.3.11 fails to boot and throws the following logs:

[11/07/2022 16:47:57] warn: ProtoBuf.Grpc.Server.ServicesExtensions.CodeFirstServiceMethodProvider[0]
      Type cannot be serialized; ignoring: Synapse.Integration.Commands.Workflows.V1UploadWorkflowCommand
[11/07/2022 16:47:57] warn: ProtoBuf.Grpc.Server.ServicesExtensions.CodeFirstServiceMethodProvider[0]
      Signature not recognized for Synapse.Apis.Management.Grpc.ISynapseGrpcManagementApi.UploadWorkflowAsync; method will not be bound
[11/07/2022 16:47:57] warn: ProtoBuf.Grpc.Server.ServicesExtensions.CodeFirstServiceMethodProvider[0]
      Signature not recognized for Synapse.Apis.Management.Grpc.ISynapseGrpcManagementApi.ArchiveWorkflowAsync; method will not be bound
[11/07/2022 16:47:57] info: ProtoBuf.Grpc.Server.ServicesExtensions.CodeFirstServiceMethodProvider[0]
      RPC services being provided by Synapse.Apis.Management.Grpc.SynapseGrpcManagementApi: 41
[11/07/2022 16:47:57] info: ProtoBuf.Grpc.Server.ServicesExtensions.CodeFirstServiceMethodProvider[0]
      RPC services being provided by Synapse.Apis.Runtime.Grpc.SynapseGrpcRuntimeApi: 22
[11/07/2022 16:47:57] info: Synapse.Application.Services.PluginManager[0]
      Scanning directory'/app/plugins' for plugins...
[11/07/2022 16:47:57] info: Synapse.Application.Services.PluginManager[0]
      Found 2 matching plugin files in directory '/app/plugins'
[11/07/2022 16:47:57] warn: Microsoft.AspNetCore.Server.Kestrel[0]
      Overriding address(es) 'http://+:80'. Binding to endpoints defined via IConfiguration and/or UseKestrel() instead.
[11/07/2022 16:47:57] info: Microsoft.Hosting.Lifetime[14]
      Now listening on: http://[::]:41387
[11/07/2022 16:47:57] info: Microsoft.Hosting.Lifetime[14]
      Now listening on: http://[::]:42286
[11/07/2022 16:47:57] info: Microsoft.Hosting.Lifetime[0]
      Application started. Press Ctrl+C to shut down.
[11/07/2022 16:47:57] info: Microsoft.Hosting.Lifetime[0]
      Hosting environment: Production
[11/07/2022 16:47:57] info: Microsoft.Hosting.Lifetime[0]
      Content root path: /app/
[11/07/2022 16:47:57] info: Synapse.Application.Services.PluginManager[0]
      2 plugins have been found in '/app/plugins' directory
[11/07/2022 16:47:57] info: Synapse.Application.Services.PluginManager[0]
      Loading plugin 'EventStore:0.2.0'...
[11/07/2022 16:47:57] info: Synapse.Application.Services.PluginManager[0]
      The plugin 'EventStore:0.2.0' has been successfully loaded
[11/07/2022 16:47:57] info: Synapse.Application.Services.PluginManager[0]
      Loading plugin 'MongoDB:0.2.0'...
[11/07/2022 16:47:57] info: Synapse.Application.Services.PluginManager[0]
      The plugin 'MongoDB:0.2.0' has been successfully loaded
[11/07/2022 16:47:58] fail: Microsoft.Extensions.Hosting.Internal.Host[9]
      BackgroundService failed
      System.ArgumentException: The specified schedule does not define a next occurence (Parameter 'schedule')
         at Synapse.IBackgroundJobManagerExtensions.ScheduleJobAsync(IBackgroundJobManager backgroundJobManager, V1Schedule schedule, CancellationToken cancellationToken) in /src/src/core/Synapse.Application/Extensions/IBackgroundJobManagerExtensions.cs:line 53
         at Synapse.Application.Services.WorkflowScheduler.ExecuteAsync(CancellationToken stoppingToken) in /src/src/core/Synapse.Application/Services/WorkflowScheduler.cs:line 76
         at Microsoft.Extensions.Hosting.Internal.Host.TryExecuteBackgroundServiceAsync(BackgroundService backgroundService)
[11/07/2022 16:47:58] crit: Microsoft.Extensions.Hosting.Internal.Host[10]
      The HostOptions.BackgroundServiceExceptionBehavior is configured to StopHost. A BackgroundService has thrown an unhandled exception, and the IHost instance is stopping. To avoid this behavior, configure this to Ignore; however the BackgroundService will not be restarted.
      System.ArgumentException: The specified schedule does not define a next occurence (Parameter 'schedule')
         at Synapse.IBackgroundJobManagerExtensions.ScheduleJobAsync(IBackgroundJobManager backgroundJobManager, V1Schedule schedule, CancellationToken cancellationToken) in /src/src/core/Synapse.Application/Extensions/IBackgroundJobManagerExtensions.cs:line 53
         at Synapse.Application.Services.WorkflowScheduler.ExecuteAsync(CancellationToken stoppingToken) in /src/src/core/Synapse.Application/Services/WorkflowScheduler.cs:line 76
         at Microsoft.Extensions.Hosting.Internal.Host.TryExecuteBackgroundServiceAsync(BackgroundService backgroundService)
[11/07/2022 16:47:58] info: Microsoft.Hosting.Lifetime[0]
      Application is shutting down...
[11/07/2022 16:47:58] fail: Neuroglia.Eventing.Services.CloudEventBus[0]
      An error occured while dequeuing and publishing pending cloud events: System.OperationCanceledException: The operation was canceled.
         at System.Threading.Channels.AsyncOperation`1.GetResult(Int16 token)
         at Neuroglia.Eventing.Services.CloudEventBus.DequeueAndPublishPendingEventsAsync()

What you expected to happen: Synapse to start regardless of whether there is a schedule already defined or not.

How to reproduce it: Create a schedule definition for an existing workflow prior to attempt the upgrade to latest release...

Anything else we need to know?:

Environment:

@bvandewe
Copy link
Author

bvandewe commented Nov 7, 2022

FYI - 0.3.11 starts just fine when the persistance layer is empty/reset.

@cdavernas
Copy link
Member

I believe this is due to a schedule being invalid (with an validUntil value set, right?) which therefore throws at startup when reconciling the scheduler.

I will need to catch exceptions atomically for each schedule.

@cdavernas cdavernas self-assigned this Nov 7, 2022
@cdavernas cdavernas added type: bug Something isn't working priority: high Indicates a high priority issue app: server Concerns the server weight: 1 An issue that has a very low development impact labels Nov 7, 2022
@cdavernas cdavernas added this to To do in Server via automation Nov 7, 2022
@cdavernas cdavernas added this to the v0.4.0 milestone Nov 7, 2022
@cdavernas
Copy link
Member

Closed as fixed in #366

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
app: server Concerns the server priority: high Indicates a high priority issue type: bug Something isn't working weight: 1 An issue that has a very low development impact
Projects
No open projects
Server
To do
Development

No branches or pull requests

2 participants