Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Login failed for user 'IIS APPPOOL\DefaultAppPool'.

1,711 views
Skip to first unread message

hedera

unread,
Jan 11, 2010, 8:40:01 PM1/11/10
to
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)

unread,
Jan 12, 2010, 4:33:13 PM1/12/10
to
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
____________________________________________________________________________________________

"hedera" <hed...@discussions.microsoft.com> wrote in message
news:2079AD75-DAE5-4129...@microsoft.com...

Erland Sommarskog

unread,
Jan 12, 2010, 5:25:26 PM1/12/10
to
hedera (hed...@discussions.microsoft.com) writes:
> 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:
>...

First question: is there a database with this name at all?

> 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>

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, esq...@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

unread,
Jan 12, 2010, 11:58:02 PM1/12/10
to
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.


"Erland Sommarskog" wrote:

> .
>

Erland Sommarskog

unread,
Jan 13, 2010, 3:51:58 AM1/13/10
to
hedera (hed...@discussions.microsoft.com) writes:
> 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.

hedera

unread,
Jan 13, 2010, 6:07:02 PM1/13/10
to
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.


"Erland Sommarskog" wrote:

> .
>

hedera

unread,
Jan 14, 2010, 2:51:01 PM1/14/10
to

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.

Erland Sommarskog

unread,
Jan 14, 2010, 5:06:15 PM1/14/10
to
hedera (hed...@discussions.microsoft.com) writes:
> 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.

Samuel Olanrewaju

unread,
Apr 23, 2010, 9:39:47 AM4/23/10
to
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

anja...@gmail.com

unread,
Mar 4, 2014, 12:29:50 PM3/4/14
to
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,
0 new messages