.NET webforms app & Sql Server database.
We have a fairly typical setup in our local develop environments. We run the worker process as ourselves and use "Integrated Security=True" on our Sql connection strings. In our dev databases, we have full access. Our production systems run under App Pool identities.
Recently, some developers have been having an issue that results in the following stack trace which indicates that the local computer is being used for database connections. We have verified that the app pool Identity is correctly set to the user and the password is correct. There are even Event Log -> Security events showing the successful login of that user and process. The same place that errors would show up if, for example, the user's password was not set correctly.
The problem persists for a while and then just seems to go away. Some devs say that one recreation of the app pool makes it go away, but for others that doesn't seem to help. On developer spent half a day recreating site/pools, rebooting, etc with nothing working and then just suddenly the problem went away.
Does anyone know of an non-obvious reasons that something would cause the worker process to act like this ASP.net?
Server Error in '/' Application.
Login failed for user '{DOMAIN}{COMPUTER NAME}'. Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.Data.SqlClient.SqlException: Login failed for user '{DOMAIN}{COMPUTER NAME}'.
Source Error:
Line N
conn.Open() Line 37: Line 38:
Source File: ... APP CODE line number N Line: 36
Stack Trace:
[SqlException (0x80131904): Login failed for user '{DOMAIN}{COMPUTER NAME}'.]
System.Data.SqlClient.SqlInternalConnectionTds..ctor(DbConnectionPoolIdentity identity, SqlConnectionString connectionOptions, SqlCredential credential, Object providerInfo, String newPassword, SecureString newSecurePassword, Boolean redirectedUserInstance, SqlConnectionString userConnectionOptions, SessionData reconnectSessionData, DbConnectionPool pool, String accessToken, Boolean applyTransientFaultHandling, SqlAuthenticationProviderManager sqlAuthProviderManager) +1524
System.Data.SqlClient.SqlConnectionFactory.CreateConnection(DbConnectionOptions options, DbConnectionPoolKey poolKey, Object poolGroupProviderInfo, DbConnectionPool pool, DbConnection owningConnection, DbConnectionOptions userOptions) +467
System.Data.ProviderBase.DbConnectionFactory.CreatePooledConnection(DbConnectionPool pool, DbConnection owningObject, DbConnectionOptions options, DbConnectionPoolKey poolKey, DbConnectionOptions userOptions) +70
System.Data.ProviderBase.DbConnectionPool.CreateObject(DbConnection owningObject, DbConnectionOptions userOptions, DbConnectionInternal oldConnection) +940
System.Data.ProviderBase.DbConnectionPool.UserCreateRequest(DbConnection owningObject, DbConnectionOptions userOptions, DbConnectionInternal oldConnection) +111
System.Data.ProviderBase.DbConnectionPool.TryGetConnection(DbConnection owningObject, UInt32 waitForMultipleObjectsTimeout, Boolean allowCreate, Boolean onlyOneCheckConnection, DbConnectionOptions userOptions, DbConnectionInternal& connection) +1567
System.Data.ProviderBase.DbConnectionPool.TryGetConnection(DbConnection owningObject, TaskCompletionSource1 retry, DbConnectionOptions userOptions, DbConnectionInternal& connection) +118 System.Data.ProviderBase.DbConnectionFactory.TryGetConnection(DbConnection owningConnection, TaskCompletionSource1 retry, DbConnectionOptions userOptions, DbConnectionInternal oldConnection, DbConnectionInternal& connection) +268
System.Data.ProviderBase.DbConnectionInternal.TryOpenConnectionInternal(DbConnection outerConnection, DbConnectionFactory connectionFactory, TaskCompletionSource1 retry, DbConnectionOptions userOptions) +315 System.Data.SqlClient.SqlConnection.TryOpenInner(TaskCompletionSource1 retry) +128
System.Data.SqlClient.SqlConnection.TryOpen(TaskCompletionSource`1 retry) +265 System.Data.SqlClient.SqlConnection.Open() +133
... SNIPPED APP CODE ... System.Web.UI.Page.OnPreInit(EventArgs e) +11691288
System.Web.UI.Page.PerformPreInit() +47
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +335
Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.8.4330.0