-1

when I try to do a file import from my web page I get some sort of app pool login error. So I change my IIS to use LocalSystem for Identity (but it recommends Application Pool Identity).

After I change that I get a database error saying NT Authority/System doesn't have permissions. So I change Login Security and map the db with dbo rights to get it to work.

Can someone help me with some insight? The rest of the application works fine without those changes to IIS and SQL but just when I do that file import it barks at me. How do I get it to work the recommended way with Application Pool Identity?

Additional Info:

Log Name:      Application
Source:        ASP.NET 2.0.50727.0
Date:          9/2/2015 2:10:10 PM
Event ID:      1334
Task Category: None
Level:         Error
Keywords:      Classic
User:          N/A

Description:
An unhandled exception occurred and the process was terminated.

Application ID: /LM/W3SVC/1/ROOT/eoc7

Process ID: 5636

Exception: System.Data.SqlClient.SqlException

Message: Login failed for user 'IIS APPPOOL\Classic .NET AppPool'.

StackTrace: 
Server stack trace: 
   at System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection)
   at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj)
   at System.Data.SqlClient.TdsParser.Run(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj)
   at System.Data.SqlClient.SqlInternalConnectionTds.CompleteLogin(Boolean enlistOK)
   at System.Data.SqlClient.SqlInternalConnectionTds.AttemptOneLogin(ServerInfo serverInfo, String newPassword, Boolean ignoreSniOpenTimeout, Int64 timerExpire, SqlConnection owningObject)
   at System.Data.SqlClient.SqlInternalConnectionTds.LoginNoFailover(String host, String newPassword, Boolean redirectedUserInstance, SqlConnection owningObject, SqlConnectionString connectionOptions, Int64 timerStart)
   at System.Data.SqlClient.SqlInternalConnectionTds.OpenLoginEnlist(SqlConnection owningObject, SqlConnectionString connectionOptions, String newPassword, Boolean redirectedUserInstance)
   at System.Data.SqlClient.SqlInternalConnectionTds..ctor(DbConnectionPoolIdentity identity, SqlConnectionString connectionOptions, Object providerInfo, String newPassword, SqlConnection owningObject, Boolean redirectedUserInstance)
   at System.Data.SqlClient.SqlConnectionFactory.CreateConnection(DbConnectionOptions options, Object poolGroupProviderInfo, DbConnectionPool pool, DbConnection owningConnection)
   at System.Data.ProviderBase.DbConnectionFactory.CreatePooledConnection(DbConnection owningConnection, DbConnectionPool pool, DbConnectionOptions options)
   at System.Data.ProviderBase.DbConnectionPool.CreateObject(DbConnection owningObject)
   at System.Data.ProviderBase.DbConnectionPool.UserCreateRequest(DbConnection owningObject)
   at System.Data.ProviderBase.DbConnectionPool.GetConnection(DbConnection owningObject)
   at System.Data.ProviderBase.DbConnectionFactory.GetConnection(DbConnection owningConnection)
   at System.Data.ProviderBase.DbConnectionClosed.OpenConnection(DbConnection outerConnection, DbConnectionFactory connectionFactory)
   at System.Data.SqlClient.SqlConnection.Open()
Rod
  • 14,529
  • 31
  • 118
  • 230
  • Start at the root: "when I try to do a file import from my web page I get some sort of app pool login error" What error? What code? – mason Sep 02 '15 at 18:44

1 Answers1

0

The error message you get from SQL Server when you have your IIS running with application pool identity is pretty accurate: "Login failed for user 'IIS APPPOOL\Classic .NET AppPool'"

To grant access on your SQL server you could add a login with the name from the error message (IIS APPPOOL\Classic .NET AppPool) and map this to the database needed/give it the proper permissions. These application pool users are not searchable in the search wizard, but can be manually entered in the Login name field:

enter image description here

Note that you would normally create a specific application pool instead of using the built-in Classic .NET AppPool, this SO post gives more information: Separate application pools for ASP.net applications in IIS

Community
  • 1
  • 1
larsts
  • 451
  • 5
  • 12