Base solution for your next web application
Open Closed

Can't connect to SQL Server when deployed to IIS instead of IIS Express #6980


User avatar
0
southwestre created

I've spent the last two days trying to diagnose why I can't connect to either our remote sql server or my locally installed sql server when running our asp.net zero project through IIS rather than IIS Express. My symptoms are very similar to this question:

https://support.aspnetzero.com/QA/Questions/4060

Unfortunately this question was resolved through a remote session without a posted solution. Can anyone help?

Here is the log down to the first exception:

DEBUG 2019-05-09 16:37:08,628 [1 ] Abp.Modules.AbpModuleManager - Loading Abp modules... DEBUG 2019-05-09 16:37:08,644 [1 ] Abp.Modules.AbpModuleManager - Found 24 ABP modules in total. DEBUG 2019-05-09 16:37:08,661 [1 ] Abp.Modules.AbpModuleManager - Loaded module: SWRE.GAPClaims.Web.Startup.GAPClaimsWebHostModule, SWRE.GAPClaims.Web.Host, Version=6.5.0.0, Culture=neutral, PublicKeyToken=null DEBUG 2019-05-09 16:37:08,663 [1 ] Abp.Modules.AbpModuleManager - Loaded module: SWRE.GAPClaims.Web.GAPClaimsWebCoreModule, SWRE.GAPClaims.Web.Core, Version=6.5.0.0, Culture=neutral, PublicKeyToken=null DEBUG 2019-05-09 16:37:08,664 [1 ] Abp.Modules.AbpModuleManager - Loaded module: SWRE.GAPClaims.GAPClaimsApplicationModule, SWRE.GAPClaims.Application, Version=6.5.0.0, Culture=neutral, PublicKeyToken=null DEBUG 2019-05-09 16:37:08,666 [1 ] Abp.Modules.AbpModuleManager - Loaded module: SWRE.GAPClaims.GAPClaimsCoreModule, SWRE.GAPClaims.Core, Version=6.5.0.0, Culture=neutral, PublicKeyToken=null DEBUG 2019-05-09 16:37:08,666 [1 ] Abp.Modules.AbpModuleManager - Loaded module: Abp.Zero.AbpZeroCoreModule, Abp.ZeroCore, Version=4.5.0.0, Culture=neutral, PublicKeyToken=null DEBUG 2019-05-09 16:37:08,666 [1 ] Abp.Modules.AbpModuleManager - Loaded module: Abp.Zero.AbpZeroCommonModule, Abp.Zero.Common, Version=4.5.0.0, Culture=neutral, PublicKeyToken=null DEBUG 2019-05-09 16:37:08,666 [1 ] Abp.Modules.AbpModuleManager - Loaded module: Abp.AbpKernelModule, Abp, Version=4.5.0.0, Culture=neutral, PublicKeyToken=null DEBUG 2019-05-09 16:37:08,666 [1 ] Abp.Modules.AbpModuleManager - Loaded module: Abp.Zero.Ldap.AbpZeroLdapModule, Abp.Zero.Ldap, Version=4.5.0.0, Culture=neutral, PublicKeyToken=null DEBUG 2019-05-09 16:37:08,667 [1 ] Abp.Modules.AbpModuleManager - Loaded module: Abp.AutoMapper.AbpAutoMapperModule, Abp.AutoMapper, Version=4.5.0.0, Culture=neutral, PublicKeyToken=null DEBUG 2019-05-09 16:37:08,667 [1 ] Abp.Modules.AbpModuleManager - Loaded module: Abp.AspNetZeroCore.AbpAspNetZeroCoreModule, Abp.AspNetZeroCore, Version=1.2.2.0, Culture=neutral, PublicKeyToken=null DEBUG 2019-05-09 16:37:08,667 [1 ] Abp.Modules.AbpModuleManager - Loaded module: Abp.MailKit.AbpMailKitModule, Abp.MailKit, Version=4.5.0.0, Culture=neutral, PublicKeyToken=null DEBUG 2019-05-09 16:37:08,667 [1 ] Abp.Modules.AbpModuleManager - Loaded module: SWRE.GAPClaims.EntityFrameworkCore.GAPClaimsEntityFrameworkCoreModule, SWRE.GAPClaims.EntityFrameworkCore, Version=6.5.0.0, Culture=neutral, PublicKeyToken=null DEBUG 2019-05-09 16:37:08,667 [1 ] Abp.Modules.AbpModuleManager - Loaded module: Abp.Zero.EntityFrameworkCore.AbpZeroCoreEntityFrameworkCoreModule, Abp.ZeroCore.EntityFrameworkCore, Version=4.5.0.0, Culture=neutral, PublicKeyToken=null DEBUG 2019-05-09 16:37:08,667 [1 ] Abp.Modules.AbpModuleManager - Loaded module: Abp.EntityFrameworkCore.AbpEntityFrameworkCoreModule, Abp.EntityFrameworkCore, Version=4.5.0.0, Culture=neutral, PublicKeyToken=null DEBUG 2019-05-09 16:37:08,668 [1 ] Abp.Modules.AbpModuleManager - Loaded module: Abp.EntityFramework.AbpEntityFrameworkCommonModule, Abp.EntityFramework.Common, Version=4.5.0.0, Culture=neutral, PublicKeyToken=null DEBUG 2019-05-09 16:37:08,668 [1 ] Abp.Modules.AbpModuleManager - Loaded module: Abp.IdentityServer4.AbpZeroCoreIdentityServerEntityFrameworkCoreModule, Abp.ZeroCore.IdentityServer4.EntityFrameworkCore, Version=4.5.0.0, Culture=neutral, PublicKeyToken=null DEBUG 2019-05-09 16:37:08,668 [1 ] Abp.Modules.AbpModuleManager - Loaded module: Abp.IdentityServer4.AbpZeroCoreIdentityServerModule, Abp.ZeroCore.IdentityServer4, Version=4.5.0.0, Culture=neutral, PublicKeyToken=null DEBUG 2019-05-09 16:37:08,668 [1 ] Abp.Modules.AbpModuleManager - Loaded module: Abp.AspNetZeroCore.Web.AbpAspNetZeroCoreWebModule, Abp.AspNetZeroCore.Web, Version=1.2.2.0, Culture=neutral, PublicKeyToken=null DEBUG 2019-05-09 16:37:08,668 [1 ] Abp.Modules.AbpModuleManager - Loaded module: Abp.AspNetCore.AbpAspNetCoreModule, Abp.AspNetCore, Version=4.5.0.0, Culture=neutral, PublicKeyToken=null DEBUG 2019-05-09 16:37:08,668 [1 ] Abp.Modules.AbpModuleManager - Loaded module: Abp.Web.AbpWebCommonModule, Abp.Web.Common, Version=4.5.0.0, Culture=neutral, PublicKeyToken=null DEBUG 2019-05-09 16:37:08,668 [1 ] Abp.Modules.AbpModuleManager - Loaded module: Abp.AspNetCore.SignalR.AbpAspNetCoreSignalRModule, Abp.AspNetCore.SignalR, Version=4.5.0.0, Culture=neutral, PublicKeyToken=null DEBUG 2019-05-09 16:37:08,668 [1 ] Abp.Modules.AbpModuleManager - Loaded module: SWRE.GAPClaims.Startup.GAPClaimsGraphQLModule, SWRE.GAPClaims.GraphQL, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null DEBUG 2019-05-09 16:37:08,669 [1 ] Abp.Modules.AbpModuleManager - Loaded module: Abp.Runtime.Caching.Redis.AbpRedisCacheModule, Abp.RedisCache, Version=4.5.0.0, Culture=neutral, PublicKeyToken=null DEBUG 2019-05-09 16:37:08,669 [1 ] Abp.Modules.AbpModuleManager - Loaded module: Abp.Hangfire.AbpHangfireAspNetCoreModule, Abp.HangFire.AspNetCore, Version=4.5.0.0, Culture=neutral, PublicKeyToken=null DEBUG 2019-05-09 16:37:08,671 [1 ] Abp.Modules.AbpModuleManager - 24 modules loaded. DEBUG 2019-05-09 16:37:08,724 [1 ] o.Configuration.LanguageManagementConfig - Converted Abp (Abp.Localization.Dictionaries.DictionaryBasedLocalizationSource) to MultiTenantLocalizationSource DEBUG 2019-05-09 16:37:08,724 [1 ] o.Configuration.LanguageManagementConfig - Converted AbpZero (Abp.Localization.Dictionaries.DictionaryBasedLocalizationSource) to MultiTenantLocalizationSource DEBUG 2019-05-09 16:37:08,724 [1 ] o.Configuration.LanguageManagementConfig - Converted GAPClaims (Abp.Localization.Dictionaries.DictionaryBasedLocalizationSource) to MultiTenantLocalizationSource DEBUG 2019-05-09 16:37:08,724 [1 ] o.Configuration.LanguageManagementConfig - Converted AbpWeb (Abp.Localization.Dictionaries.DictionaryBasedLocalizationSource) to MultiTenantLocalizationSource DEBUG 2019-05-09 16:37:08,977 [1 ] ameworkCore.AbpEntityFrameworkCoreModule - Registering DbContext: SWRE.GAPClaims.EntityFrameworkCore.GAPClaimsDbContext, SWRE.GAPClaims.EntityFrameworkCore, Version=6.5.0.0, Culture=neutral, PublicKeyToken=null DEBUG 2019-05-09 16:37:09,351 [1 ] Abp.Localization.LocalizationManager - Initializing 4 localization sources. DEBUG 2019-05-09 16:37:09,370 [1 ] Abp.Localization.LocalizationManager - Initialized localization source: Abp DEBUG 2019-05-09 16:37:09,378 [1 ] Abp.Localization.LocalizationManager - Initialized localization source: AbpZero DEBUG 2019-05-09 16:37:09,399 [1 ] Abp.Localization.LocalizationManager - Initialized localization source: GAPClaims DEBUG 2019-05-09 16:37:09,402 [1 ] Abp.Localization.LocalizationManager - Initialized localization source: AbpWeb DEBUG 2019-05-09 16:37:09,435 [1 ] Abp.BackgroundJobs.BackgroundJobManager - Start background worker: Castle.Proxies.BackgroundJobManagerProxy DEBUG 2019-05-09 16:37:09,467 [1 ] Abp.AutoMapper.AbpAutoMapperModule - Found 6 classes define auto mapping attributes DEBUG 2019-05-09 16:37:09,467 [1 ] Abp.AutoMapper.AbpAutoMapperModule - SWRE.GAPClaims.Web.Models.TokenAuth.ExternalLoginProviderInfoModel DEBUG 2019-05-09 16:37:09,471 [1 ] Abp.AutoMapper.AbpAutoMapperModule - SWRE.GAPClaims.Friendships.Cache.FriendCacheItem DEBUG 2019-05-09 16:37:09,472 [1 ] Abp.AutoMapper.AbpAutoMapperModule - SWRE.GAPClaims.Dto.OrganizationUnitDto DEBUG 2019-05-09 16:37:09,472 [1 ] Abp.AutoMapper.AbpAutoMapperModule - SWRE.GAPClaims.Dto.RoleDto DEBUG 2019-05-09 16:37:09,472 [1 ] Abp.AutoMapper.AbpAutoMapperModule - SWRE.GAPClaims.Dto.UserDto+RoleDto DEBUG 2019-05-09 16:37:09,472 [1 ] Abp.AutoMapper.AbpAutoMapperModule - SWRE.GAPClaims.Dto.UserDto+OrganizationUnitDto WARN 2019-05-09 16:37:29,490 [4 ] Abp.BackgroundJobs.BackgroundJobManager - System.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. at System.Data.ProviderBase.DbConnectionFactory.TryGetConnection(DbConnection owningConnection, TaskCompletionSource1 retry, DbConnectionOptions userOptions, DbConnectionInternal oldConnection, DbConnectionInternal& connection) at System.Data.ProviderBase.DbConnectionInternal.TryOpenConnectionInternal(DbConnection outerConnection, DbConnectionFactory connectionFactory, TaskCompletionSource1 retry, DbConnectionOptions userOptions) at System.Data.SqlClient.SqlConnection.TryOpen(TaskCompletionSource1 retry) at System.Data.SqlClient.SqlConnection.Open() at Microsoft.EntityFrameworkCore.Storage.RelationalConnection.OpenDbConnection(Boolean errorsExpected) at Microsoft.EntityFrameworkCore.Storage.RelationalConnection.Open(Boolean errorsExpected) at Microsoft.EntityFrameworkCore.Storage.RelationalConnection.BeginTransaction(IsolationLevel isolationLevel) at Microsoft.EntityFrameworkCore.SqlServer.Storage.Internal.SqlServerExecutionStrategy.Execute[TState,TResult](TState state, Func3 operation, Func3 verifySucceeded) at Microsoft.EntityFrameworkCore.RelationalDatabaseFacadeExtensions.BeginTransaction(DatabaseFacade databaseFacade, IsolationLevel isolationLevel) at Abp.EntityFrameworkCore.Uow.DbContextEfCoreTransactionStrategy.CreateDbContext[TDbContext](String connectionString, IDbContextResolver dbContextResolver) at Abp.EntityFrameworkCore.Uow.EfCoreUnitOfWork.GetOrCreateDbContext[TDbContext](Nullable1 multiTenancySide, String name) at Abp.EntityFrameworkCore.Repositories.EfCoreRepositoryBase3.get_Table() at Abp.EntityFrameworkCore.Repositories.EfCoreRepositoryBase3.GetAllIncluding(Expression1[] propertySelectors) at Castle.Proxies.Invocations.IRepository2_GetAll_3.InvokeMethodOnTarget() at Castle.DynamicProxy.AbstractInvocation.Proceed() at Abp.Domain.Uow.UnitOfWorkInterceptor.PerformSyncUow(IInvocation invocation, UnitOfWorkOptions options) at Castle.DynamicProxy.AbstractInvocation.Proceed() at Castle.Proxies.IRepository2Proxy_1.GetAll() at Abp.BackgroundJobs.BackgroundJobStore.GetWaitingJobsAsync(Int32 maxResultCount) at Castle.Proxies.Invocations.BackgroundJobStore_GetWaitingJobsAsync.InvokeMethodOnTarget() at Castle.DynamicProxy.AbstractInvocation.Proceed() at Abp.Domain.Uow.UnitOfWorkInterceptor.PerformAsyncUow(IInvocation invocation, UnitOfWorkOptions options) at Castle.DynamicProxy.AbstractInvocation.Proceed() at Castle.Proxies.BackgroundJobStoreProxy.GetWaitingJobsAsync(Int32 maxResultCount) at System.Threading.Tasks.Task1.InnerInvoke() at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state) --- End of stack trace from previous location where exception was thrown --- at System.Threading.Tasks.Task.ExecuteWithThreadLocal(Task& currentTaskSlot) --- End of stack trace from previous location where exception was thrown --- at Nito.AsyncEx.Synchronous.TaskExtensions.WaitAndUnwrapException[TResult](Task1 task) at System.Threading.Tasks.ContinuationResultTaskFromResultTask2.InnerInvoke() at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state) --- End of stack trace from previous location where exception was thrown --- at System.Threading.Tasks.Task.ExecuteWithThreadLocal(Task& currentTaskSlot) --- End of stack trace from previous location where exception was thrown --- at Nito.AsyncEx.Synchronous.TaskExtensions.WaitAndUnwrapException[TResult](Task1 task) at Nito.AsyncEx.AsyncContext.Run[TResult](Func1 action) at Abp.BackgroundJobs.BackgroundJobManager.DoWork() at Castle.DynamicProxy.AbstractInvocation.Proceed() at Castle.DynamicProxy.AbstractInvocation.Proceed() at Abp.Threading.BackgroundWorkers.PeriodicBackgroundWorkerBase.Timer_Elapsed(Object sender, EventArgs e) System.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. at System.Data.ProviderBase.DbConnectionFactory.TryGetConnection(DbConnection owningConnection, TaskCompletionSource1 retry, DbConnectionOptions userOptions, DbConnectionInternal oldConnection, DbConnectionInternal& connection) at System.Data.ProviderBase.DbConnectionInternal.TryOpenConnectionInternal(DbConnection outerConnection, DbConnectionFactory connectionFactory, TaskCompletionSource1 retry, DbConnectionOptions userOptions) at System.Data.SqlClient.SqlConnection.TryOpen(TaskCompletionSource1 retry) at System.Data.SqlClient.SqlConnection.Open() at Microsoft.EntityFrameworkCore.Storage.RelationalConnection.OpenDbConnection(Boolean errorsExpected) at Microsoft.EntityFrameworkCore.Storage.RelationalConnection.Open(Boolean errorsExpected) at Microsoft.EntityFrameworkCore.Storage.RelationalConnection.BeginTransaction(IsolationLevel isolationLevel) at Microsoft.EntityFrameworkCore.SqlServer.Storage.Internal.SqlServerExecutionStrategy.Execute[TState,TResult](TState state, Func3 operation, Func3 verifySucceeded) at Microsoft.EntityFrameworkCore.RelationalDatabaseFacadeExtensions.BeginTransaction(DatabaseFacade databaseFacade, IsolationLevel isolationLevel) at Abp.EntityFrameworkCore.Uow.DbContextEfCoreTransactionStrategy.CreateDbContext[TDbContext](String connectionString, IDbContextResolver dbContextResolver) at Abp.EntityFrameworkCore.Uow.EfCoreUnitOfWork.GetOrCreateDbContext[TDbContext](Nullable1 multiTenancySide, String name)


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

    @southwestre

    Does IIS Express work?

    Is it possible that the IIS environment caused the wrong appsetting.json to load?

  • User Avatar
    0
    southwestre created

    Yes, IIS Express does work. I've manually reviewed the appsettings.json file in the directory that the IIS website is in and it appears correct.

  • User Avatar
    0
    southwestre created

    @maliming can you help me here?

  • User Avatar
    0
    maliming created
    Support Team

    Can I take a look at it remotely? You can send Teamviewer to [email protected]