Open Closed

Throw a exception in docker container with listening on http://[::]8080 #7853


User avatar
0
niall created
  • ABP Framework version: v8.2.2
  • UI Type: MVC
  • Database System: EF Core (MySQL)
  • Tiered (for MVC) or Auth Server Separated (for Angular): yes
  • Exception message and full stack trace:
  • Steps to reproduce the issue:

I created a app template project, build the HttpApi.Host to docker container.

I run the container. get a exception:

[07:11:21 INF] Saving external localizations...
[07:11:21 INF] Initialized all ABP modules.
[07:11:21 INF] Initializing UI Database
[07:11:21 INF] Saving healthchecks configuration to database
[07:11:21 INF] Now listening on: http://[::]:8080
[07:11:21 INF] Start processing HTTP request GET http://[::]:8080/health-status
[07:11:21 INF] Sending HTTP request GET http://[::]:8080/health-status
[07:11:21 INF] Application started. Press Ctrl+C to shut down.
[07:11:21 ERR] GetHealthReport threw an exception when trying to get report from /health-status configured with name BaaSo Health Status.
System.Net.Http.HttpRequestException: IPv4 address 0.0.0.0 and IPv6 address ::0 are unspecified addresses that cannot be used as a target address. (Parameter 'hostName') ([::]:8080)
 ---> System.ArgumentException: IPv4 address 0.0.0.0 and IPv6 address ::0 are unspecified addresses that cannot be used as a target address. (Parameter 'hostName')
   at System.Net.Dns.GetHostEntryOrAddressesCoreAsync(String hostName, Boolean justReturnParsedIp, Boolean throwOnIIPAny, Boolean justAddresses, AddressFamily family, CancellationToken cancellationToken)
   at System.Net.Dns.GetHostAddressesAsync(String hostNameOrAddress, AddressFamily family, CancellationToken cancellationToken)
   at System.Net.Sockets.SocketAsyncEventArgs.DnsConnectAsync(DnsEndPoint endPoint, SocketType socketType, ProtocolType protocolType)
   at System.Net.Sockets.Socket.ConnectAsync(SocketAsyncEventArgs e, Boolean userSocket, Boolean saeaCancelable)
   at System.Net.Sockets.Socket.AwaitableSocketAsyncEventArgs.ConnectAsync(Socket socket)
   at System.Net.Sockets.Socket.ConnectAsync(EndPoint remoteEP, 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(QueueItem queueItem)
   at System.Threading.Tasks.TaskCompletionSourceWithCancellation`1.WaitWithCancellationAsync(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 Microsoft.Extensions.Http.Logging.LoggingHttpMessageHandler.<SendCoreAsync>g__Core|5_0(HttpRequestMessage request, Boolean useAsync, CancellationToken cancellationToken)
   at Microsoft.Extensions.Http.Logging.LoggingScopeHttpMessageHandler.<SendCoreAsync>g__Core|5_0(HttpRequestMessage request, Boolean useAsync, 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 HealthChecks.UI.Core.HostedService.HealthCheckReportCollector.GetHealthReportAsync(HealthCheckConfiguration configuration) in /_/src/HealthChecks.UI/Core/HostedService/HealthCheckReportCollector.cs:line 142

this is my appsettings.json:

{
    "App": {
        "SelfUrl": "http://192.168.11.121:8001",
        "MVCPublicUrl": "https://localhost:44303",
        "CorsOrigins": "://*.xxxx.cloud",
        "DisablePII": false,
        "HealthCheckUrl": "/health-status"
    },
    "ConnectionStrings": {
        "Default": "Server=172.27.21.1;Port=3306;Database=BaaSo;Uid=root;Pwd=mysql@XTC;"
    },
    "Redis": {
        "Configuration": "172.27.11.1"
    },
    "AuthServer": {
        "Authority": "http://192.168.11.121:8000",
        "RequireHttpsMetadata": false,
        "MetaAddress": "http://192.168.11.121:8000",
        "SwaggerClientId": "BaaSo_Swagger"
    },
    "StringEncryption": {
        "DefaultPassPhrase": "LbEc3rlM03dGiUvJ"
    },
    "BusinessUnits": {
        "Path": "/baaso/businessunits"
    }
}

this is my docker-compose:

 my.api:
    image: xtc/my.api:0.8.0
    container_name: my_platform_api
    restart: always
    ports:
      - 8001:8080
    networks:
      baaso:
        ipv4_address: 172.27.120.1

5 Answer(s)
  • User Avatar
    0
    maliming created
    Support Team Fullstack Developer

    hi

    Can you try this?

    https://github.com/Xabaril/AspNetCore.Diagnostics.HealthChecks/issues/553#issuecomment-784190961

  • User Avatar
    0
    niall created

    Can I comment the ConfigureHealthChecks(context); to close the health check? Will there be a negative impact on the system?

        public override void ConfigureServices(ServiceConfigurationContext context)
        {
            var configuration = context.Services.GetConfiguration();
            var hostingEnvironment = context.Services.GetHostingEnvironment();
    
            if (!configuration.GetValue<bool>("App:DisablePII"))
            {
                Microsoft.IdentityModel.Logging.IdentityModelEventSource.ShowPII = true;
            }
    
            ConfigureUrls(configuration);
            ConfigureConventionalControllers();
            ConfigureAuthentication(context, configuration);
            ConfigureSwagger(context, configuration);
            ConfigureCache(configuration);
            ConfigureVirtualFileSystem(context);
            ConfigureDataProtection(context, configuration, hostingEnvironment);
            ConfigureDistributedLocking(context, configuration);
            ConfigureCors(context, configuration);
            ConfigureExternalProviders(context);
            
            //ConfigureHealthChecks(context);
    
            Configure<PermissionManagementOptions>(options =>
            {
                options.IsDynamicPermissionStoreEnabled = true;
            });
        }
    
  • User Avatar
    0
    maliming created
    Support Team Fullstack Developer

    hi

    You can disable it if you don't need to use it, there is no impact.

  • User Avatar
    0
    niall created

    Thanks ~

  • User Avatar
    0
    maliming created
    Support Team Fullstack Developer

    : )

Made with ❤️ on ABP v9.1.0-preview. Updated on December 10, 2024, 06:38