Open Closed

I-am-unable-to-create-tenant #8658


User avatar
0
neba created
  • ABP Framework version: v9.0.0
  • UI Type: Angular
  • Database System: EF Core (PostgreSQL)
  • Auth Server Separated (for Angular): yes
  • Exception message and full stack trace:
  • { "headers": { "normalizedNames": {}, "lazyUpdate": null, "lazyInit": null, "headers": {} }, "status": 500, "statusText": "OK", "url": "https://localhost:44385/api/saas/tenants", "ok": false, "name": "HttpErrorResponse", "message": "Http failure response for https://localhost:44385/api/saas/tenants: 500 OK", "error": { "error": { "code": null, "message": "An internal error occurred during your request!", "details": null, "data": null, "validationErrors": null } } }
  • Steps to reproduce the issue:

3 Answer(s)
  • User Avatar
    1
    enisn created
    Support Team .NET Developer

    Hi, can you please share your application logs?

    It seems the server respond with HTTP status code 500 and details are kept in .HttpApi.Host project. Please check its logs share them.

  • User Avatar
    0
    neba created

    2025-01-16 18:16:18.699 +03:00 [INF] Route matched with {controller = "Tenant", area = "saas", action = "Create", page = ""}. Executing controller action with signature System.Threading.Tasks.Task1[Volo.Saas.Host.Dtos.SaasTenantDto] CreateAsync(Volo.Saas.Host.Dtos.SaasTenantCreateDto) on controller Volo.Saas.Host.TenantController (Volo.Saas.Host.HttpApi). 2025-01-16 18:16:18.833 +03:00 [DBG] PermissionStore.GetCacheItemAsync: pn:U,pk:3a178129-392f-308a-932d-b87213fcc515,n:Saas.Tenants.Create 2025-01-16 18:16:18.833 +03:00 [DBG] Found in the cache: pn:U,pk:3a178129-392f-308a-932d-b87213fcc515,n:Saas.Tenants.Create 2025-01-16 18:16:18.834 +03:00 [DBG] PermissionStore.GetCacheItemAsync: pn:R,pk:admin,n:Saas.Tenants.Create 2025-01-16 18:16:18.834 +03:00 [DBG] Found in the cache: pn:R,pk:admin,n:Saas.Tenants.Create 2025-01-16 18:16:18.834 +03:00 [DBG] PermissionStore.GetCacheItemAsync: pn:C,pk:TMS_App,n:Saas.Tenants.Create 2025-01-16 18:16:18.835 +03:00 [DBG] Found in the cache: pn:C,pk:TMS_App,n:Saas.Tenants.Create 2025-01-16 18:16:18.835 +03:00 [DBG] PermissionStore.GetCacheItemAsync: pn:U,pk:3a178129-392f-308a-932d-b87213fcc515,n:Saas.Tenants 2025-01-16 18:16:18.835 +03:00 [DBG] Found in the cache: pn:U,pk:3a178129-392f-308a-932d-b87213fcc515,n:Saas.Tenants 2025-01-16 18:16:18.835 +03:00 [DBG] PermissionStore.GetCacheItemAsync: pn:R,pk:admin,n:Saas.Tenants 2025-01-16 18:16:18.836 +03:00 [DBG] Found in the cache: pn:R,pk:admin,n:Saas.Tenants 2025-01-16 18:16:18.836 +03:00 [DBG] PermissionStore.GetCacheItemAsync: pn:C,pk:TMS_App,n:Saas.Tenants 2025-01-16 18:16:18.837 +03:00 [DBG] Found in the cache: pn:C,pk:TMS_App,n:Saas.Tenants 2025-01-16 18:16:19.042 +03:00 [INF] Executing ObjectResult, writing value of type 'Volo.Saas.Host.Dtos.SaasTenantDto'. 2025-01-16 18:16:19.044 +03:00 [INF] Executed action Volo.Saas.Host.TenantController.CreateAsync (Volo.Saas.Host.HttpApi) in 344.4169ms 2025-01-16 18:16:19.044 +03:00 [INF] Executed endpoint 'Volo.Saas.Host.TenantController.CreateAsync (Volo.Saas.Host.HttpApi)' 2025-01-16 18:16:19.092 +03:00 [WRN] None of the specified endpoints were reachable RabbitMQ.Client.Exceptions.BrokerUnreachableException: None of the specified endpoints were reachable ---> System.AggregateException: One or more errors occurred. (Connection failed) ---> RabbitMQ.Client.Exceptions.ConnectFailureException: Connection failed ---> System.Net.Sockets.SocketException (10061): No connection could be made because the target machine actively refused it. 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.Threading.Tasks.ValueTask.ValueTaskSourceAsTask.<>c.<.cctor>b__4_0(Object state) --- End of stack trace from previous location --- at RabbitMQ.Client.TcpClientAdapter.ConnectAsync(String host, Int32 port) at RabbitMQ.Client.Impl.TaskExtensions.TimeoutAfter(Task task, TimeSpan timeout) at RabbitMQ.Client.Impl.SocketFrameHandler.ConnectOrFail(ITcpClient socket, AmqpTcpEndpoint endpoint, TimeSpan timeout) --- End of inner exception stack trace --- at RabbitMQ.Client.Impl.SocketFrameHandler.ConnectOrFail(ITcpClient socket, AmqpTcpEndpoint endpoint, TimeSpan timeout) at RabbitMQ.Client.Impl.SocketFrameHandler.ConnectUsingAddressFamily(AmqpTcpEndpoint endpoint, Func2 socketFactory, TimeSpan timeout, AddressFamily family) at RabbitMQ.Client.Impl.SocketFrameHandler.ConnectUsingIPv4(AmqpTcpEndpoint endpoint, Func2 socketFactory, TimeSpan timeout) at RabbitMQ.Client.Impl.SocketFrameHandler..ctor(AmqpTcpEndpoint endpoint, Func2 socketFactory, TimeSpan connectionTimeout, TimeSpan readTimeout, TimeSpan writeTimeout) at RabbitMQ.Client.Framing.Impl.IProtocolExtensions.CreateFrameHandler(IProtocol protocol, AmqpTcpEndpoint endpoint, ArrayPool1 pool, Func2 socketFactory, TimeSpan connectionTimeout, TimeSpan readTimeout, TimeSpan writeTimeout) at RabbitMQ.Client.ConnectionFactory.CreateFrameHandler(AmqpTcpEndpoint endpoint) at RabbitMQ.Client.EndpointResolverExtensions.SelectOne[T](IEndpointResolver resolver, Func2 selector) --- End of inner exception stack trace --- at RabbitMQ.Client.EndpointResolverExtensions.SelectOne[T](IEndpointResolver resolver, Func2 selector) at RabbitMQ.Client.Framing.Impl.AutorecoveringConnection.Init(IEndpointResolver endpoints) at RabbitMQ.Client.ConnectionFactory.CreateConnection(IEndpointResolver endpointResolver, String clientProvidedName) --- End of inner exception stack trace --- at RabbitMQ.Client.ConnectionFactory.CreateConnection(IEndpointResolver endpointResolver, String clientProvidedName) at RabbitMQ.Client.ConnectionFactory.CreateConnection(String clientProvidedName) at RabbitMQ.Client.ConnectionFactory.CreateConnection() at Volo.Abp.RabbitMQ.ConnectionPool.<>c__DisplayClass8_0.<Get>b__1() at System.Lazy1.ViaFactory(LazyThreadSafetyMode mode) at System.Lazy1.ExecutionAndPublication(LazyHelper executionAndPublication, Boolean useDefaultConstructor) at System.Lazy1.CreateValue() at Volo.Abp.RabbitMQ.ConnectionPool.Get(String connectionName) at Volo.Abp.RabbitMQ.RabbitMqMessageConsumer.TryCreateChannelAsync() 2025-01-16 18:16:20.665 +03:00 [DBG] Executing HealthCheck collector HostedService. 2025-01-16 18:16:20.666 +03:00 [INF] Start processing HTTP request GET https://localhost:44385/health-status 2025-01-16 18:16:20.666 +03:00 [INF] Sending HTTP request GET https://localhost:44385/health-status 2025-01-16 18:16:20.667 +03:00 [INF] Request starting HTTP/1.1 GET https://localhost:44385/health-status - null null 2025-01-16 18:16:20.669 +03:00 [INF] Executing endpoint 'Health checks' 2025-01-16 18:16:20.674 +03:00 [INF] Executed endpoint 'Health checks' 2025-01-16 18:16:20.675 +03:00 [INF] Received HTTP response headers after 9.2569ms - 200 2025-01-16 18:16:20.675 +03:00 [INF] End processing HTTP request after 9.474ms - 200 2025-01-16 18:16:20.676 +03:00 [INF] Request finished HTTP/1.1 GET https://localhost:44385/health-status - 200 null application/json 9.0678ms 2025-01-16 18:16:20.677 +03:00 [DBG] HealthReportCollector - health report execution history saved. 2025-01-16 18:16:20.677 +03:00 [DBG] HealthReport history already exists and is in the same state, updating the values. 2025-01-16 18:16:20.678 +03:00 [DBG] HealthReportCollector has completed. 2025-01-16 18:16:20.678 +03:00 [DBG] HealthCheck collector HostedService executed successfully. 2025-01-16 18:16:23.378 +03:00 [ERR] None of the specified endpoints were reachable RabbitMQ.Client.Exceptions.BrokerUnreachableException: None of the specified endpoints were reachable ---> System.AggregateException: One or more errors occurred. (Connection failed) ---> RabbitMQ.Client.Exceptions.ConnectFailureException: Connection failed ---> System.Net.Sockets.SocketException (10061): No connection could be made because the target machine actively refused it. 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.Threading.Tasks.ValueTask.ValueTaskSourceAsTask.<>c.<.cctor>b__4_0(Object state) --- End of stack trace from previous location --- at RabbitMQ.Client.TcpClientAdapter.ConnectAsync(String host, Int32 port) at RabbitMQ.Client.Impl.TaskExtensions.TimeoutAfter(Task task, TimeSpan timeout) at RabbitMQ.Client.Impl.SocketFrameHandler.ConnectOrFail(ITcpClient socket, AmqpTcpEndpoint endpoint, TimeSpan timeout) --- End of inner exception stack trace --- at RabbitMQ.Client.Impl.SocketFrameHandler.ConnectOrFail(ITcpClient socket, AmqpTcpEndpoint endpoint, TimeSpan timeout) at RabbitMQ.Client.Impl.SocketFrameHandler.ConnectUsingAddressFamily(AmqpTcpEndpoint endpoint, Func2 socketFactory, TimeSpan timeout, AddressFamily family) at RabbitMQ.Client.Impl.SocketFrameHandler.ConnectUsingIPv4(AmqpTcpEndpoint endpoint, Func2 socketFactory, TimeSpan timeout) at RabbitMQ.Client.Impl.SocketFrameHandler..ctor(AmqpTcpEndpoint endpoint, Func2 socketFactory, TimeSpan connectionTimeout, TimeSpan readTimeout, TimeSpan writeTimeout) at RabbitMQ.Client.Framing.Impl.IProtocolExtensions.CreateFrameHandler(IProtocol protocol, AmqpTcpEndpoint endpoint, ArrayPool1 pool, Func2 socketFactory, TimeSpan connectionTimeout, TimeSpan readTimeout, TimeSpan writeTimeout) at RabbitMQ.Client.ConnectionFactory.CreateFrameHandler(AmqpTcpEndpoint endpoint) at RabbitMQ.Client.EndpointResolverExtensions.SelectOne[T](IEndpointResolver resolver, Func2 selector) --- End of inner exception stack trace --- at RabbitMQ.Client.EndpointResolverExtensions.SelectOne[T](IEndpointResolver resolver, Func2 selector) at RabbitMQ.Client.Framing.Impl.AutorecoveringConnection.Init(IEndpointResolver endpoints) at RabbitMQ.Client.ConnectionFactory.CreateConnection(IEndpointResolver endpointResolver, String clientProvidedName) --- End of inner exception stack trace --- at RabbitMQ.Client.ConnectionFactory.CreateConnection(IEndpointResolver endpointResolver, String clientProvidedName) at RabbitMQ.Client.ConnectionFactory.CreateConnection(String clientProvidedName) at RabbitMQ.Client.ConnectionFactory.CreateConnection() at Volo.Abp.RabbitMQ.ConnectionPool.<>c__DisplayClass8_0.<Get>b__1() at System.Lazy1.ViaFactory(LazyThreadSafetyMode mode) at System.Lazy1.ExecutionAndPublication(LazyHelper executionAndPublication, Boolean useDefaultConstructor) at System.Lazy1.CreateValue() at Volo.Abp.RabbitMQ.ConnectionPool.Get(String connectionName) at Volo.Abp.EventBus.RabbitMq.RabbitMqDistributedEventBus.PublishAsync(String eventName, Byte[] body, Dictionary2 headersArguments, Nullable1 eventId, String correlationId) at Volo.Abp.EventBus.RabbitMq.RabbitMqDistributedEventBus.PublishAsync(Type eventType, Object eventData, Dictionary2 headersArguments, Nullable1 eventId, String correlationId) at Volo.Abp.EventBus.RabbitMq.RabbitMqDistributedEventBus.PublishToEventBusAsync(Type eventType, Object eventData) at Volo.Abp.EventBus.Distributed.DistributedEventBusBase.PublishAsync(Type eventType, Object eventData, Boolean onUnitOfWorkComplete, Boolean useOutbox) at Volo.Abp.EventBus.UnitOfWorkEventPublisher.PublishDistributedEventsAsync(IEnumerable1 distributedEvents) at Volo.Abp.Uow.UnitOfWork.CompleteAsync(CancellationToken cancellationToken) at Volo.Abp.AspNetCore.Uow.AbpUnitOfWorkMiddleware.InvokeAsync(HttpContext context, RequestDelegate next) at Microsoft.AspNetCore.Builder.UseMiddlewareExtensions.InterfaceMiddlewareBinder.<>c__DisplayClass2_0.<<CreateMiddleware>b__0>d.MoveNext() --- End of stack trace from previous location --- at Volo.Abp.AspNetCore.ExceptionHandling.AbpExceptionHandlingMiddleware.InvokeAsync(HttpContext context, RequestDelegate next) 2025-01-16 18:16:23.413 +03:00 [INF] Request finished HTTP/2 POST https://localhost:44385/api/saas/tenants - 500 null application/json 4727.1936ms

  • User Avatar
    0
    neba created

    Found out the docker must be running for the RabbitMq and Redis to operate. Somehow creating a tenant requires the RabitMq to be up and running.

Made with ❤️ on ABP v9.2.0-preview. Updated on January 16, 2025, 11:47