Inhalte aufrufen

Profilbild

Broken Installation


  • Bitte melden Sie sich an, um eine Antwort zu verfassen.
7 Antworten zu diesem Thema

#1 net4u

net4u

    Advanced Member

  • Members
  • PunktPunktPunkt
  • 48 Beiträge

Geschrieben: 25 March 2015 - 10:38

Hi,

I have a test installation that is mainly based on a Git download from around the start of the month (I don't remember the exact date but is around 2-3 weeks old).

Today I downloaded a new one, and I made some minor changes at registration page, and I added a nearly empty plugin. I build it and instead of trying on my machine, I published on my test server over the existing one (shame on me).

When I try to access the shop I have an exception that say :

 

Column names in each table must be unique. Column name 'OrderShippingTaxRate' in table 'dbo.Order' is specified more than once. 

Exception Details: System.Data.SqlClient.SqlException: Column names in each table must be unique. Column name 'OrderShippingTaxRate' in table 'dbo.Order' is specified more than once.

[SqlException (0x80131904): Column names in each table must be unique. Column name 'OrderShippingTaxRate' in table 'dbo.Order' is specified more than once.]
   System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection, Action`1 wrapCloseInAction) +388
   System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj, Boolean callerHasConnectionLock, Boolean asyncClose) +717
   System.Data.SqlClient.TdsParser.TryRun(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj, Boolean& dataReady) +4515
   System.Data.SqlClient.SqlCommand.RunExecuteNonQueryTds(String methodName, Boolean async, Int32 timeout, Boolean asyncWrite) +1387
   System.Data.SqlClient.SqlCommand.InternalExecuteNonQuery(TaskCompletionSource`1 completion, String methodName, Boolean sendToPipe, Int32 timeout, Boolean asyncWrite) +533
   System.Data.SqlClient.SqlCommand.ExecuteNonQuery() +287
   System.Data.Entity.Infrastructure.Interception.InternalDispatcher`1.Dispatch(TTarget target, Func`3 operation, TInterceptionContext interceptionContext, Action`3 executing, Action`3 executed) +208
   System.Data.Entity.Infrastructure.Interception.DbCommandDispatcher.NonQuery(DbCommand command, DbCommandInterceptionContext interceptionContext) +438
   System.Data.Entity.Migrations.DbMigrator.ExecuteSql(DbTransaction transaction, MigrationStatement migrationStatement, DbInterceptionContext interceptionContext) +202
   System.Data.Entity.Migrations.DbMigrator.ExecuteStatementsInternal(IEnumerable`1 migrationStatements, DbTransaction transaction, DbInterceptionContext interceptionContext) +98
   System.Data.Entity.Migrations.DbMigrator.ExecuteStatementsInternal(IEnumerable`1 migrationStatements, DbConnection connection) +780
   System.Data.Entity.SqlServer.<>c__DisplayClass1.<Execute>b__0() +15
   System.Data.Entity.SqlServer.DefaultSqlExecutionStrategy.Execute(Func`1 operation) +263
   System.Data.Entity.Migrations.DbMigrator.ExecuteStatements(IEnumerable`1 migrationStatements, DbTransaction existingTransaction) +374
   System.Data.Entity.Migrations.DbMigrator.ExecuteOperations(String migrationId, XDocument targetModel, IEnumerable`1 operations, IEnumerable`1 systemOperations, Boolean downgrading, Boolean auto) +1170
   System.Data.Entity.Migrations.DbMigrator.ApplyMigration(DbMigration migration, DbMigration lastMigration) +748
   System.Data.Entity.Migrations.DbMigrator.Upgrade(IEnumerable`1 pendingMigrations, String targetMigrationId, String lastMigrationId) +169
   System.Data.Entity.Migrations.DbMigrator.EnsureDatabaseExists(Action mustSucceedToKeepDatabase) +1134
   SmartStore.Data.Setup.DbSeedingMigrator`1.RunPendingMigrations(TContext context) +747
...

After this I try also from Visual Studio, it proposed to install (btw, where is the flag that say that is already installed) and at the next step, I have a similar exception.

I wonder what I broke? And what can I do to recover (it is for test it's true but I filled a bunch of products in catalogue).



#2 Marcus Gesing

Marcus Gesing

    SmartStore AG

  • Administrators
  • 3799 Beiträge

Geschrieben: 25 March 2015 - 12:10

Looks like a migration mess. I would try to solve it with a migration downgrade
update-database -TargetMigration V211
via Package Manager Console.

  • net4u gefällt das

Marcus Gesing

Smartstore AG


#3 net4u

net4u

    Advanced Member

  • Members
  • PunktPunktPunkt
  • 48 Beiträge

Geschrieben: 25 March 2015 - 13:34

On short it gives this:
No migrations configuration type was found in the assembly 'SmartStore.Web'. (In Visual Studio you can use the Enable-Migrations command from Package Manager Console to add a migrations configuration).

 

L.E.

But I don't understand the error meaning that if don't understand where is the name of column duplicated?! In model?


Bearbeitet von net4u, 25 March 2015 - 13:39,


#4 Marcus Gesing

Marcus Gesing

    SmartStore AG

  • Administrators
  • 3799 Beiträge

Geschrieben: 25 March 2015 - 14:56

No, in SmartStore.Data\Migrations\201502191643156_QtyUnitsAndOrderItemTaxRate.cs.
Select Data and not Web project to downgrade.
You have to understand Entity Framework Migrations.

  • net4u gefällt das

Marcus Gesing

Smartstore AG


#5 net4u

net4u

    Advanced Member

  • Members
  • PunktPunktPunkt
  • 48 Beiträge

Geschrieben: 25 March 2015 - 16:59

Thank you,

 

It was restored.

btw, what is the best practice for updating an existing store, without messing up the database?



#6 Murat Cakir

Murat Cakir

    SmartStore AG

  • Administrators
  • 1118 Beiträge

Geschrieben: 25 March 2015 - 18:23

Actually there is nothing special to consider when updating. We've built a sophisticated database migrator that does it's job silently in the background reliably in most cases - without bothering you. But in unstable releases there can be situations where the code based migration definitions are not mature enough to successfully update from previous versions. However this is not the norm. We call it: shit happens  ;)


  • net4u gefällt das

Murat Cakir
SmartStore AG


#7 net4u

net4u

    Advanced Member

  • Members
  • PunktPunktPunkt
  • 48 Beiträge

Geschrieben: 26 March 2015 - 21:32

I wonder if is not a good idea to revert to official 2.1.1 build? After solving the issue that I encountered, today I continued with my efforts to write the payment plugin. I have some success and I noticed issues when I admin console, I want to go to plugins management, more precisely "Reload List of Plugins". Here the store crash sometimes with a exception related to SmartStore.Licensing (only when hit Reload). If is not crashed, anyway my plugin is never available for install.



#8 Marcus Gesing

Marcus Gesing

    SmartStore AG

  • Administrators
  • 3799 Beiträge

Geschrieben: 27 March 2015 - 12:08

The licensing component is under construction at the moment. You can ignore these exceptions.


Marcus Gesing

Smartstore AG