2.00 Beta Install Error - new rev existing db

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.
12 years ago
I installed beta the other day. Created a new Database in SSMS, ran the web thru VS2010.
During install, I checked option to create sample data, pointed to new database, and Install went well.

I just downloaded the latest rev c35e35cdb984.
Ran the web thru VS2010.
During install, I left check box to create sample data unchecked, pointed to existing database used above.  This error occurred:

Setup failed: System.InvalidOperationException:
Sequence contains more than one element at System.Linq.Enumerable.Single[TSource](IEnumerable`1 source)
at System.Data.Objects.ELinq.ObjectQueryProvider.<GetElementFunction>b__3[TResult](IEnumerable`1 sequence)
at System.Data.Objects.ELinq.ObjectQueryProvider.ExecuteSingle[TResult](IEnumerable`1 query, Expression queryRoot)
at System.Data.Objects.ELinq.ObjectQueryProvider.System.Linq.IQueryProvider.Execute[S](Expression expression)
at System.Data.Entity.Internal.Linq.DbQueryProvider.Execute[TResult](Expression expression)
at System.Linq.Queryable.Single[TSource](IQueryable`1 source)
at Nop.Services.Installation.InstallationService.InstallSettings()
in C:\...\nopCommerce_c35e35cdb984\src\Libraries\Nop.Services\Installation\InstallationService.cs:line 4476
at Nop.Services.Installation.InstallationService.InstallData(String defaultUserEmail, String defaultUserPassword, Boolean installSampleData)
in C:\...\nopCommerce_c35e35cdb984\src\Libraries\Nop.Services\Installation\InstallationService.cs:line 9034
at Nop.Web.Controllers.InstallController.Index(InstallModel model)
in C:\...\nopCommerce_c35e35cdb984\src\Presentation\Nop.Web\Controllers\InstallController.cs:line 378


I'm not sure if this problem is specific to beta in general, or something in the new rev caused it.
12 years ago
This exception is caused by trying to install to a database that has already been installed (i.e. already has tables).

To use an existing database, you only need to copy the Settings.txt file to the App_Data folder before you start the application. The installer runs if there is no Settings.txt file in this folder. However, you should create a new empty database and run install for the change set (c35e35cdb984) as some of the changes are new/updated locale string resources that won't exist in the old database or you can insert/update them manually. There is no upgrade script between change sets.

.
12 years ago
OK Thanks.
But, is this the normal procedure, or just for Beta?
(The Install screen seems to imply that you can use an existing database considering the checkbox for creating sample data)
12 years ago
I also had to copy the InstalledPlugins.txt file to the App_Data folder
(otherwise I received a null ref exception  on
Libraries\Nop.Services\Tax\TaxService.cs
var calculateTaxResult = activeTaxProvider.GetTaxRate(calculateTaxRequest);
)

I'm still not clear on this -  is this the normal procedure, or just for Beta?
12 years ago
New York wrote:
I also had to copy the InstalledPlugins.txt file to the App_Data folder
(otherwise I received a null ref exception  on
Libraries\Nop.Services\Tax\TaxService.cs
var calculateTaxResult = activeTaxProvider.GetTaxRate(calculateTaxRequest);
)

I'm still not clear on this -  is this the normal procedure, or just for Beta?


Did you do something else to make the null ref go away? I am getting the same exception but copying InstalledPlugins.txt to App_Data folder didn't fix it for me. Thanks.
12 years ago
I don't recall doing anything else.  Not sure if it matters, but I'm not using the .bat files.  I build and run in VS2010.
I'll probably try again tomorrow as I'll be downloading the latest revision.
12 years ago
New York wrote:
Not sure if it matters, but I'm not using the .bat files.  I build and run in VS2010.

It matters. https://www.nopcommerce.com/boards/t/10500/publishing-20.aspx
12 years ago
I had the same problem. I am running Win 2008 R2 64 +MS SQL 2008 R2 64 with Advanced Services. Installing 2.0 from compiled package from scratch.

First time round I forgot to make the installation dir writable. I made it writable and started attempt 2.

Second time round I hit the tables already there problem. Created new db and started attempt 3. Failed so I created a new database again ("maybe something went wrong randomly") and proceeded to attemp 3.

Attempt 3 failed with tables already there problem. OK - so I know it's something different or the installer is screwed. I created yet another clean database, copied the files to new directory, rebound iis7 to new directory and proceded to attemp 4 ..

Attemp 4 SUCCESS.. YUPPPI I've got myself a BETA :-)

Conclusion:
Installer is not too good about cleaning up after itself if something goes wrong. Felt like installer remembered i gave him and different database earlier and used that one instead of the one I instructed him second time round.

Suggestions (to the dev team):
-> pre-installation system check to check for folder writeability
-> removal of database configuration on failed install
11 years ago
Right.
if the first attempt gives you an error for any reason..(let's say you type the wrong connection string or try to install NopCommerce on top of a existing database that already has data from a previous NopCommerce version and get "Setup failed: Sequence contains more than one element""

you need to:

1-in Visual Studio, do a Clean Solution
2-Create a new Database and use it

then NopCommerce will install as expected

This applies for version 2.6 as well

Regards
11 years ago
Hi,

Just to add me view on this. I don't think you need to create a new db at all. I think copying the settings.txt and (if applicable) plugins.txt to the right directory on the webserver (app_data). Then you don't need to go through the installer whatsoever, it will only prompt the installer should you not have the correct files in app_data.

I people get this because they use the .bat files rather than understanding what they're uploading. Using the .bat files will cause all kinds of issues - they're great for the non-edited installation of Nop (and I mean really helpful, good job guys) but if you're going to edit Nop from the source then you shouldn't be using the .bat files.

HTH's
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.