an ASP.NET Open Source CMS & eCommerce platform
Search:
Skip Navigation LinksHome > DotShoppingCart Forums > Support > Using DotShoppingCart > Problem with sqlserver logon with Open Source v...
Last Post 11/17/2008 6:30:46 AM By jhcorey. 9 replies.
11/11/2008 10:27:18 AM
jhcorey
Posts: 27
Joined: 9/29/2008
Problem with sqlserver logon with Open Source version.
We have a strange problem.  We're on a server with other asp.net apps that work fine (altho they are asp.net 1).  We keep getting the generic error message on our first try, but then with a re-try we're ok.  After a period of inactivity we have the problem again.
 
The event log says there's a problem with the sqlserver connection.
 
We're using windows authentication, while the other apps use a password and id.
 
Any ideas?
11/11/2008 10:42:26 AM
lukezy
Posts: 2109
Joined: 6/12/2007
Location:WA, US
Re: Problem with sqlserver logon with Open Source version.
Try creating a new app pool for DSC rather than sharing the same app pool with other apps. Let's know if it helps.
DotShoppingCart Staff
11/12/2008 5:32:54 AM
jhcorey
Posts: 27
Joined: 9/29/2008
Re: Problem with sqlserver logon with Open Source version.
DSC already has its own application pool.  Here's the info that appears when I'm on the server.  I can change the connection string so that it uses a userid and password and see if that makes a difference.
I tried about an hour ago, and my second attempt got in.   I just tried from my own computer, got the generic error, tried again and got in.
 
Login failed for user 'NT AUTHORITY\NETWORK SERVICE'. 
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: Cannot open database
"dotshoppingcart" requested by the login. The login failed.
Login failed for user 'NT AUTHORITY\NETWORK SERVICE'.

Source Error: 

An unhandled exception was generated during the execution of the current web
request. Information regarding the origin and location of the exception can be
identified using the exception stack trace below.  

Stack Trace: 


[SqlException (0x80131904): Cannot open database "dotshoppingcart"
requested by the login. The login failed.
Login failed for user 'NT AUTHORITY\NETWORK SERVICE'.]
   System.Data.ProviderBase.DbConnectionPool.GetConnection(DbConnection
owningObject) +435
   System.Data.ProviderBase.DbConnectionPool.GetConnection(DbConnection
owningObject) +494
   System.Data.ProviderBase.DbConnectionFactory.GetConnection(DbConnection
owningConnection) +82
   System.Data.ProviderBase.DbConnectionClosed.OpenConnection(DbConnection
outerConnection, DbConnectionFactory connectionFactory) +105
   System.Data.ProviderBase.DbConnectionClosed.OpenConnection(DbConnection
outerConnection, DbConnectionFactory connectionFactory) +105
   System.Data.SqlClient.SqlConnection.Open() +111
   Microsoft.Practices.EnterpriseLibrary.Data.Database.OpenConnection() +65
   Microsoft.Practices.EnterpriseLibrary.Data.Database.OpenConnection() +136
  
Microsoft.Practices.EnterpriseLibrary.Data.Database.DiscoverParameters(DbCommand
command) +36
  
Microsoft.Practices.EnterpriseLibrary.Data.ParameterCache.SetParameters(DbCommand
command, Database database) +125
  
Microsoft.Practices.EnterpriseLibrary.Data.Database.GetStoredProcCommand(String
storedProcedureName, Object[] parameterValues) +84
   DotShoppingCart.OpenSource.Core.Task.IsScheduledToRun(String host, String
taskName, Int32 intervalInMiniute, Nullable`1 startAt) in
C:\Projects\DotShoppingCartOpenSourceV2\Core\DBO\Task.cs:27
   DotShoppingCart.OpenSource.OrderPipeline.TaskProvider.Proccess(String host,
IConfigurationSource cfgSrc) in
C:\Projects\DotShoppingCartOpenSourceV2\OrderPipeline\OrderPipeline\TaskProvider.cs:50
   DotShoppingCart.OpenSource.OrderPipeline.ProcessorProvider.Run() in
C:\Projects\DotShoppingCartOpenSourceV2\OrderPipeline\OrderPipeline\ProcessorProvider.cs:37
   Microsoft.Practices.EnterpriseLibrary.Data.Database.OpenConnection() +136
  
Microsoft.Practices.EnterpriseLibrary.Data.Database.DiscoverParameters(DbCommand
command) +36
  
Microsoft.Practices.EnterpriseLibrary.Data.ParameterCache.SetParameters(DbCommand
command, Database database) +125
  
Microsoft.Practices.EnterpriseLibrary.Data.Database.GetStoredProcCommand(String
storedProcedureName, Object[] parameterValues) +84
   DotShoppingCart.OpenSource.Core.DbFileBase.GetTimeStamp(String host, Object
key, SqlCacheDependency& dep) in
C:\Projects\DotShoppingCartOpenSourceV2\Core\DBO\DbFileBase.cs:90
   DotShoppingCart.OpenSource.Core.DbFileBase.GetFile(String host, Object key)
in
C:\Projects\DotShoppingCartOpenSourceV2\Core\DBO\DbFileBase.cs:66
   DotShoppingCart.OpenSource.Core.DSCPage.OnPreInit(EventArgs e) in
C:\Projects\DotShoppingCartOpenSourceV2\Core\DSCPage.cs:48
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint,
Boolean includeStagesAfterAsyncPoint) +663

 


 
 
11/12/2008 8:52:50 AM
jhcorey
Posts: 27
Joined: 9/29/2008
Re: Problem with sqlserver logon with Open Source version.
Another thing I should probably mention.  I changed code in Dynamic.aspx.cs as shown below. 
Since I am adding pages and controls I ran into a problem with this caching scheme, and temporarily worked around it.  This code is in my implementation that has the problem.
 
This is probably unrelated to my current problem, but if I knew how to clear the cache (iisreset didn't seem to do it) then I would revert back to the original code.
 
private Dictionary<string, PageConfig> PageConfigurations
{
 get
 {
 Dictionary<string, PageConfig> pageConfigurations;
 object o = Utils.Cache.Get(pageConfigurationsCacheKey);
 if (1 == 1)
 //  if (null == o)
11/12/2008 9:53:15 AM
lukezy
Posts: 2109
Joined: 6/12/2007
Location:WA, US
Re: Problem with sqlserver logon with Open Source version.
Your problem is the SQL permission issue. You need to grant permission to the following user.
 
Login failed for user 'NT AUTHORITY\NETWORK SERVICE'
DotShoppingCart Staff
11/12/2008 4:35:31 PM
jhcorey
Posts: 27
Joined: 9/29/2008
Re: Problem with sqlserver logon with Open Source version.
I saw something else.  I get on to SqlServer and I see that the database is in Recovery.  I've seen this before.  So I have to go and research what that is all about.
I had uploaded the mdf files from my dev machine.  The server with the problem is running SqlServer Express.
11/12/2008 8:02:21 PM
jhcorey
Posts: 27
Joined: 9/29/2008
Re: Problem with sqlserver logon with Open Source version.
More confusion.  Part of my problems may be due to not having the fulltext catalog, as a message referring to it appears when I try to backup the database.  I haven't yet been able to find or rebuild it.

11/13/2008 11:54:53 AM
jhcorey
Posts: 27
Joined: 9/29/2008
Re: Problem with sqlserver logon with Open Source version.
Ok.  I've been using Sql Server Express, but not the version with Advanced
Services, as the prerequisites note.   This gets things all messed up, as the installation includes the full-text catalog, but the sqlserver engine can't handle it.
That may be the source of a lot of the problems.
11/13/2008 12:10:36 PM
lukezy
Posts: 2109
Joined: 6/12/2007
Location:WA, US
Re: Problem with sqlserver logon with Open Source version.
Yes, try installing the advanced SQL express edition and then install DSC from scrath. Let us know how it goes.
DotShoppingCart Staff
11/17/2008 6:30:46 AM
jhcorey
Posts: 27
Joined: 9/29/2008
Re: Problem with sqlserver logon with Open Source version.
Things seem to be ok now.  It seems that I had a whole set of issues because I developed on a regular version of SqlServer, and then copied the mdf files to a server that had SQLServer Express without the Advanced Features.
 
This caused all sorts of issues -- the database was always in recovery, I couldn't back it up -- that had me puzzled for a while.
 
Since I'm using just a small subset of the features, and don't need the full-text search, I turned it off, and was finally able to use my development mdf.