No Database Instance

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.
10 years ago
Hello,

I recently uploaded NopC from a test site to my production site (they use the same database server), and receive the error below.  I have verified the connection strings in Web.config and APP_Data\settings.txt and all are correct.  Where else should I look?

Thanks in advance!
Jeff


Server Error in '/' Application.

No database instance

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.ApplicationException: No database instance

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:


[ApplicationException: No database instance]
   Nop.Data.Initializers.CreateTablesIfNotExist`1.InitializeDatabase(TContext context) +778
   System.Data.Entity.<>c__DisplayClass2`1.<SetInitializerInternal>b__0(DbContext c) +70
   System.Data.Entity.Internal.<>c__DisplayClass8.<PerformDatabaseInitialization>b__6() +19
   System.Data.Entity.Internal.InternalContext.PerformInitializationAction(Action action) +60
   System.Data.Entity.Internal.InternalContext.PerformDatabaseInitialization() +181
   System.Data.Entity.Internal.LazyInternalContext.<InitializeDatabase>b__4(InternalContext c) +7
   System.Data.Entity.Internal.RetryAction`1.PerformAction(TInput input) +110
   System.Data.Entity.Internal.LazyInternalContext.InitializeDatabaseAction(Action`1 action) +185
   System.Data.Entity.Internal.LazyInternalContext.InitializeDatabase() +73
   System.Data.Entity.Internal.InternalContext.GetEntitySetAndBaseTypeForType(Type entityType) +28
   System.Data.Entity.Internal.Linq.InternalSet`1.Initialize() +52
   System.Data.Entity.Internal.Linq.InternalSet`1.get_InternalContext() +15
   System.Data.Entity.Infrastructure.DbQuery`1.System.Linq.IQueryable.get_Provider() +37
   System.Linq.Queryable.OrderBy(IQueryable`1 source, Expression`1 keySelector) +66
   Nop.Services.Configuration.SettingService.<GetAllSettings>b__1() +196
   Nop.Core.Caching.CacheExtensions.Get(ICacheManager cacheManager, String key, Int32 cacheTime, Func`1 acquire) +93
   Nop.Services.Configuration.SettingService.GetAllSettings() +85
   Nop.Services.Configuration.SettingService.GetSettingByKey(String key, T defaultValue) +103
   Nop.Services.Configuration.ConfigurationProvider`1.<BuildConfiguration>b__3(PropertyInfo prop) +127
   System.Linq.WhereSelectArrayIterator`2.MoveNext() +66
   System.Linq.WhereSelectEnumerableIterator`2.MoveNext() +85
   System.Collections.Generic.List`1..ctor(IEnumerable`1 collection) +381
   System.Linq.Enumerable.ToList(IEnumerable`1 source) +58
   Nop.Services.Configuration.ConfigurationProvider`1.BuildConfiguration() +1374
   lambda_method(Closure , Object[] ) +72
   Autofac.Core.Activators.Reflection.ConstructorParameterBinding.Instantiate() +212
10 years ago
I ran into the same issue, have not been able to resolve. Please let me know if you found a solution.
10 years ago
gonze1 wrote:
I ran into the same issue, have not been able to resolve. Please let me know if you found a solution.


Since i had moved a live cart to a test server, the settings in the database for that cart had force ssl and also force www before any url. Also under Store settings i still had the domain info for that site which was now difrent in the test server. Once i noticed this and updated the database it all started working.
9 years ago
I got this issue several times. In order to fix it you should delete bin folder and rebuild the solution again. Bin folder is located at \Presentation\Nop.Web\bin
9 years ago
For the future searchers:

In my case, it was an expired database password.  It would be nice if it could provide additional information in the error.

Thank you!
9 years ago
You try change settings.txt file:
DataConnectionString: Data Source=localhost/IP;Initial Catalog=DBName;Integrated Security=False;Persist Security Info=False;User ID=DBUser;Password=DBPass;MultipleActiveResultSets=True
9 years ago
For the future searchers, also:

In my case, it was because production database hadn't got activated the option:

[] Sql Server and Windows Authentication  mode

Nice headache until I´ve found it ...


Thank you!
8 years ago
I had the same issue, same error, its because with your database is something wrong. (Connection is not working, so check connection string). In my case, I had expired password for database
8 years ago
In my case I need config application pool for nopcomerce

my connection string
DataProvider: sqlserver
DataConnectionString: Data Source=.;Initial Catalog=nopcommerce370;Integrated Security=True;Persist Security Info=False

I need set Application Pool Identity to user has access right to db
Check the image to details.

8 years ago
In addition to above post, we have been encountering this several times, please see below for some actions:

1. Clean or rebuild your solution/web before publishing.
2. check app_data/settings for the connectionstring information if correct.
3. check if the database credential is same as the settings on your connection string.
4. check if the AppPool has permission to access the database server.
5. check if you can ping the database server, or port is accessible by the webserver.

Regards,
Bryan
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.