docintelapp / DocIntel

Open Source Platform for storing, organizing, and searching documents related to cyber threats
https://docintel.org
Other
154 stars 25 forks source link

docintel-dev-webapp fails to start on first run #10

Closed shannaniggans closed 1 year ago

shannaniggans commented 1 year ago
  1. After running sudo docker compose -f docker-compose.yml -p docintel-dev up -d for the first time, docintel-dev-webapp does not start.
  2. Manually running sudo docker start docintel-dev-webapp starts the container however.

Logs after initial failure

--- Configuring service
Uses native authentication
2022-10-26 22:40:50.2473 [WARN] [Microsoft.AspNetCore.DataProtection.Repositories.FileSystemXmlRepository] Storing keys in a directory '/root/.aspnet/DataProtection-Keys' that may not be persisted outside of the container. Protected data will be unavailable when container is destroyed.
2022-10-26 22:40:50.7805 [WARN] [Microsoft.AspNetCore.DataProtection.KeyManagement.XmlKeyManager] No XML encryptor configured. Key {bb299a04-99c8-402d-8663-49652e25d790} may be persisted to storage in unencrypted form.
2022-10-26 22:40:51.6526 [DEBUG] [DocIntel.Core.Services.MigrateDbContextService] Running EF core migrations.
2022-10-26 22:40:53.9799 [WARN] [Microsoft.EntityFrameworkCore.Model.Validation] Sensitive data logging is enabled. Log entries and exception messages may include sensitive application data; this mode should only be enabled during development.
2022-10-26 22:40:57.4726 [DEBUG] [DocIntel.Core.Services.MigrateDbContextService] EF Core Migrations done.
2022-10-26 22:40:58.7545 [DEBUG] [DocIntel.Core.Models.DocIntelContext] SaveChangesAsync return status: 1
2022-10-26 22:40:58.7780 [DEBUG] [DocIntel.Core.Models.DocIntelContext] Completed SaveChangesAsync tasks
2022-10-26 22:41:00.2614 [DEBUG] [DocIntel.Core.Services.BaseDataDbService] Adding default classification '7c560683-30df-4a2f-b233-a83d64d87723' to database.
2022-10-26 22:41:00.3022 [DEBUG] [DocIntel.Core.Models.DocIntelContext] SaveChangesAsync return status: 3
2022-10-26 22:41:00.3022 [DEBUG] [DocIntel.Core.Models.DocIntelContext] Completed SaveChangesAsync tasks
2022-10-26 22:41:00.3071 [DEBUG] [DocIntel.Core.Services.InstallSynapseCustomObjects] Install custom type in Synapse
2022-10-26 22:41:00.4888 [WARN] [MassTransit] Failed to stop bus: rabbitmq://docintel-dev-rabbitmq/65ac0d821dac_DocIntelWebApp_bus_yryyyyfcnebrf177bdpmxe3b8u?temporary=true (Not Started)
Unhandled exception. Synsharp.SynapseException: Could not login with the user 'root'.
 ---> System.Net.Http.HttpRequestException: Connection refused (docintel-dev-synapse:4443)
 ---> 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.Net.Sockets.Socket.<ConnectAsync>g__WaitForConnectWithCancellation|277_0(AwaitableSocketAsyncEventArgs saea, ValueTask connectTask, CancellationToken cancellationToken)
   at System.Net.Http.HttpConnectionPool.ConnectToTcpHostAsync(String host, Int32 port, HttpRequestMessage initialRequest, Boolean async, CancellationToken cancellationToken)
   --- End of inner exception stack trace ---
   at System.Net.Http.HttpConnectionPool.ConnectToTcpHostAsync(String host, Int32 port, HttpRequestMessage initialRequest, Boolean async, CancellationToken cancellationToken)
   at System.Net.Http.HttpConnectionPool.ConnectAsync(HttpRequestMessage request, Boolean async, CancellationToken cancellationToken)
   at System.Net.Http.HttpConnectionPool.CreateHttp11ConnectionAsync(HttpRequestMessage request, Boolean async, CancellationToken cancellationToken)
   at System.Net.Http.HttpConnectionPool.AddHttp11ConnectionAsync(HttpRequestMessage request)
   at System.Threading.Tasks.TaskCompletionSourceWithCancellation`1.WaitWithCancellationAsync(CancellationToken cancellationToken)
   at System.Net.Http.HttpConnectionPool.GetHttp11ConnectionAsync(HttpRequestMessage request, Boolean async, CancellationToken cancellationToken)
   at System.Net.Http.HttpConnectionPool.SendWithVersionDetectionAndRetryAsync(HttpRequestMessage request, Boolean async, Boolean doRequestAuth, CancellationToken cancellationToken)
   at System.Net.Http.RedirectHandler.SendAsync(HttpRequestMessage request, Boolean async, CancellationToken cancellationToken)
   at System.Net.Http.HttpClient.<SendAsync>g__Core|83_0(HttpRequestMessage request, HttpCompletionOption completionOption, CancellationTokenSource cts, Boolean disposeCts, CancellationTokenSource pendingRequestsCts, CancellationToken originalCancellationToken)
   at Synsharp.SynapseClient.LoginAsync(String user, String password) in /src/synsharp/Synsharp/SynapseClient.cs:line 132
   --- End of inner exception stack trace ---
   at Synsharp.SynapseClient.LoginAsync(String user, String password) in /src/synsharp/Synsharp/SynapseClient.cs:line 145
   at Synsharp.SynapseClient.StormAsync[T](String query, ApiStormQueryOpts apiStormQueryOpts)+MoveNext() in /src/synsharp/Synsharp/SynapseClient.cs:line 252
   at Synsharp.SynapseClient.StormAsync[T](String query, ApiStormQueryOpts apiStormQueryOpts)+System.Threading.Tasks.Sources.IValueTaskSource<System.Boolean>.GetResult()
   at System.Linq.AsyncEnumerable.<CountAsync>g__Core|71_0[TSource](IAsyncEnumerable`1 source, CancellationToken cancellationToken) in /_/Ix.NET/Source/System.Linq.Async/System/Linq/Operators/Count.cs:line 41
   at System.Linq.AsyncEnumerable.<CountAsync>g__Core|71_0[TSource](IAsyncEnumerable`1 source, CancellationToken cancellationToken) in /_/Ix.NET/Source/System.Linq.Async/System/Linq/Operators/Count.cs:line 41
   at DocIntel.Core.Services.InstallSynapseCustomObjects.ApplyYourChangeAsync(IServiceProvider scopedServices) in /src/DocIntel.Core/Services/InstallSynapseCustomObjects.cs:line 22
   at RunMethodsSequentially.LockAndRunCode.JobRunner.RunJobAsync(IServiceProvider scopedServices)
   at RunMethodsSequentially.LockAndRunCode.FileSystemLockAndRunJob.LockAndRunMethodsAsync(IServiceProvider serviceProvider)
   at RunMethodsSequentially.LockAndRunCode.FileSystemLockAndRunJob.LockAndRunMethodsAsync(IServiceProvider serviceProvider)
   at RunMethodsSequentially.LockAndRunCode.GetLockAndThenRunServices.LockAndLoadAsync()
   at RunMethodsSequentially.LockAndRunCode.GetLockAndThenRunHostedService.StartAsync(CancellationToken cancellationToken)
   at Microsoft.Extensions.Hosting.Internal.Host.StartAsync(CancellationToken cancellationToken)
   at Microsoft.Extensions.Hosting.HostingAbstractionsHostExtensions.RunAsync(IHost host, CancellationToken token)
   at Microsoft.Extensions.Hosting.HostingAbstractionsHostExtensions.RunAsync(IHost host, CancellationToken token)
   at Microsoft.Extensions.Hosting.HostingAbstractionsHostExtensions.Run(IHost host)
   at DocIntel.WebApp.Program.Main(String[] args) in /src/DocIntel.WebApp/Program.cs:line 51

Logs after manually starting the container

--- Configuring service
Uses native authentication
2022-10-26 22:50:52.2499 [WARN] [Microsoft.AspNetCore.DataProtection.Repositories.FileSystemXmlRepository] Storing keys in a directory '/root/.aspnet/DataProtection-Keys' that may not be persisted outside of the container. Protected data will be unavailable when container is destroyed.
2022-10-26 22:50:52.7528 [DEBUG] [DocIntel.Core.Services.MigrateDbContextService] Running EF core migrations.
2022-10-26 22:50:53.7165 [WARN] [Microsoft.EntityFrameworkCore.Model.Validation] Sensitive data logging is enabled. Log entries and exception messages may include sensitive application data; this mode should only be enabled during development.
2022-10-26 22:50:54.0874 [DEBUG] [DocIntel.Core.Services.MigrateDbContextService] EF Core Migrations done.
2022-10-26 22:50:54.4534 [DEBUG] [DocIntel.Core.Models.DocIntelContext] SaveChangesAsync return status: 0
2022-10-26 22:50:54.4617 [DEBUG] [DocIntel.Core.Models.DocIntelContext] Completed SaveChangesAsync tasks
2022-10-26 22:50:54.4702 [DEBUG] [DocIntel.Core.Services.InstallSynapseCustomObjects] Install custom type in Synapse
2022-10-26 22:50:54.9068 [DEBUG] [Synsharp.SynapseClient] Will send the query 'syn:form=_di:document'
2022-10-26 22:50:54.9385 [DEBUG] [Synsharp.SynapseClient] Receveid a server response with response code OK