ChangemakerStudios / Papercut-SMTP

Papercut SMTP -- The Simple Desktop Email Server
2.91k stars 268 forks source link

Cannot run docker container on Apple M1 silicone #273

Closed ElectroBuddha closed 1 week ago

ElectroBuddha commented 2 months ago

Describe the bug Running dockerized app container fails at the bootstrap with exception visible in docker logs:

2024-07-14 12:06:52 [10:06:52 WRN] Storing keys in a directory '/home/app/.aspnet/DataProtection-Keys' that may not be persisted outside of the container. Protected data will be unavailable when container is destroyed. For more information go to https://aka.ms/aspnet/dataprotectionwarning
2024-07-14 12:06:52 [10:06:52 INF] User profile is available. Using '/home/app/.aspnet/DataProtection-Keys' as key repository; keys will not be encrypted at rest.
2024-07-14 12:06:52 [10:06:52 INF] Creating key {c7224554-d68c-4efb-b1ac-29de54beb21b} with creation date 2024-07-14 10:06:52Z, activation date 2024-07-14 10:06:52Z, and expiration date 2024-10-12 10:06:52Z.
2024-07-14 12:06:52 [10:06:52 WRN] No XML encryptor configured. Key {c7224554-d68c-4efb-b1ac-29de54beb21b} may be persisted to storage in unencrypted form.
2024-07-14 12:06:52 [10:06:52 INF] Writing data to file '/home/app/.aspnet/DataProtection-Keys/key-c7224554-d68c-4efb-b1ac-29de54beb21b.xml'.
2024-07-14 12:06:52 [10:06:52 INF] Publishing {"AppMeta": {"AppName": "Papercut.Service", "AppVersion": "7.0.0.0", "$type": "ApplicationMeta"}, "$type": "PapercutServicePreStartEvent"} to the Papercut Client
2024-07-14 12:06:52 assertion failed [block != nullptr]: BasicBlock requested for unrecognized address
2024-07-14 12:06:52 (BuilderBase.h:550 block_for_offset)
2024-07-14 12:06:52 

After retrying multiple times, the following exception is visible:

2024-07-14 12:02:40 [10:02:39 INF] Publishing {"AppMeta": {"AppName": "Papercut.Service", "AppVersion": "7.0.0.0", "$type": "ApplicationMeta"}, "$type": "PapercutServicePreStartEvent"} to the Papercut Client
2024-07-14 12:02:40 [10:02:40 INF] IPComm Server Ready: Listening for New Connections at 127.0.0.1:37403
2024-07-14 12:02:40 [10:02:40 INF] Starting Smtp Server on 0.0.0.0:25...
2024-07-14 12:02:40 [10:02:40 INF] Publishing {"AppMeta": {"AppName": "Papercut.Service", "AppVersion": "7.0.0.0", "$type": "ApplicationMeta"}, "$type": "PapercutServiceReadyEvent"} to the Papercut Client
2024-07-14 12:02:40 [10:02:40 FTL] Application startup exception
2024-07-14 12:02:40 System.EntryPointNotFoundException: Entry point was not found.
2024-07-14 12:02:40    at System.Collections.Generic.IEqualityComparer`1.Equals(T x, T y)
2024-07-14 12:02:40    at System.Collections.Concurrent.ConcurrentDictionary`2.TryGetValueInternal(Tables tables, TKey key, Int32 hashcode, TValue& value)
2024-07-14 12:02:40    at System.Collections.Concurrent.ConcurrentDictionary`2.GetOrAdd(TKey key, Func`2 valueFactory)
2024-07-14 12:02:40    at Microsoft.AspNetCore.Mvc.ModelBinding.ModelMetadata.InitializeTypeInformation()
2024-07-14 12:02:40    at Microsoft.AspNetCore.Mvc.ModelBinding.Metadata.DefaultModelMetadata..ctor(IModelMetadataProvider provider, ICompositeMetadataDetailsProvider detailsProvider, DefaultMetadataDetails details, DefaultModelBindingMessageProvider modelBindingMessageProvider)
2024-07-14 12:02:40    at Microsoft.AspNetCore.Mvc.ModelBinding.Metadata.DefaultModelMetadataProvider.CreateModelMetadata(DefaultMetadataDetails entry)
2024-07-14 12:02:40    at Microsoft.AspNetCore.Mvc.ModelBinding.Metadata.DefaultModelMetadataProvider.CreateCacheEntry(ModelMetadataIdentity key)
2024-07-14 12:02:40    at System.Collections.Concurrent.ConcurrentDictionary`2.GetOrAdd(TKey key, Func`2 valueFactory)
2024-07-14 12:02:40    at Microsoft.AspNetCore.Mvc.ModelBinding.Metadata.DefaultModelMetadataProvider.GetMetadataForParameter(ParameterInfo parameter, Type modelType)
2024-07-14 12:02:40    at Microsoft.AspNetCore.Mvc.ApplicationModels.DefaultApplicationModelProvider.CreateParameterModel(ParameterInfo parameterInfo)
2024-07-14 12:02:40    at Microsoft.AspNetCore.Mvc.ApplicationModels.DefaultApplicationModelProvider.OnProvidersExecuting(ApplicationModelProviderContext context)
2024-07-14 12:02:40    at Microsoft.AspNetCore.Mvc.ApplicationModels.ApplicationModelFactory.CreateApplicationModel(IEnumerable`1 controllerTypes)
2024-07-14 12:02:40    at Microsoft.AspNetCore.Mvc.ApplicationModels.ControllerActionDescriptorProvider.GetDescriptors()
2024-07-14 12:02:40    at Microsoft.AspNetCore.Mvc.ApplicationModels.ControllerActionDescriptorProvider.OnProvidersExecuting(ActionDescriptorProviderContext context)
2024-07-14 12:02:40    at Microsoft.AspNetCore.Mvc.Infrastructure.DefaultActionDescriptorCollectionProvider.UpdateCollection()
2024-07-14 12:02:40    at Microsoft.AspNetCore.Mvc.Infrastructure.DefaultActionDescriptorCollectionProvider.Initialize()
2024-07-14 12:02:40    at Microsoft.AspNetCore.Mvc.Infrastructure.DefaultActionDescriptorCollectionProvider.GetChangeToken()
2024-07-14 12:02:40    at Microsoft.Extensions.Primitives.ChangeToken.ChangeTokenRegistration`1..ctor(Func`1 changeTokenProducer, Action`1 changeTokenConsumer, TState state)
2024-07-14 12:02:40    at Microsoft.Extensions.Primitives.ChangeToken.OnChange(Func`1 changeTokenProducer, Action changeTokenConsumer)
2024-07-14 12:02:40    at Microsoft.AspNetCore.Mvc.Routing.ActionEndpointDataSourceBase.Subscribe()
2024-07-14 12:02:40    at Microsoft.AspNetCore.Builder.ControllerEndpointRouteBuilderExtensions.GetOrCreateDataSource(IEndpointRouteBuilder endpoints)
2024-07-14 12:02:40    at Microsoft.AspNetCore.Builder.ControllerEndpointRouteBuilderExtensions.MapControllers(IEndpointRouteBuilder endpoints)
2024-07-14 12:02:40    at Papercut.Service.PapercutServiceStartup.<>c.<Configure>b__3_0(IEndpointRouteBuilder s) in /work/src/Papercut.Service/PapercutServiceStartup.cs:line 87
2024-07-14 12:02:40    at Microsoft.AspNetCore.Builder.EndpointRoutingApplicationBuilderExtensions.UseEndpoints(IApplicationBuilder builder, Action`1 configure)
2024-07-14 12:02:40    at Papercut.Service.PapercutServiceStartup.Configure(IApplicationBuilder app) in /work/src/Papercut.Service/PapercutServiceStartup.cs:line 84
2024-07-14 12:02:40    at System.RuntimeMethodHandle.InvokeMethod(Object target, Void** arguments, Signature sig, Boolean isConstructor)
2024-07-14 12:02:40    at System.Reflection.MethodBaseInvoker.InvokeDirectByRefWithFewArgs(Object obj, Span`1 copyOfArgs, BindingFlags invokeAttr)
2024-07-14 12:02:40    at System.Reflection.MethodBaseInvoker.InvokeWithOneArg(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
2024-07-14 12:02:40    at Microsoft.AspNetCore.Hosting.ConfigureBuilder.Invoke(Object instance, IApplicationBuilder builder)
2024-07-14 12:02:40    at Microsoft.AspNetCore.Hosting.GenericWebHostService.StartAsync(CancellationToken cancellationToken)
2024-07-14 12:02:40 [10:02:40 ERR] Hosting failed to start
2024-07-14 12:02:40 System.EntryPointNotFoundException: Entry point was not found.
2024-07-14 12:02:40    at System.Collections.Generic.IEqualityComparer`1.Equals(T x, T y)
2024-07-14 12:02:40    at System.Collections.Concurrent.ConcurrentDictionary`2.TryGetValueInternal(Tables tables, TKey key, Int32 hashcode, TValue& value)
2024-07-14 12:02:40    at System.Collections.Concurrent.ConcurrentDictionary`2.GetOrAdd(TKey key, Func`2 valueFactory)
2024-07-14 12:02:40    at Microsoft.AspNetCore.Mvc.ModelBinding.ModelMetadata.InitializeTypeInformation()
2024-07-14 12:02:40    at Microsoft.AspNetCore.Mvc.ModelBinding.Metadata.DefaultModelMetadata..ctor(IModelMetadataProvider provider, ICompositeMetadataDetailsProvider detailsProvider, DefaultMetadataDetails details, DefaultModelBindingMessageProvider modelBindingMessageProvider)
2024-07-14 12:02:40    at Microsoft.AspNetCore.Mvc.ModelBinding.Metadata.DefaultModelMetadataProvider.CreateModelMetadata(DefaultMetadataDetails entry)
2024-07-14 12:02:40    at Microsoft.AspNetCore.Mvc.ModelBinding.Metadata.DefaultModelMetadataProvider.CreateCacheEntry(ModelMetadataIdentity key)
2024-07-14 12:02:40    at System.Collections.Concurrent.ConcurrentDictionary`2.GetOrAdd(TKey key, Func`2 valueFactory)
2024-07-14 12:02:40    at Microsoft.AspNetCore.Mvc.ModelBinding.Metadata.DefaultModelMetadataProvider.GetMetadataForParameter(ParameterInfo parameter, Type modelType)
2024-07-14 12:02:40    at Microsoft.AspNetCore.Mvc.ApplicationModels.DefaultApplicationModelProvider.CreateParameterModel(ParameterInfo parameterInfo)
2024-07-14 12:02:40    at Microsoft.AspNetCore.Mvc.ApplicationModels.DefaultApplicationModelProvider.OnProvidersExecuting(ApplicationModelProviderContext context)
2024-07-14 12:02:40    at Microsoft.AspNetCore.Mvc.ApplicationModels.ApplicationModelFactory.CreateApplicationModel(IEnumerable`1 controllerTypes)
2024-07-14 12:02:40    at Microsoft.AspNetCore.Mvc.ApplicationModels.ControllerActionDescriptorProvider.GetDescriptors()
2024-07-14 12:02:40    at Microsoft.AspNetCore.Mvc.ApplicationModels.ControllerActionDescriptorProvider.OnProvidersExecuting(ActionDescriptorProviderContext context)
2024-07-14 12:02:40    at Microsoft.AspNetCore.Mvc.Infrastructure.DefaultActionDescriptorCollectionProvider.UpdateCollection()
2024-07-14 12:02:40    at Microsoft.AspNetCore.Mvc.Infrastructure.DefaultActionDescriptorCollectionProvider.Initialize()
2024-07-14 12:02:40    at Microsoft.AspNetCore.Mvc.Infrastructure.DefaultActionDescriptorCollectionProvider.GetChangeToken()
2024-07-14 12:02:40    at Microsoft.Extensions.Primitives.ChangeToken.ChangeTokenRegistration`1..ctor(Func`1 changeTokenProducer, Action`1 changeTokenConsumer, TState state)
2024-07-14 12:02:40    at Microsoft.Extensions.Primitives.ChangeToken.OnChange(Func`1 changeTokenProducer, Action changeTokenConsumer)
2024-07-14 12:02:40    at Microsoft.AspNetCore.Mvc.Routing.ActionEndpointDataSourceBase.Subscribe()
2024-07-14 12:02:40    at Microsoft.AspNetCore.Builder.ControllerEndpointRouteBuilderExtensions.GetOrCreateDataSource(IEndpointRouteBuilder endpoints)
2024-07-14 12:02:40    at Microsoft.AspNetCore.Builder.ControllerEndpointRouteBuilderExtensions.MapControllers(IEndpointRouteBuilder endpoints)
2024-07-14 12:02:40    at Papercut.Service.PapercutServiceStartup.<>c.<Configure>b__3_0(IEndpointRouteBuilder s) in /work/src/Papercut.Service/PapercutServiceStartup.cs:line 87
2024-07-14 12:02:40    at Microsoft.AspNetCore.Builder.EndpointRoutingApplicationBuilderExtensions.UseEndpoints(IApplicationBuilder builder, Action`1 configure)
2024-07-14 12:02:40    at Papercut.Service.PapercutServiceStartup.Configure(IApplicationBuilder app) in /work/src/Papercut.Service/PapercutServiceStartup.cs:line 84
2024-07-14 12:02:40    at System.RuntimeMethodHandle.InvokeMethod(Object target, Void** arguments, Signature sig, Boolean isConstructor)
2024-07-14 12:02:40    at System.Reflection.MethodBaseInvoker.InvokeDirectByRefWithFewArgs(Object obj, Span`1 copyOfArgs, BindingFlags invokeAttr)
2024-07-14 12:02:40    at System.Reflection.MethodBaseInvoker.InvokeWithOneArg(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
2024-07-14 12:02:40    at Microsoft.AspNetCore.Hosting.ConfigureBuilder.Invoke(Object instance, IApplicationBuilder builder)
2024-07-14 12:02:40    at Microsoft.AspNetCore.Hosting.GenericWebHostService.StartAsync(CancellationToken cancellationToken)
2024-07-14 12:02:40    at Microsoft.Extensions.Hosting.Internal.Host.<StartAsync>b__15_1(IHostedService service, CancellationToken token)
2024-07-14 12:02:40    at Microsoft.Extensions.Hosting.Internal.Host.ForeachService[T](IEnumerable`1 services, CancellationToken token, Boolean concurrent, Boolean abortOnFirstException, List`1 exceptions, Func`3 operation)
2024-07-14 12:02:40 [10:02:40 INF] Stopping Smtp Server
2024-07-14 12:02:40 [10:02:40 INF] Stopping IPComm Server
2024-07-14 12:02:40 [10:02:40 FTL] An unhandled exception occured during bootstrapping
2024-07-14 12:02:40 System.EntryPointNotFoundException: Entry point was not found.
2024-07-14 12:02:40    at System.Collections.Generic.IEqualityComparer`1.Equals(T x, T y)
2024-07-14 12:02:40    at System.Collections.Concurrent.ConcurrentDictionary`2.TryGetValueInternal(Tables tables, TKey key, Int32 hashcode, TValue& value)
2024-07-14 12:02:40    at System.Collections.Concurrent.ConcurrentDictionary`2.GetOrAdd(TKey key, Func`2 valueFactory)
2024-07-14 12:02:40    at Microsoft.AspNetCore.Mvc.ModelBinding.ModelMetadata.InitializeTypeInformation()
2024-07-14 12:02:40    at Microsoft.AspNetCore.Mvc.ModelBinding.Metadata.DefaultModelMetadata..ctor(IModelMetadataProvider provider, ICompositeMetadataDetailsProvider detailsProvider, DefaultMetadataDetails details, DefaultModelBindingMessageProvider modelBindingMessageProvider)
2024-07-14 12:02:40    at Microsoft.AspNetCore.Mvc.ModelBinding.Metadata.DefaultModelMetadataProvider.CreateModelMetadata(DefaultMetadataDetails entry)
2024-07-14 12:02:40    at Microsoft.AspNetCore.Mvc.ModelBinding.Metadata.DefaultModelMetadataProvider.CreateCacheEntry(ModelMetadataIdentity key)
2024-07-14 12:02:40    at System.Collections.Concurrent.ConcurrentDictionary`2.GetOrAdd(TKey key, Func`2 valueFactory)
2024-07-14 12:02:40    at Microsoft.AspNetCore.Mvc.ModelBinding.Metadata.DefaultModelMetadataProvider.GetMetadataForParameter(ParameterInfo parameter, Type modelType)
2024-07-14 12:02:40    at Microsoft.AspNetCore.Mvc.ApplicationModels.DefaultApplicationModelProvider.CreateParameterModel(ParameterInfo parameterInfo)
2024-07-14 12:02:40    at Microsoft.AspNetCore.Mvc.ApplicationModels.DefaultApplicationModelProvider.OnProvidersExecuting(ApplicationModelProviderContext context)
2024-07-14 12:02:40    at Microsoft.AspNetCore.Mvc.ApplicationModels.ApplicationModelFactory.CreateApplicationModel(IEnumerable`1 controllerTypes)
2024-07-14 12:02:40    at Microsoft.AspNetCore.Mvc.ApplicationModels.ControllerActionDescriptorProvider.GetDescriptors()
2024-07-14 12:02:40    at Microsoft.AspNetCore.Mvc.ApplicationModels.ControllerActionDescriptorProvider.OnProvidersExecuting(ActionDescriptorProviderContext context)
2024-07-14 12:02:40    at Microsoft.AspNetCore.Mvc.Infrastructure.DefaultActionDescriptorCollectionProvider.UpdateCollection()
2024-07-14 12:02:40    at Microsoft.AspNetCore.Mvc.Infrastructure.DefaultActionDescriptorCollectionProvider.Initialize()
2024-07-14 12:02:40    at Microsoft.AspNetCore.Mvc.Infrastructure.DefaultActionDescriptorCollectionProvider.GetChangeToken()
2024-07-14 12:02:40    at Microsoft.Extensions.Primitives.ChangeToken.ChangeTokenRegistration`1..ctor(Func`1 changeTokenProducer, Action`1 changeTokenConsumer, TState state)
2024-07-14 12:02:40    at Microsoft.Extensions.Primitives.ChangeToken.OnChange(Func`1 changeTokenProducer, Action changeTokenConsumer)
2024-07-14 12:02:40    at Microsoft.AspNetCore.Mvc.Routing.ActionEndpointDataSourceBase.Subscribe()
2024-07-14 12:02:40    at Microsoft.AspNetCore.Builder.ControllerEndpointRouteBuilderExtensions.GetOrCreateDataSource(IEndpointRouteBuilder endpoints)
2024-07-14 12:02:40    at Microsoft.AspNetCore.Builder.ControllerEndpointRouteBuilderExtensions.MapControllers(IEndpointRouteBuilder endpoints)
2024-07-14 12:02:40    at Papercut.Service.PapercutServiceStartup.<>c.<Configure>b__3_0(IEndpointRouteBuilder s) in /work/src/Papercut.Service/PapercutServiceStartup.cs:line 87
2024-07-14 12:02:40    at Microsoft.AspNetCore.Builder.EndpointRoutingApplicationBuilderExtensions.UseEndpoints(IApplicationBuilder builder, Action`1 configure)
2024-07-14 12:02:40    at Papercut.Service.PapercutServiceStartup.Configure(IApplicationBuilder app) in /work/src/Papercut.Service/PapercutServiceStartup.cs:line 84
2024-07-14 12:02:40    at System.RuntimeMethodHandle.InvokeMethod(Object target, Void** arguments, Signature sig, Boolean isConstructor)
2024-07-14 12:02:40    at System.Reflection.MethodBaseInvoker.InvokeDirectByRefWithFewArgs(Object obj, Span`1 copyOfArgs, BindingFlags invokeAttr)
2024-07-14 12:02:40    at System.Reflection.MethodBaseInvoker.InvokeWithOneArg(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
2024-07-14 12:02:40    at Microsoft.AspNetCore.Hosting.ConfigureBuilder.Invoke(Object instance, IApplicationBuilder builder)
2024-07-14 12:02:40    at Microsoft.AspNetCore.Hosting.GenericWebHostService.StartAsync(CancellationToken cancellationToken)
2024-07-14 12:02:40    at Microsoft.Extensions.Hosting.Internal.Host.<StartAsync>b__15_1(IHostedService service, CancellationToken token)
2024-07-14 12:02:40    at Microsoft.Extensions.Hosting.Internal.Host.ForeachService[T](IEnumerable`1 services, CancellationToken token, Boolean concurrent, Boolean abortOnFirstException, List`1 exceptions, Func`3 operation)
2024-07-14 12:02:40    at Microsoft.Extensions.Hosting.Internal.Host.StartAsync(CancellationToken cancellationToken)
2024-07-14 12:02:40    at Microsoft.Extensions.Hosting.HostingAbstractionsHostExtensions.RunAsync(IHost host, CancellationToken token)
2024-07-14 12:02:40    at Microsoft.Extensions.Hosting.HostingAbstractionsHostExtensions.RunAsync(IHost host, CancellationToken token)
2024-07-14 12:02:40    at Papercut.Service.Program.RunAsync(String[] args) in /work/src/Papercut.Service/Program.cs:line 54
2024-07-14 12:02:42 [10:02:42 WRN] Storing keys in a directory '/home/app/.aspnet/DataProtection-Keys' that may not be persisted outside of the container. Protected data will be unavailable when container is destroyed. For more information go to https://aka.ms/aspnet/dataprotectionwarning
2024-07-14 12:02:42 [10:02:42 INF] User profile is available. Using '/home/app/.aspnet/DataProtection-Keys' as key repository; keys will not be encrypted at rest.
2024-07-14 12:02:42 [10:02:42 INF] Publishing {"AppMeta": {"AppName": "Papercut.Service", "AppVersion": "7.0.0.0", "$type": "ApplicationMeta"}, "$type": "PapercutServicePreStartEvent"} to the Papercut Client
2024-07-14 11:46:33  2024-07-14T10:02:42.546915885Z assertion failed [block != nullptr]: BasicBlock requested for unrecognized address
2024-07-14 12:02:42 (BuilderBase.h:550 block_for_offset)
2024-07-14 12:02:44 [10:02:44 WRN] Storing keys in a directory '/home/app/.aspnet/DataProtection-Keys' that may not be persisted outside of the container. Protected data will be unavailable when container is destroyed. For more information go to https://aka.ms/aspnet/dataprotectionwarning
2024-07-14 12:02:44 [10:02:44 INF] User profile is available. Using '/home/app/.aspnet/DataProtection-Keys' as key repository; keys will not be encrypted at rest.
2024-07-14 12:02:44 [10:02:44 INF] Publishing {"AppMeta": {"AppName": "Papercut.Service", "AppVersion": "7.0.0.0", "$type": "ApplicationMeta"}, "$type": "PapercutServicePreStartEvent"} to the Papercut Client
2024-07-14 12:02:44 [10:02:44 INF] IPComm Server Ready: Listening for New Connections at 127.0.0.1:37403
2024-07-14 12:02:45 [10:02:45 INF] Starting Smtp Server on 0.0.0.0:25...
2024-07-14 12:02:45 [10:02:45 INF] Publishing {"AppMeta": {"AppName": "Papercut.Service", "AppVersion": "7.0.0.0", "$type": "ApplicationMeta"}, "$type": "PapercutServiceReadyEvent"} to the Papercut Client
2024-07-14 12:02:45 [10:02:45 INF] Application is shutting down...

To Reproduce Steps to reproduce the behavior:

  1. run: docker run -d -p 8080:80 -p 25:25 changemakerstudiosus/papercut-smtp:latest
  2. Observe mentioned errors in docker logs

Desktop:

Additional context Quick google search points to problem with existing node (npm) not using proper CPU architecture arm64: similar issue here

Jaben commented 1 week ago

Fixed this -- pull the image again.

ElectroBuddha commented 1 week ago

I can confirm that the issue has been resolved. Running docker container on Apple M1 silicone is now working properly. Thank you for fixing the issue.