Install fails because 'magelia_user' already exists

Jul 25, 2012 at 12:48 AM

My initial install made it past the db creation, but failed because permissions on dir weren't set, so the web.config update failed (update connectionstring).  I set permissions on dir to write, removed all tables/indexes/triggers; but I'm unable to remove the 'magelia_user'

DELETE FROM sys.sysusers WHERE name = 'magelia_user'

 Ad hoc updates to system catalogs are not allowed.

 

Database connectivity successfully tested.
	Server version is 10.50.2772.
Database 'SQL2008R2_660931_noxxcafe' successfully created
ERROR : System.Data.SqlClient.SqlException (0x80131904): User, group, or role 'magelia_user' already exists in the current database.
   at System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection)
   at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning()
   at System.Data.SqlClient.TdsParser.Run(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj)
   at System.Data.SqlClient.SqlCommand.RunExecuteNonQueryTds(String methodName, Boolean async)
   at System.Data.SqlClient.SqlCommand.InternalExecuteNonQuery(DbAsyncResult result, String methodName, Boolean sendToPipe)
   at System.Data.SqlClient.SqlCommand.ExecuteNonQuery()
   at Magelia.WebStore.Setup.DatabaseInstallationStep.RunCommands(IEnumerable`1 commands, SqlConnection conn, SqlParameter[] parameters) in c:\Builds\3\MageliaCommerceRuntime\Release-2.0\Sources\Branches\Releases\2.0\src\Magelia.WebStore.Runtime\Setup\DatabaseInstallationStep.cs:line 163
   at Magelia.WebStore.Setup.DatabaseInstallationStep.RunCommands(IEnumerable`1 commands, SqlParameter[] parameters) in c:\Builds\3\MageliaCommerceRuntime\Release-2.0\Sources\Branches\Releases\2.0\src\Magelia.WebStore.Runtime\Setup\DatabaseInstallationStep.cs:line 133
   at Magelia.WebStore.Setup.DatabaseInstallationStep.RunScript(String fileName, Nullable`1& position, Nullable`1 maxLineCount, Func`2 lineFilter, SqlParameter[] parameters) in c:\Builds\3\MageliaCommerceRuntime\Release-2.0\Sources\Branches\Releases\2.0\src\Magelia.WebStore.Runtime\Setup\DatabaseInstallationStep.cs:line 111
   at Magelia.WebStore.Setup.CreateDatabaseInstallationStep.CreateRoles() in c:\Builds\3\MageliaCommerceRuntime\Release-2.0\Sources\Branches\Releases\2.0\src\Magelia.WebStore.Runtime\Setup\CreateDatabaseInstallationStep.cs:line 157
   at Magelia.WebStore.Setup.CreateDatabaseInstallationStep.ExecuteInternal() in c:\Builds\3\MageliaCommerceRuntime\Release-2.0\Sources\Branches\Releases\2.0\src\Magelia.WebStore.Runtime\Setup\CreateDatabaseInstallationStep.cs:line 46
   at Magelia.WebStore.Setup.InstallationStep.Execute() in c:\Builds\3\MageliaCommerceRuntime\Release-2.0\Sources\Branches\Releases\2.0\src\Magelia.WebStore.Runtime\Setup\InstallationStep.cs:line 26

Jul 25, 2012 at 1:22 AM

nevermind, I just reset/wiped out the entire database... install worked just fine.

Coordinator
Jul 25, 2012 at 9:47 AM

Hi,

Glad to hear that it finally works :-)

During the setup, we don't check if the role already exist. I just created a new bug in our internal system to look if there is a way to bypass this step. The correct script to drop the magelia_user role is the following :

USE [Magelia_WebStore] -- replace it with the name of your database
DROP ROLE [magelia_user]

For the web.config permission issue, when we encounter this, we add a message to explain what to change in the web.config. If you manually edit the web.config, you don't have to add the correct permission. Furthermore, after correcting the issue (by adding the correct permission or by editing the web.config file) you could retry the last step, it will automatically retry and go to the next step :-)

By the way, for information, if you use the WebDeploy package or the Magelia.WebStore.Setup.exe (which rely on Web Platform Installer which rely on the WebDeploy package), package will automatically add the correct permissions where needed (web.config, App_Data and medias folder).

If you need more explanations, feel free to ask, we will be happy to help.

Thanks for using our solution.

Cyril DURAND 

Jul 25, 2012 at 3:34 PM
Thanks for the quick reply.
Yes, at first I just modified the web.config by adding in the connectionstring; but the install process still wasn’t complete. I think there are a few steps after the web.config update that needed to be run, and I didn’t know how to run them without starting from the beginning. hence I kept running into the ‘user already exists’.
anyway, I’m up and running. love it.
thanks again,
-bill
From: [email removed]
Sent: Wednesday, July 25, 2012 1:48 AM
To: [email removed]
Subject: Re: Install fails because 'magelia_user' already exists [MageliaWebStore:388474]

From: cdurand

Hi,

Glad to hear that it finally works :-)

During the setup, we don't check if the role already exist. I just created a new bug in our internal system to look if there is a way to bypass this step. The correct script to drop the magelia_user role is the following :

USE [Magelia_WebStore] -- replace it with the name of your database
DROP ROLE [magelia_user]

For the web.config permission issue, when we encounter this, we add a message to explain what to change in the web.config. If you manually edit the web.config, you don't have to add the correct permission. Furthermore, after correcting the issue (by adding the correct permission or by editing the web.config file) you could retry the last step, it will automatically retry and go to the next step :-)

By the way, for information, if you use the WebDeploy package or the Magelia.WebStore.Setup.exe (which rely on Web Platform Installer which rely on the WebDeploy package), package will automatically add the correct permissions where needed (web.config, App_Data and medias folder).

If you need more explanations, feel free to ask, we will be happy to help.

Thanks for using our solution.

Cyril DURAND

Jul 26, 2012 at 12:58 AM
Hi,

I installed Magelia fine on my dev server, but the install fails on my QA server in the "Application Start" step.
Looks like a .dll is missing, but I simply copied the entire structure from the "Magelia.WebStore.2.0.333.binaries.zip"
any idea on which .dll it might be?
Thanks (again)

ERROR : System.Reflection.ReflectionTypeLoadException: Unable to load one or more of the requested types. Retrieve the LoaderExceptions property for more information.
   at System.Reflection.RuntimeModule.GetTypes(RuntimeModule module)
   at System.Reflection.RuntimeModule.GetTypes()
   at System.Reflection.Assembly.GetTypes()
   at Autofac.Features.Scanning.ScanningRegistrationExtensions.b__5(Assembly a)
   at System.Linq.Enumerable.d__14`2.MoveNext()
   at System.Linq.Enumerable.WhereEnumerableIterator`1.MoveNext()
   at Autofac.Features.Scanning.ScanningRegistrationExtensions.ScanAssemblies(IEnumerable`1 assemblies, IComponentRegistry cr, IRegistrationBuilder`3 rb)
   at Autofac.Features.Scanning.ScanningRegistrationExtensions.<>c__DisplayClass1.b__0(IComponentRegistry cr)
   at Autofac.ContainerBuilder.Build(IComponentRegistry componentRegistry, Boolean excludeDefaultModules)
   at Autofac.ContainerBuilder.Build(ContainerBuildOptions options)
   at Magelia.WebStore.ETL.ExportManager..ctor() in c:\Builds\3\MageliaCommerceRuntime\Release-2.0\Sources\Branches\Releases\2.0\src\Magelia.WebStore.Runtime\ETL\ExportManager.cs:line 17
   at Magelia.WebStore.Runtime.SellerContext..ctor(Application application, Seller seller) in c:\Builds\3\MageliaCommerceRuntime\Release-2.0\Sources\Branches\Releases\2.0\src\Magelia.WebStore.Runtime\Runtime\SellerContext.cs:line 25
   at Magelia.WebStore.Application.InitializeContexts(WebStoreEntities entities) in c:\Builds\3\MageliaCommerceRuntime\Release-2.0\Sources\Branches\Releases\2.0\src\Magelia.WebStore.Runtime\Application.cs:line 654
   at Magelia.WebStore.Application.InitializeApplication() in c:\Builds\3\MageliaCommerceRuntime\Release-2.0\Sources\Branches\Releases\2.0\src\Magelia.WebStore.Runtime\Application.cs:line 603
   at Magelia.WebStore.Application.StartInternal(DirectoryInfo currentDirectory) in c:\Builds\3\MageliaCommerceRuntime\Release-2.0\Sources\Branches\Releases\2.0\src\Magelia.WebStore.Runtime\Application.cs:line 481
   at Magelia.WebStore.Application.Start(DirectoryInfo currentDirectory, Action`1 preInitializer) in c:\Builds\3\MageliaCommerceRuntime\Release-2.0\Sources\Branches\Releases\2.0\src\Magelia.WebStore.Runtime\Application.cs:line 174
   at Magelia.WebStore.Application.Start(DirectoryInfo currentDirectory) in c:\Builds\3\MageliaCommerceRuntime\Release-2.0\Sources\Branches\Releases\2.0\src\Magelia.WebStore.Runtime\Application.cs:line 107
   at Magelia.WebStore.Setup.StartApplicationInstallationStep.ExecuteInternal() in c:\Builds\3\MageliaCommerceRuntime\Release-2.0\Sources\Branches\Releases\2.0\src\Magelia.WebStore.Runtime\Setup\StartApplicationInstallationStep.cs:line 15
   at Magelia.WebStore.Setup.InstallationStep.Execute() in c:\Builds\3\MageliaCommerceRuntime\Release-2.0\Sources\Branches\Releases\2.0\src\Magelia.WebStore.Runtime\Setup\InstallationStep.cs:line 26


From: [email removed]
To: [email removed]
Date: Wed, 25 Jul 2012 01:48:01 -0700
Subject: Re: Install fails because 'magelia_user' already exists [MageliaWebStore:388474]

From: cdurand
Hi,
Glad to hear that it finally works :-)
During the setup, we don't check if the role already exist. I just created a new bug in our internal system to look if there is a way to bypass this step. The correct script to drop the magelia_user role is the following :
USE [Magelia_WebStore] -- replace it with the name of your database
DROP ROLE [magelia_user]
For the web.config permission issue, when we encounter this, we add a message to explain what to change in the web.config. If you manually edit the web.config, you don't have to add the correct permission. Furthermore, after correcting the issue (by adding the correct permission or by editing the web.config file) you could retry the last step, it will automatically retry and go to the next step :-)
By the way, for information, if you use the WebDeploy package or the Magelia.WebStore.Setup.exe (which rely on Web Platform Installer which rely on the WebDeploy package), package will automatically add the correct permissions where needed (web.config, App_Data and medias folder).
If you need more explanations, feel free to ask, we will be happy to help.
Thanks for using our solution.
Cyril DURAND
Read the full discussion online.
To add a post to this discussion, reply to this email (MageliaWebStore@discussions.codeplex.com)
To start a new discussion for this project, email MageliaWebStore@discussions.codeplex.com
You are receiving this email because you subscribed to this discussion on CodePlex. You can unsubscribe on CodePlex.com.
Please note: Images and attachments will be removed from emails. Any posts to this discussion will also be available online at CodePlex.com
Coordinator
Jul 26, 2012 at 1:56 AM

Hi,

Common causes for this error is the lack of ASP.net MVC 3.0. Could you install it on the QA server and try again ?

Cyril DURAND