Discussion:
Login failed for user 'IIS APPPOOL\DefaultAppPool'.
(too old to reply)
hedera
2010-01-12 01:40:01 UTC
Permalink
I recently rebuilt my laptop to Windows 7 Ultimate 64-bit and am trying to
rebuild my local test web sites - I support 2 DotNetNuke sites. I've got IIS
up and SQL Server 2005 Express up, I downloaded the x86 binaries for 64-bit.
I downloaded the web site production files and database backup, created the
SQL database and associated login, but when I try to open the local site I
get this error and stack trace:

Exception Details: System.Data.SqlClient.SqlException: Cannot open database
"oaklandsymphonychorus" requested by the login. The login failed.
Login failed for user 'IIS APPPOOL\DefaultAppPool'.
Stack Trace:

[SqlException (0x80131904): Cannot open database "oaklandsymphonychorus"
requested by the login. The login failed.
Login failed for user 'IIS APPPOOL\DefaultAppPool'.]
System.Data.ProviderBase.DbConnectionPool.GetConnection(DbConnection
owningObject) +578
System.Data.ProviderBase.DbConnectionFactory.GetConnection(DbConnection
owningConnection) +88
System.Data.ProviderBase.DbConnectionClosed.OpenConnection(DbConnection
outerConnection, DbConnectionFactory connectionFactory) +6265031
System.Data.SqlClient.SqlConnection.Open() +258

Microsoft.ApplicationBlocks.Data.SqlHelperParameterCache.DiscoverSpParameterSet(SqlConnection
connection, String spName, Boolean includeReturnValueParameter, Object[]
parameterValues) +391

Microsoft.ApplicationBlocks.Data.SqlHelperParameterCache.GetSpParameterSetInternal(SqlConnection
connection, String spName, Boolean includeReturnValueParameter) +641

Microsoft.ApplicationBlocks.Data.SqlHelperParameterCache.GetSpParameterSet(String connectionString, String spName, Boolean includeReturnValueParameter) +208

Microsoft.ApplicationBlocks.Data.SqlHelperParameterCache.GetSpParameterSet(String connectionString, String spName) +63
Microsoft.ApplicationBlocks.Data.SqlHelper.ExecuteReader(String
connectionString, String spName, Object[] parameterValues) +293

DotNetNuke.Services.Log.EventLog.DBLoggingProvider.Data.SqlDataProvider.GetLogTypeConfigInfo() +106

DotNetNuke.Services.Log.EventLog.DBLoggingProvider.DBLoggingProvider.GetLogTypeConfigInfo() +127

DotNetNuke.Services.Log.EventLog.DBLoggingProvider.DBLoggingProvider.GetLogTypeConfigInfoByKey(String LogTypeKey, String LogTypePortalID) +86

DotNetNuke.Services.Log.EventLog.DBLoggingProvider.DBLoggingProvider.AddLog(LogInfo objLogInfo) +98
DotNetNuke.Services.Log.EventLog.LogController.AddLog(LogInfo objLogInfo)
+254
---- end of stack trace ---------------------

The actual SQL login and database user is oscuser, and I created it with the
same password the production site uses. The test web site does use the
DefaultAppPool, and did before my upgrade. I'm using the following
connection strings, which worked until the system upgrade:

<connectionStrings>
<add name="SiteSqlServer" connectionString="Data Source=.\SQLEXPRESS;
Initial Catalog=oaklandsymphonychorus; Integrated Security=True;"
providerName="System.Data.SqlClient" />
</connectionStrings>
<appSettings>
<add key="SiteSqlServer" value="Data Source=.\SQLEXPRESS; Initial
Catalog=oaklandsymphonychorus; Integrated Security=True;"/>
</appSettings>

Can anyone suggest why I'm now getting this login error? Is this a Win7
issue? I've seen one problem here where SQL Server was running under the
local userid and the local user had recently changed his password; I did
recently change my password, but when I checked the Logon tab for my SQL
Server, it was logged in as Network Service - it had password/password
confirmation fields below but of course they're encrypted and I have no idea
what they are.
--
hedera

Nature bats last.
William Vaughn (MVP)
2010-01-12 21:33:13 UTC
Permalink
Since you've chosen to use Windows Authentication (SSPI) the "Login" is IIS
(as indicated by the exception). Make sure there is a SQL Server login for
this "user" and grant right to it based on what database and objects within
the database it's using.
--
__________________________________________________________________________
William R. Vaughn
President and Founder Beta V Corporation
Author, Mentor, Dad, Grandpa
Microsoft MVP
(425) 556-9205 (Pacific time)
Hitchhiker's Guide to Visual Studio and SQL Server (7th Edition)
http://betav.com http://betav.com/blog/billva
____________________________________________________________________________________________
Post by hedera
I recently rebuilt my laptop to Windows 7 Ultimate 64-bit and am trying to
rebuild my local test web sites - I support 2 DotNetNuke sites. I've got IIS
up and SQL Server 2005 Express up, I downloaded the x86 binaries for 64-bit.
I downloaded the web site production files and database backup, created the
SQL database and associated login, but when I try to open the local site I
Exception Details: System.Data.SqlClient.SqlException: Cannot open database
"oaklandsymphonychorus" requested by the login. The login failed.
Login failed for user 'IIS APPPOOL\DefaultAppPool'.
[SqlException (0x80131904): Cannot open database "oaklandsymphonychorus"
requested by the login. The login failed.
Login failed for user 'IIS APPPOOL\DefaultAppPool'.]
System.Data.ProviderBase.DbConnectionPool.GetConnection(DbConnection
owningObject) +578
System.Data.ProviderBase.DbConnectionFactory.GetConnection(DbConnection
owningConnection) +88
System.Data.ProviderBase.DbConnectionClosed.OpenConnection(DbConnection
outerConnection, DbConnectionFactory connectionFactory) +6265031
System.Data.SqlClient.SqlConnection.Open() +258
Microsoft.ApplicationBlocks.Data.SqlHelperParameterCache.DiscoverSpParameterSet(SqlConnection
connection, String spName, Boolean includeReturnValueParameter, Object[]
parameterValues) +391
Microsoft.ApplicationBlocks.Data.SqlHelperParameterCache.GetSpParameterSetInternal(SqlConnection
connection, String spName, Boolean includeReturnValueParameter) +641
Microsoft.ApplicationBlocks.Data.SqlHelperParameterCache.GetSpParameterSet(String
connectionString, String spName, Boolean includeReturnValueParameter) +208
Microsoft.ApplicationBlocks.Data.SqlHelperParameterCache.GetSpParameterSet(String
connectionString, String spName) +63
Microsoft.ApplicationBlocks.Data.SqlHelper.ExecuteReader(String
connectionString, String spName, Object[] parameterValues) +293
DotNetNuke.Services.Log.EventLog.DBLoggingProvider.Data.SqlDataProvider.GetLogTypeConfigInfo()
+106
DotNetNuke.Services.Log.EventLog.DBLoggingProvider.DBLoggingProvider.GetLogTypeConfigInfo()
+127
DotNetNuke.Services.Log.EventLog.DBLoggingProvider.DBLoggingProvider.GetLogTypeConfigInfoByKey(String
LogTypeKey, String LogTypePortalID) +86
DotNetNuke.Services.Log.EventLog.DBLoggingProvider.DBLoggingProvider.AddLog(LogInfo
objLogInfo) +98
DotNetNuke.Services.Log.EventLog.LogController.AddLog(LogInfo objLogInfo)
+254
---- end of stack trace ---------------------
The actual SQL login and database user is oscuser, and I created it with the
same password the production site uses. The test web site does use the
DefaultAppPool, and did before my upgrade. I'm using the following
<connectionStrings>
<add name="SiteSqlServer" connectionString="Data Source=.\SQLEXPRESS;
Initial Catalog=oaklandsymphonychorus; Integrated Security=True;"
providerName="System.Data.SqlClient" />
</connectionStrings>
<appSettings>
<add key="SiteSqlServer" value="Data Source=.\SQLEXPRESS; Initial
Catalog=oaklandsymphonychorus; Integrated Security=True;"/>
</appSettings>
Can anyone suggest why I'm now getting this login error? Is this a Win7
issue? I've seen one problem here where SQL Server was running under the
local userid and the local user had recently changed his password; I did
recently change my password, but when I checked the Logon tab for my SQL
Server, it was logged in as Network Service - it had password/password
confirmation fields below but of course they're encrypted and I have no idea
what they are.
--
hedera
Nature bats last.
Erland Sommarskog
2010-01-12 22:25:26 UTC
Permalink
Post by hedera
I recently rebuilt my laptop to Windows 7 Ultimate 64-bit and am trying
to rebuild my local test web sites - I support 2 DotNetNuke sites. I've
got IIS up and SQL Server 2005 Express up, I downloaded the x86 binaries
for 64-bit. I downloaded the web site production files and database
backup, created the SQL database and associated login, but when I try to
Exception Details: System.Data.SqlClient.SqlException: Cannot open database
"oaklandsymphonychorus" requested by the login. The login failed.
Login failed for user 'IIS APPPOOL\DefaultAppPool'.
...
First question: is there a database with this name at all?
Post by hedera
The actual SQL login and database user is oscuser, and I created it with
the same password the production site uses. The test web site does use
the DefaultAppPool, and did before my upgrade. I'm using the following
<connectionStrings>
<add name="SiteSqlServer" connectionString="Data
Source=.\SQLEXPRESS;
Initial Catalog=oaklandsymphonychorus; Integrated Security=True;"
providerName="System.Data.SqlClient" />
</connectionStrings>
<appSettings>
<add key="SiteSqlServer" value="Data Source=.\SQLEXPRESS; Initial
Catalog=oaklandsymphonychorus; Integrated Security=True;"/>
</appSettings>
Above you talk about an SQL login and user, but here you say
"Integrated Security=True", which means Windows authentication?

If you want to use an SQL login, you need to change the connection
string?

If you want to run with Windows authentication, you need to give
tihs APPPOOL user access to the database.
--
Erland Sommarskog, SQL Server MVP, ***@sommarskog.se

Links for SQL Server Books Online:
SQL 2008: http://msdn.microsoft.com/en-us/sqlserver/cc514207.aspx
SQL 2005: http://msdn.microsoft.com/en-us/sqlserver/bb895970.aspx
SQL 2000: http://www.microsoft.com/sql/prodinfo/previousversions/books.mspx
hedera
2010-01-13 04:58:02 UTC
Permalink
Yes, there is a database with this name. I'm interested to hear from both of
you that the connection string I'm using implies Windows authentication; I
certainly thought I had set up SQL authentication. I had trouble setting up
connectivity originally, and someone suggested I use this connection string,
and it worked, so I didn't question further. Unfortunately I'm a total
newbie when it comes to SQL, as you can probably tell.

Supposing I do want to use SQL authentication, what should my connection
string be? At this point I'm going to take the whole thing down and
reconstruct it.
--
hedera

Nature bats last.
Post by Erland Sommarskog
Post by hedera
I recently rebuilt my laptop to Windows 7 Ultimate 64-bit and am trying
to rebuild my local test web sites - I support 2 DotNetNuke sites. I've
got IIS up and SQL Server 2005 Express up, I downloaded the x86 binaries
for 64-bit. I downloaded the web site production files and database
backup, created the SQL database and associated login, but when I try to
Exception Details: System.Data.SqlClient.SqlException: Cannot open database
"oaklandsymphonychorus" requested by the login. The login failed.
Login failed for user 'IIS APPPOOL\DefaultAppPool'.
...
First question: is there a database with this name at all?
Post by hedera
The actual SQL login and database user is oscuser, and I created it with
the same password the production site uses. The test web site does use
the DefaultAppPool, and did before my upgrade. I'm using the following
<connectionStrings>
<add name="SiteSqlServer" connectionString="Data
Source=.\SQLEXPRESS;
Initial Catalog=oaklandsymphonychorus; Integrated Security=True;"
providerName="System.Data.SqlClient" />
</connectionStrings>
<appSettings>
<add key="SiteSqlServer" value="Data Source=.\SQLEXPRESS; Initial
Catalog=oaklandsymphonychorus; Integrated Security=True;"/>
</appSettings>
Above you talk about an SQL login and user, but here you say
"Integrated Security=True", which means Windows authentication?
If you want to use an SQL login, you need to change the connection
string?
If you want to run with Windows authentication, you need to give
tihs APPPOOL user access to the database.
--
SQL 2008: http://msdn.microsoft.com/en-us/sqlserver/cc514207.aspx
SQL 2005: http://msdn.microsoft.com/en-us/sqlserver/bb895970.aspx
SQL 2000: http://www.microsoft.com/sql/prodinfo/previousversions/books.mspx
.
Erland Sommarskog
2010-01-13 08:51:58 UTC
Permalink
Post by hedera
Supposing I do want to use SQL authentication, what should my connection
string be? At this point I'm going to take the whole thing down and
reconstruct it.
You should take out Integrated Security=True, and put in

User Id=username;Password=Pwd

There is some variation which keywords that are actually used, so it could
be Uid and Pwd instead.

www.connectionstrings.com may be worth checking out.
--
Erland Sommarskog, SQL Server MVP, ***@sommarskog.se

Links for SQL Server Books Online:
SQL 2008: http://msdn.microsoft.com/en-us/sqlserver/cc514207.aspx
SQL 2005: http://msdn.microsoft.com/en-us/sqlserver/bb895970.aspx
SQL 2000: http://www.microsoft.com/sql/prodinfo/previousversions/books.mspx
hedera
2010-01-13 23:07:02 UTC
Permalink
I've been looking at www.connectionstrings.com and going through some of the
options; I'm now remembering back several months (July) when I did this
before, I could NOT get a successful login with the string you suggest, and
someone suggested that restoring the local database from a backup of the
production server, which I do, would have caused SQL SERVER to give the
database user a different SID on my local system than on the production
system, and I needed to run a SQL script to change the SID! Apparently this
was a change with SP2. Does that sound possible to you? Before I got there,
someone suggested I use the "Integrated Security=True" format, and because it
worked, I quit following up on the script issue. I have an awful feeling I'm
back to figuring out how to move the SID. Not that I won't try again.
--
hedera

Nature bats last.
Post by Erland Sommarskog
Post by hedera
Supposing I do want to use SQL authentication, what should my connection
string be? At this point I'm going to take the whole thing down and
reconstruct it.
You should take out Integrated Security=True, and put in
User Id=username;Password=Pwd
There is some variation which keywords that are actually used, so it could
be Uid and Pwd instead.
www.connectionstrings.com may be worth checking out.
--
SQL 2008: http://msdn.microsoft.com/en-us/sqlserver/cc514207.aspx
SQL 2005: http://msdn.microsoft.com/en-us/sqlserver/bb895970.aspx
SQL 2000: http://www.microsoft.com/sql/prodinfo/previousversions/books.mspx
.
hedera
2010-01-14 19:51:01 UTC
Permalink
I have solved this. The issue was in fact the "orphaned" userid. I
described the problem to tech support at my ISP (ServerIntellect, they
deserve the kudo) and they gave me the command to fix the problem and
explained how to execute it in SQL Server Management Studio Express. (I told
you I was a total noob...) I now know that whenever I restore the test site
from a production backup, I need to run this query against the database
before I try to browse to the site:

exec sp_change_users_login 'Auto_fix', 'oscuser'

Thanks for helping me identify my real problem.
--
hedera

Nature bats last.
Post by hedera
I've been looking at www.connectionstrings.com and going through some of the
options; I'm now remembering back several months (July) when I did this
before, I could NOT get a successful login with the string you suggest, and
someone suggested that restoring the local database from a backup of the
production server, which I do, would have caused SQL SERVER to give the
database user a different SID on my local system than on the production
system, and I needed to run a SQL script to change the SID! Apparently this
was a change with SP2. Does that sound possible to you? Before I got there,
someone suggested I use the "Integrated Security=True" format, and because it
worked, I quit following up on the script issue. I have an awful feeling I'm
back to figuring out how to move the SID. Not that I won't try again.
--
hedera
Nature bats last.
Post by Erland Sommarskog
Post by hedera
Supposing I do want to use SQL authentication, what should my connection
string be? At this point I'm going to take the whole thing down and
reconstruct it.
You should take out Integrated Security=True, and put in
User Id=username;Password=Pwd
There is some variation which keywords that are actually used, so it could
be Uid and Pwd instead.
www.connectionstrings.com may be worth checking out.
--
SQL 2008: http://msdn.microsoft.com/en-us/sqlserver/cc514207.aspx
SQL 2005: http://msdn.microsoft.com/en-us/sqlserver/bb895970.aspx
SQL 2000: http://www.microsoft.com/sql/prodinfo/previousversions/books.mspx
.
Erland Sommarskog
2010-01-14 22:06:15 UTC
Permalink
Post by hedera
I've been looking at www.connectionstrings.com and going through some of
the options; I'm now remembering back several months (July) when I did
this before, I could NOT get a successful login with the string you
suggest, and someone suggested that restoring the local database from a
backup of the production server, which I do, would have caused SQL
SERVER to give the database user a different SID on my local system than
on the production system, and I needed to run a SQL script to change the
SID! Apparently this was a change with SP2. Does that sound possible
to you?
I see that you have already sorted out the issue. I only like to add this
is not something that started to happen with SQL 2005 SP2, but it has
been this way since the dawn of time.

The only thing that was new in SQL 2005 SP2, is you since then can use
the command ALTER USER SET LOGIN. The procedure sp_change_users_login
is older function for the same thing.
--
Erland Sommarskog, SQL Server MVP, ***@sommarskog.se

Links for SQL Server Books Online:
SQL 2008: http://msdn.microsoft.com/en-us/sqlserver/cc514207.aspx
SQL 2005: http://msdn.microsoft.com/en-us/sqlserver/bb895970.aspx
SQL 2000: http://www.microsoft.com/sql/prodinfo/previousversions/books.mspx
Samuel Olanrewaju
2010-04-23 13:39:47 UTC
Permalink
this link gave me the CORRECT ANSWER. You can try it too

http://yeejie.
com/blog/post/2010/01/08/Login-failed-for-user-IIS-APPPOOL5cDefaultAppPool.
aspx

url:http://www.ureader.com/msg/11431931.aspx
a***@gmail.com
2014-03-04 17:29:50 UTC
Permalink
Hello
1. Run your IIS explorer.
2. now open your "Application Pool"
3. You can select now "DefaultAppPool" and click on option "Advance Settings" section.
4. Now drill down Application Pool Identity and select "Local System" if you need to run application locally.
5. Otherwise you have to select "ApplicationPoolIdenity" from your drop down.

Hope it will work for you. I have suggested a link to go through more http://www.technologycrowds.com/2013/03/login-failed-for-user-iis.html

thanks,
Post by hedera
I recently rebuilt my laptop to Windows 7 Ultimate 64-bit and am trying to
rebuild my local test web sites - I support 2 DotNetNuke sites. I've got IIS
up and SQL Server 2005 Express up, I downloaded the x86 binaries for 64-bit.
I downloaded the web site production files and database backup, created the
SQL database and associated login, but when I try to open the local site I
Exception Details: System.Data.SqlClient.SqlException: Cannot open database
"oaklandsymphonychorus" requested by the login. The login failed.
Login failed for user 'IIS APPPOOL\DefaultAppPool'.
[SqlException (0x80131904): Cannot open database "oaklandsymphonychorus"
requested by the login. The login failed.
Login failed for user 'IIS APPPOOL\DefaultAppPool'.]
System.Data.ProviderBase.DbConnectionPool.GetConnection(DbConnection
owningObject) +578
System.Data.ProviderBase.DbConnectionFactory.GetConnection(DbConnection
owningConnection) +88
System.Data.ProviderBase.DbConnectionClosed.OpenConnection(DbConnection
outerConnection, DbConnectionFactory connectionFactory) +6265031
System.Data.SqlClient.SqlConnection.Open() +258
Microsoft.ApplicationBlocks.Data.SqlHelperParameterCache.DiscoverSpParameterSet(SqlConnection
connection, String spName, Boolean includeReturnValueParameter, Object[]
parameterValues) +391
Microsoft.ApplicationBlocks.Data.SqlHelperParameterCache.GetSpParameterSetInternal(SqlConnection
connection, String spName, Boolean includeReturnValueParameter) +641
Microsoft.ApplicationBlocks.Data.SqlHelperParameterCache.GetSpParameterSet(String connectionString, String spName, Boolean includeReturnValueParameter) +208
Microsoft.ApplicationBlocks.Data.SqlHelperParameterCache.GetSpParameterSet(String connectionString, String spName) +63
Microsoft.ApplicationBlocks.Data.SqlHelper.ExecuteReader(String
connectionString, String spName, Object[] parameterValues) +293
DotNetNuke.Services.Log.EventLog.DBLoggingProvider.Data.SqlDataProvider.GetLogTypeConfigInfo() +106
DotNetNuke.Services.Log.EventLog.DBLoggingProvider.DBLoggingProvider.GetLogTypeConfigInfo() +127
DotNetNuke.Services.Log.EventLog.DBLoggingProvider.DBLoggingProvider.GetLogTypeConfigInfoByKey(String LogTypeKey, String LogTypePortalID) +86
DotNetNuke.Services.Log.EventLog.DBLoggingProvider.DBLoggingProvider.AddLog(LogInfo objLogInfo) +98
DotNetNuke.Services.Log.EventLog.LogController.AddLog(LogInfo objLogInfo)
+254
---- end of stack trace ---------------------
The actual SQL login and database user is oscuser, and I created it with the
same password the production site uses. The test web site does use the
DefaultAppPool, and did before my upgrade. I'm using the following
<connectionStrings>
<add name="SiteSqlServer" connectionString="Data Source=.\SQLEXPRESS;
Initial Catalog=oaklandsymphonychorus; Integrated Security=True;"
providerName="System.Data.SqlClient" />
</connectionStrings>
<appSettings>
<add key="SiteSqlServer" value="Data Source=.\SQLEXPRESS; Initial
Catalog=oaklandsymphonychorus; Integrated Security=True;"/>
</appSettings>
Can anyone suggest why I'm now getting this login error? Is this a Win7
issue? I've seen one problem here where SQL Server was running under the
local userid and the local user had recently changed his password; I did
recently change my password, but when I checked the Logon tab for my SQL
Server, it was logged in as Network Service - it had password/password
confirmation fields below but of course they're encrypted and I have no idea
what they are.
--
hedera
Nature bats last.
Loading...