Base solution for your next web application
Open Closed

Timeout expired. The timeout period elapsed prior to obtaining a connection from the pool. This may have occurred because all pooled connections were in use and max pool size was reached. #7898


User avatar
0
unidata created

hI ! I am a new client that has been using the opersource, ABP version for a year. I know the product.

I Download the project and install it, configure the connection string in a ms sql on a remote virtual server, login with a sql client and I see that the base was created well and I see the tables. The problem is when I run the * .Web.Host fron the visual studio. This opens a browser with the swagger but gives me the error:

An unhandled exception occurred while processing the request. InvalidOperationException: Timeout expired. The timeout period elapsed prior to obtaining a connection from the pool. This may have occurred because all pooled connections were in use and max pool size was reached.

System.Data.ProviderBase.DbConnectionFactory.TryGetConnection(DbConnection owningConnection, TaskCompletionSource<DbConnectionInternal> retry, DbConnectionOptions userOptions, DbConnectionInternal oldConnection, out DbConnectionInternal connection)

System.Data.ProviderBase.DbConnectionFactory.TryGetConnection(DbConnection owningConnection, TaskCompletionSource<DbConnectionInternal> retry, DbConnectionOptions userOptions, DbConnectionInternal oldConnection, out DbConnectionInternal connection) System.Data.ProviderBase.DbConnectionInternal.TryOpenConnectionInternal(DbConnection outerConnection, DbConnectionFactory connectionFactory, TaskCompletionSource<DbConnectionInternal> retry, DbConnectionOptions userOptions) System.Data.ProviderBase.DbConnectionClosed.TryOpenConnection(DbConnection outerConnection, DbConnectionFactory connectionFactory, TaskCompletionSource<DbConnectionInternal> retry, DbConnectionOptions userOptions) System.Data.SqlClient.SqlConnection.TryOpen(TaskCompletionSource<DbConnectionInternal> retry) System.Data.SqlClient.SqlConnection.Open() Microsoft.EntityFrameworkCore.Storage.RelationalConnection.OpenDbConnection(bool errorsExpected) Microsoft.EntityFrameworkCore.Storage.RelationalConnection.Open(bool errorsExpected) Microsoft.EntityFrameworkCore.Storage.RelationalConnection.BeginTransaction(IsolationLevel isolationLevel) Microsoft.EntityFrameworkCore.RelationalDatabaseFacadeExtensions+<>c__DisplayClass18_0.<BeginTransaction>b__0(DatabaseFacade database) Microsoft.EntityFrameworkCore.ExecutionStrategyExtensions+<>c__DisplayClass12_0<TState, TResult>.<Execute>b__0(DbContext c, TState s) Microsoft.EntityFrameworkCore.SqlServer.Storage.Internal.SqlServerExecutionStrategy.Execute<TState, TResult>(TState state, Func<DbContext, TState, TResult> operation, Func<DbContext, TState, ExecutionResult<TResult>> verifySucceeded) Microsoft.EntityFrameworkCore.ExecutionStrategyExtensions.Execute<TState, TResult>(IExecutionStrategy strategy, Func<TState, TResult> operation, Func<TState, ExecutionResult<TResult>> verifySucceeded, TState state) Microsoft.EntityFrameworkCore.ExecutionStrategyExtensions.Execute<TState, TResult>(IExecutionStrategy strategy, TState state, Func<TState, TResult> operation) Microsoft.EntityFrameworkCore.RelationalDatabaseFacadeExtensions.BeginTransaction(DatabaseFacade databaseFacade, IsolationLevel isolationLevel) Abp.EntityFrameworkCore.Uow.DbContextEfCoreTransactionStrategy.CreateDbContext<TDbContext>(string connectionString, IDbContextResolver dbContextResolver) in DbContextEfCoreTransactionStrategy.cs Abp.EntityFrameworkCore.Uow.EfCoreUnitOfWork.GetOrCreateDbContext<TDbContext>(Nullable<MultiTenancySides> multiTenancySide, string name) in EfCoreUnitOfWork.cs Abp.EntityFrameworkCore.Repositories.EfCoreRepositoryBase<TDbContext, TEntity, TPrimaryKey>.<GetQueryable>b__7_0(Type key) in EfCoreRepositoryBaseOfTEntityAndTPrimaryKey.cs System.Collections.Concurrent.ConcurrentDictionary<TKey, TValue>.GetOrAdd(TKey key, Func<TKey, TValue> valueFactory) Abp.EntityFrameworkCore.Repositories.EfCoreRepositoryBase<TDbContext, TEntity, TPrimaryKey>.GetQueryable() in EfCoreRepositoryBaseOfTEntityAndTPrimaryKey.cs Abp.EntityFrameworkCore.Repositories.EfCoreRepositoryBase<TDbContext, TEntity, TPrimaryKey>.GetAllIncluding(Expression<Func<TEntity, object>>[] propertySelectors) in EfCoreRepositoryBaseOfTEntityAndTPrimaryKey.cs Abp.EntityFrameworkCore.Repositories.EfCoreRepositoryBase<TDbContext, TEntity, TPrimaryKey>.GetAllListAsync(Expression<Func<TEntity, bool>> predicate) in EfCoreRepositoryBaseOfTEntityAndTPrimaryKey.cs Abp.Threading.InternalAsyncHelper.AwaitTaskWithPostActionAndFinallyAndGetResult<T>(Task<T> actualReturnValue, Func<Task> postAction, Action<Exception> finalAction) Abp.Configuration.SettingStore.GetAllListAsync(Nullable<int> tenantId, Nullable<long> userId) in SettingStore.cs Abp.Threading.InternalAsyncHelper.AwaitTaskWithPostActionAndFinallyAndGetResult<T>(Task<T> actualReturnValue, Func<Task> postAction, Action<Exception> finalAction) Abp.Configuration.SettingManager.<GetApplicationSettingsAsync>b__38_0() in SettingManager.cs Abp.Runtime.Caching.CacheExtensions+<>c__DisplayClass9_0<TKey, TValue>+<<GetAsync>b__0>d.MoveNext() Abp.Runtime.Caching.CacheBase.GetAsync(string key, Func<string, Task<object>> factory) in CacheBase.cs Abp.Runtime.Caching.CacheExtensions.GetAsync<TKey, TValue>(ICache cache, TKey key, Func<TKey, Task<TValue>> factory) in CacheExtensions.cs Abp.Configuration.SettingManager.GetApplicationSettingsAsync() in SettingManager.cs Abp.Configuration.SettingManager.GetSettingValueForApplicationOrNullAsync(string name) in SettingManager.cs Abp.Configuration.SettingManager.GetSettingValueInternalAsync(string name, Nullable<int> tenantId, Nullable<long> userId, bool fallbackToDefault) in SettingManager.cs VCloud.Web.UiCustomization.UiThemeCustomizerFactory.GetCurrentUiCustomizer() in UiThemeCustomizerFactory.cs + var theme = await _settingManager.GetSettingValueAsync(AppSettings.UiManagement.Theme); VCloud.Sessions.SessionAppService.GetCurrentLoginInformations() in SessionAppService.cs + var uiCustomizer = await _uiThemeCustomizerFactory.GetCurrentUiCustomizer(); Abp.Threading.InternalAsyncHelper.AwaitTaskWithPostActionAndFinallyAndGetResult<T>(Task<T> actualReturnValue, Func<Task> postAction, Action<Exception> finalAction) VCloud.Web.Session.PerRequestSessionCache.GetCurrentLoginInformationsAsync() in PerRequestSessionCache.cs + cachedValue = await _sessionAppService.GetCurrentLoginInformations(); VCloud.Web.Controllers.UiController.Index() in UiController.cs + var model = new HomePageModel Microsoft.AspNetCore.Mvc.Internal.ActionMethodExecutor+TaskOfIActionResultExecutor.Execute(IActionResultTypeMapper mapper, ObjectMethodExecutor executor, object controller, object[] arguments) System.Threading.Tasks.ValueTask<TResult>.get_Result() Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker.InvokeActionMethodAsync() Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker.InvokeNextActionFilterAsync() Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker.Rethrow(ActionExecutedContext context) Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker.Next(ref State next, ref Scope scope, ref object state, ref bool isCompleted) Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker.InvokeInnerFilterAsync() Microsoft.AspNetCore.Mvc.Internal.ResourceInvoker.InvokeNextExceptionFilterAsync() Microsoft.AspNetCore.Mvc.Internal.ResourceInvoker.Rethrow(ExceptionContext context) Microsoft.AspNetCore.Mvc.Internal.ResourceInvoker.Next(ref State next, ref Scope scope, ref object state, ref bool isCompleted) Microsoft.AspNetCore.Mvc.Internal.ResourceInvoker.InvokeNextResourceFilter() Microsoft.AspNetCore.Mvc.Internal.ResourceInvoker.Rethrow(ResourceExecutedContext context) Microsoft.AspNetCore.Mvc.Internal.ResourceInvoker.Next(ref State next, ref Scope scope, ref object state, ref bool isCompleted) Microsoft.AspNetCore.Mvc.Internal.ResourceInvoker.InvokeFilterPipelineAsync() Microsoft.AspNetCore.Mvc.Internal.ResourceInvoker.InvokeAsync() Microsoft.AspNetCore.Routing.EndpointMiddleware.Invoke(HttpContext httpContext) Microsoft.AspNetCore.Routing.EndpointRoutingMiddleware.Invoke(HttpContext httpContext) Microsoft.AspNetCore.Builder.RouterMiddleware.Invoke(HttpContext httpContext) Microsoft.AspNetCore.StaticFiles.StaticFileMiddleware.Invoke(HttpContext context) Abp.AspNetZeroCore.Web.Authentication.JwtBearer.JwtTokenMiddleware+<>c__DisplayClass0_0+<<UseJwtTokenMiddleware>b__0>d.MoveNext() Microsoft.AspNetCore.Authentication.AuthenticationMiddleware.Invoke(HttpContext context)


3 Answer(s)
  • User Avatar
    0
    maliming created
    Support Team

    Is the ConnectionStrings in appsetting.json correct?

  • User Avatar
    0
    unidata created

    Yes, in fact it is the same connection string with which the Migrator is configured and it worked smoothly.

  • User Avatar
    0
    unidata created

    Apologies. I had configured the connection string in "Abp": { "RedisCache": { "ConnectionString": "Server = xxxxxx; Database = xxxx; User Id = sa; Password = xxxx", "DatabaseId": -1 } and not the one at the beginning of the file. Now that we are, what is the "RedisCache" connection string? My mistake. Regards!