Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Greg Berlin 818 posts 634 karma points
    Oct 17, 2016 @ 05:38
    Greg Berlin
    1

    Simple 301 Redirect calling MigrationRunner, throwing error

    A client of ours is experiencing some instability on one of their Umbraco sites. It's running 7.4.3, with Simple 301 redirect module.

    There is an error that occurs quite regularly (logged in Umbraco log), in which it appears the Simple301 module is calling Umbraco.Core.Persistence.Migrations.MigrationRunner.Execute(), and throwing the following exception:

    2016-10-13 11:17:43,121 [P17024/D3/T90] ERROR Umbraco.Core.Persistence.Migrations.MigrationRunner - Error running Redirects migration
    System.Data.SqlClient.SqlException (0x80131904): Column names in each table must be unique. Column name 'IsRegex' in table 'Redirects' is specified more than once.
       at System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection, Action`1 wrapCloseInAction)
       at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj, Boolean callerHasConnectionLock, Boolean asyncClose)
       at System.Data.SqlClient.TdsParser.TryRun(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj, Boolean& dataReady)
       at System.Data.SqlClient.SqlCommand.RunExecuteNonQueryTds(String methodName, Boolean async, Int32 timeout, Boolean asyncWrite)
       at System.Data.SqlClient.SqlCommand.InternalExecuteNonQuery(TaskCompletionSource`1 completion, String methodName, Boolean sendToPipe, Int32 timeout, Boolean asyncWrite)
       at System.Data.SqlClient.SqlCommand.ExecuteNonQuery()
       at Umbraco.Core.Persistence.PetaPocoCommandExtensions.<>c__DisplayClass1.<ExecuteNonQueryWithRetry>b__0()
       at Umbraco.Core.Persistence.FaultHandling.RetryPolicy.ExecuteAction[TResult](Func`1 func)
       at Umbraco.Core.Persistence.Database.Execute(String sql, Object[] args)
       at Umbraco.Core.Persistence.Migrations.MigrationRunner.ExecuteMigrations(IMigrationContext context, Database database)
       at Umbraco.Core.Persistence.Migrations.MigrationRunner.Execute(Database database, DatabaseProviders databaseProvider, Boolean isUpgrade)
       at Simple301.Core.MyApplication.HandleMigrations()
    ClientConnectionId:6164411c-be82-49b8-9caa-cd55bfdd9afb
    Error Number:2705,State:4,Class:16
    

    and...

    2016-10-13 11:17:43,121 [P17024/D3/T90] ERROR Umbraco.Core.Persistence.UmbracoDatabase - Database exception occurred
    System.Data.SqlClient.SqlException (0x80131904): Column names in each table must be unique. Column name 'IsRegex' in table 'Redirects' is specified more than once.
       at System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection, Action`1 wrapCloseInAction)
       at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj, Boolean callerHasConnectionLock, Boolean asyncClose)
       at System.Data.SqlClient.TdsParser.TryRun(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj, Boolean& dataReady)
       at System.Data.SqlClient.SqlCommand.RunExecuteNonQueryTds(String methodName, Boolean async, Int32 timeout, Boolean asyncWrite)
       at System.Data.SqlClient.SqlCommand.InternalExecuteNonQuery(TaskCompletionSource`1 completion, String methodName, Boolean sendToPipe, Int32 timeout, Boolean asyncWrite)
       at System.Data.SqlClient.SqlCommand.ExecuteNonQuery()
       at Umbraco.Core.Persistence.PetaPocoCommandExtensions.<>c__DisplayClass1.<ExecuteNonQueryWithRetry>b__0()
       at Umbraco.Core.Persistence.FaultHandling.RetryPolicy.ExecuteAction[TResult](Func`1 func)
       at Umbraco.Core.Persistence.Database.Execute(String sql, Object[] args)
    ClientConnectionId:6164411c-be82-49b8-9caa-cd55bfdd9afb Error Number:2705,State:4,Class:16
    

    After this happens a few times, the app pool crashes and recycles. I'm not sure if this is a cause of the instability, but it definitely shouldn't be happening. I haven't dug into the code yet to figure out why this is happening, and will do that if I get more time to work on this, but thought maybe somebody out there has seen this before and can advise?

    Cheers Greg

  • Greg Berlin 818 posts 634 karma points
    Oct 19, 2016 @ 22:54
    Greg Berlin
    0

    Update: I just noticed that another client using this same module has the same errors being thrown. Their site is not crashing (so it's probably a red herring for the unstable site), but still - why is this error even there?

  • Wade Kallhoff 5 posts 256 karma points
    Jan 06, 2017 @ 20:10
    Wade Kallhoff
    0

    Greg,

    The exception throwing was a bug with the migration logic put in place to update existing 301 installs to support Regex. This should be resolved with the latest version of the package (1.0.9)

Please Sign in or register to post replies

Write your reply to:

Draft