Products

Solutions

Resources

Partners

Community

Blog

About

QA

Ideas Test

New Community Website

Ordinarily, you'd be at the right spot, but we've recently launched a brand new community website... For the community, by the community.

Yay... Take Me to the Community!

Welcome to the DNN Community Forums, your preferred source of online community support for all things related to DNN.
In order to participate you must be a registered DNNizen

HomeHomeGetting StartedGetting StartedInstalling DNN ...Installing DNN ...Cannot Upgrade to 07.04.00Cannot Upgrade to 07.04.00
Previous
 
Next
New Post
2/7/2015 11:09 AM
 

Hi,

I am having a SQL issue when upgrading, please help:

Upgrade

Current Version - 07.03.04
Upgrade - Version 07.04.00
25% ERROR occured - System.Data.SqlClient.SqlException (0x80131904): Cannot insert duplicate key row in object 'dbo.CoreMessaging_NotificationTypeActions' with unique index 'IX_CoreMessaging_NotificationTypeActions_Type'. The duplicate key value is (15, 1). The statement has been terminated. at System.Data.SqlClient.SqlConnection. (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 DotNetNuke.Data.SqlDataProvider.ExecuteScriptInternal(String connectionString, String script) ClientConnectionId:29e8a5ca-cb0a-41a6-9a98-d36362394fa4 Error Number:2601,State:1,Class:14 /* Remove Review action and add Approve, Reject */ DECLARE @NotificationTypeId INT SELECT @NotificationTypeId = NotificationTypeId FROM dbo.CoreMessaging_NotificationTypes WHERE Name = 'ContentWorkflowNotification' IF @NotificationTypeId IS NOT NULL BEGIN /* Delete Review notification action added int 7.3.0 */ DELETE FROM dbo.CoreMessaging_NotificationTypeActions WHERE NotificationTypeId = @NotificationTypeId AND NameResourceKey = 'Review' /* Add Approve notification action */ INSERT INTO dbo.CoreMessaging_NotificationTypeActions( [NotificationTypeID], [NameResourceKey], [DescriptionResourceKey], [ConfirmResourceKey], [Order], [APICall], [CreatedByUserID], [CreatedOnDate], [LastModifiedByUserID], [LastModifiedOnDate]) VALUES( @NotificationTypeId, 'Approve', 'Approve', NULL, 1, 'DesktopModules/InternalServices/API/ContentWorkflowService/Approve', -1, GETDATE(), -1, GETDATE() ) /* Add Reject notification action */ INSERT INTO dbo.CoreMessaging_NotificationTypeActions( [NotificationTypeID], [NameResourceKey], [DescriptionResourceKey], [ConfirmResourceKey], [Order], [APICall], [CreatedByUserID], [CreatedOnDate], [LastModifiedByUserID], [LastModifiedOnDate]) VALUES( @NotificationTypeId, 'Reject', 'Reject', NULL, 1, 'DesktopModules/InternalServices/API/ContentWorkflowService/Reject', -1, GETDATE(), -1, GETDATE() ) END System.Data.SqlClient.SqlException (0x80131904): Cannot insert duplicate key row in object 'dbo.CoreMessaging_NotificationTypeActions' with unique index 'IX_CoreMessaging_NotificationTypeActions_Type'. The duplicate key value is (24, 1). The statement has been terminated. at System.Data.SqlClient.SqlConnection. (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 DotNetNuke.Data.SqlDataProvider.ExecuteScriptInternal(String connectionString, String script) ClientConnectionId:29e8a5ca-cb0a-41a6-9a98-d36362394fa4 Error Number:2601,State:1,Class:14 /* Add action to Start Workflow Notification */ DECLARE @NotificationStartWorkflowTypeId INT SELECT @NotificationStartWorkflowTypeId = NotificationTypeId FROM dbo.CoreMessaging_NotificationTypes WHERE Name = 'ContentWorkflowStartWorkflowNotification' IF @NotificationStartWorkflowTypeId IS NOT NULL BEGIN /* Add Submit notification action */ /* also uses the existing Approve method */ INSERT INTO dbo.CoreMessaging_NotificationTypeActions( [NotificationTypeID], [NameResourceKey], [DescriptionResourceKey], [ConfirmResourceKey], [Order], [APICall], [CreatedByUserID], [CreatedOnDate], [LastModifiedByUserID], [LastModifiedOnDate]) VALUES( @NotificationStartWorkflowTypeId, 'Submit', 'Submit', NULL, 1, 'DesktopModules/InternalServices/API/ContentWorkflowService/Approve', -1, GETDATE(), -1, GETDATE() ) /* Add Discard notification action */ /* also uses the existing Reject method */ INSERT INTO dbo.CoreMessaging_NotificationTypeActions( [NotificationTypeID], [NameResourceKey], [DescriptionResourceKey], [ConfirmResourceKey], [Order], [APICall], [CreatedByUserID], [CreatedOnDate], [LastModifiedByUserID], [LastModifiedOnDate]) VALUES( @NotificationStartWorkflowTypeId, 'Discard', 'Discard', NULL, 1, 'DesktopModules/InternalServices/API/ContentWorkflowService/Reject', -1, GETDATE(), -1, GETDATE() ) END System.Data.SqlClient.SqlException (0x80131904): Column 'dbo.EventLog.LogEventID' is not the same data type as referencing column 'ExceptionEvents.LogEventID' in foreign key 'FK_ExceptionEvents_LogEventId'. Could not create constraint or index. See previous errors. at System.Data.SqlClient.SqlConnection. (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 DotNetNuke.Data.SqlDataProvider.ExecuteScriptInternal(String connectionString, String script) ClientConnectionId:29e8a5ca-cb0a-41a6-9a98-d36362394fa4 Error Number:1778,State:0,Class:16 IF NOT EXISTS (SELECT * FROM sys.foreign_keys WHERE name = 'FK_ExceptionEvents_LogEventId' AND parent_object_id = OBJECT_ID(N'dbo.[ExceptionEvents]')) BEGIN ALTER TABLE dbo.[ExceptionEvents] WITH CHECK ADD CONSTRAINT [FK_ExceptionEvents_LogEventId] FOREIGN KEY([LogEventID]) REFERENCES dbo.[EventLog] ([LogEventID]) ON DELETE CASCADE END

 
New Post
2/8/2015 10:16 PM
 
These parts of the script are not re-runnable, did you manage to run the same script before?

Cheers from Germany,
Sebastian Leupold

dnnWerk - The DotNetNuke Experts   German Spoken DotNetNuke User Group

Speed up your DNN Websites with TurboDNN
 
New Post
2/9/2015 11:04 AM
 

Hi Sebastian,

Thanks. Did not run it before (intentionally), but I noticed it puts 2 new rows into CoreMessaging_NotificationTypeActions successfully which are related to the new workflow versioning and then it crashes because of a duplicate index called 'IX_CoreMessaging_NotificationTypeActions_Type'.  This index consists of 4 unique combinations of variables. Maybe deleting this index will let me finish with the upgrade. For now I reverted to 07.03.04. In my opinion this script should check before inserting new rows. I don't even know the name of that script, do you know where it is located so that I can maybe improve it?

 
New Post
2/9/2015 11:51 AM
 
the upgrade executes /providers/dataproviders/sqldataprovider/07.04.00.sqldataprovider script

Cheers from Germany,
Sebastian Leupold

dnnWerk - The DotNetNuke Experts   German Spoken DotNetNuke User Group

Speed up your DNN Websites with TurboDNN
 
New Post
2/9/2015 2:36 PM
 

Hi Sebastian,

Thanks again, I was able to fix the duplicate index problem by making 2 changes to 07.04.00.sqldataprovider. See comments /* Fred.. */   below:

/* Remove Review action and add Approve, Reject */
DECLARE @NotificationTypeId INT
SELECT @NotificationTypeId = NotificationTypeId
    FROM    {databaseOwner}{objectQualifier}CoreMessaging_NotificationTypes
    WHERE   Name = 'ContentWorkflowNotification'
IF @NotificationTypeId IS NOT NULL
BEGIN
 /* Delete Review notification action added int 7.3.0 */
 DELETE FROM {databaseOwner}{objectQualifier}CoreMessaging_NotificationTypeActions WHERE NotificationTypeId = @NotificationTypeId AND NameResourceKey = 'Review'

 /* Add Approve notification action */
    INSERT INTO {databaseOwner}{objectQualifier}CoreMessaging_NotificationTypeActions(
        [NotificationTypeID],
        [NameResourceKey],
        [DescriptionResourceKey],
        [ConfirmResourceKey],
        [Order],
        [APICall],
        [CreatedByUserID],
        [CreatedOnDate],
        [LastModifiedByUserID],
        [LastModifiedOnDate])
    VALUES(
        @NotificationTypeId,
        'Approve',
        'Approve',
        NULL,
        1,
        'DesktopModules/InternalServices/API/ContentWorkflowService/Approve',
        -1,
        GETDATE(),
        -1,
        GETDATE()
        )
  
 /* Add Reject notification action */
 INSERT INTO {databaseOwner}{objectQualifier}CoreMessaging_NotificationTypeActions(
        [NotificationTypeID],
        [NameResourceKey],
        [DescriptionResourceKey],
        [ConfirmResourceKey],
        [Order],
        [APICall],
        [CreatedByUserID],
        [CreatedOnDate],
        [LastModifiedByUserID],
        [LastModifiedOnDate])
    VALUES(
        @NotificationTypeId,
        'Reject',
        'Reject',
        NULL,
        2, /* changed by Fred 2-9-2015 old value 1, */
        'DesktopModules/InternalServices/API/ContentWorkflowService/Reject',
        -1,
        GETDATE(),
        -1,
        GETDATE()
        )
END
GO

/* Add action to Start Workflow Notification */
DECLARE @NotificationStartWorkflowTypeId INT
SELECT @NotificationStartWorkflowTypeId = NotificationTypeId
    FROM    {databaseOwner}{objectQualifier}CoreMessaging_NotificationTypes
    WHERE   Name = 'ContentWorkflowStartWorkflowNotification'
IF @NotificationStartWorkflowTypeId IS NOT NULL
BEGIN
 /* Add Submit notification action */
 /* also uses the existing Approve method */
    INSERT INTO {databaseOwner}{objectQualifier}CoreMessaging_NotificationTypeActions(
        [NotificationTypeID],
        [NameResourceKey],
        [DescriptionResourceKey],
        [ConfirmResourceKey],
        [Order],
        [APICall],
        [CreatedByUserID],
        [CreatedOnDate],
        [LastModifiedByUserID],
        [LastModifiedOnDate])
    VALUES(
        @NotificationStartWorkflowTypeId,
        'Submit',
        'Submit',
        NULL,
        1,
        'DesktopModules/InternalServices/API/ContentWorkflowService/Approve',
        -1,
        GETDATE(),
        -1,
        GETDATE()
        )
  
 /* Add Discard notification action */
 /* also uses the existing Reject method */
 INSERT INTO {databaseOwner}{objectQualifier}CoreMessaging_NotificationTypeActions(
        [NotificationTypeID],
        [NameResourceKey],
        [DescriptionResourceKey],
        [ConfirmResourceKey],
        [Order],
        [APICall],
        [CreatedByUserID],
        [CreatedOnDate],
        [LastModifiedByUserID],
        [LastModifiedOnDate])
    VALUES(
        @NotificationStartWorkflowTypeId,
        'Discard',
        'Discard',
        NULL,
        2, /* changed by Fred 2-9-2015 old value 1, */
        'DesktopModules/InternalServices/API/ContentWorkflowService/Reject',
        -1,
        GETDATE(),
        -1,
        GETDATE()
        )
END
GO

 

These changes work but I have another issue with the table EventLog. I better post another thread.

 
Previous
 
Next
HomeHomeGetting StartedGetting StartedInstalling DNN ...Installing DNN ...Cannot Upgrade to 07.04.00Cannot Upgrade to 07.04.00


These Forums are dedicated to discussion of DNN Platform and Evoq Solutions.

For the benefit of the community and to protect the integrity of the ecosystem, please observe the following posting guidelines:

  1. No Advertising. This includes promotion of commercial and non-commercial products or services which are not directly related to DNN.
  2. No vendor trolling / poaching. If someone posts about a vendor issue, allow the vendor or other customers to respond. Any post that looks like trolling / poaching will be removed.
  3. Discussion or promotion of DNN Platform product releases under a different brand name are strictly prohibited.
  4. No Flaming or Trolling.
  5. No Profanity, Racism, or Prejudice.
  6. Site Moderators have the final word on approving / removing a thread or post or comment.
  7. English language posting only, please.
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out