Question

Photo of Trey Hendon III

0

3.0 Update Problems

I'm getting the following error when restarting my site after running the 3.0 update:

Cannot insert duplicate key row in object 'dbo.AttributeValue' with unique index 'IX_AttributeIdEntityId'. The duplicate key value is (1723, <NULL>).
Cannot insert duplicate key row in object 'dbo.AttributeValue' with unique index 'IX_AttributeIdEntityId'. The duplicate key value is (1723, <NULL>).
Cannot insert duplicate key row in object 'dbo.AttributeValue' with unique index 'IX_AttributeIdEntityId'. The duplicate key value is (1723, <NULL>).
The statement has been terminated.
The statement has been terminated.
The statement has been terminated.

Looking in SQL I see that Attribute 1723 is MyAccountPage.  Anyone else seeing a problem like this after the update?

  • David Turner

    Guessing its **_AddWorkflowNote. If that's the case, then also guessing you've deleted the original LoginStatus blocks from the layouts on ExternalSite, If that's the case, let me know, and I'll get you a query to run that will work around this issue.

  • Trey Hendon III

    Hey, yes, _AddWorkflowNote is the last entry. And yes, I removed the original LoginStatus block for a custom one which includes the words "Sign In" if no user is logged in. A work-around query would be great, thanks David!

  • Photo of David Turner

    0

    Here's the query. Run this before updating...

    DECLARE @BlockTypeId int = ( SELECT [Id] FROM [BlockType] WHERE [Guid] = '5A5C6063-EA0D-4EDD-A394-4B1B772F2041' )
    
    IF NOT EXISTS ( SELECT * FROM [Block] WHERE [Guid] = '5A5C6063-EA0D-4EDD-A394-4B1B772F2041' )
        INSERT INTO [Block] ( [IsSystem], [BlockTypeId], [Zone], [Order], [Name], [OutputCacheDuration], [Guid] )
        VALUES ( 0, @BlockTypeId, 'Login', 0,  'Login Status', 0, '5A5C6063-EA0D-4EDD-A394-4B1B772F2041' )
    
    IF NOT EXISTS ( SELECT * FROM [Block] WHERE [Guid] = 'AD5D5155-D5AC-4445-A2C1-C4E8DC6CF23E' )
        INSERT INTO [Block] ( [IsSystem], [BlockTypeId], [Zone], [Order], [Name], [OutputCacheDuration], [Guid] )
        VALUES ( 0, @BlockTypeId, 'Login', 0,  'Login Status', 0, 'AD5D5155-D5AC-4445-A2C1-C4E8DC6CF23E' )
    
    IF NOT EXISTS ( SELECT * FROM [Block] WHERE [Guid] = '5CE3D668-85BF-4B3F-91BE-AB4BF8BA24B9' )
        INSERT INTO [Block] ( [IsSystem], [BlockTypeId], [Zone], [Order], [Name], [OutputCacheDuration], [Guid] )
        VALUES ( 0, @BlockTypeId, 'Login', 0,  'Login Status', 0, '5CE3D668-85BF-4B3F-91BE-AB4BF8BA24B9' )
    
    IF NOT EXISTS ( SELECT * FROM [Block] WHERE [Guid] = 'ED8662A3-44A9-4181-8D0B-55087E1062D1' )
        INSERT INTO [Block] ( [IsSystem], [BlockTypeId], [Zone], [Order], [Name], [OutputCacheDuration], [Guid] )
        VALUES ( 0, @BlockTypeId, 'Login', 0,  'Login Status', 0, 'ED8662A3-44A9-4181-8D0B-55087E1062D1' )

    This creates some placeholder blocks that the migration is expecting to be there.  After updating, you can run this query to clean up the temporary blocks...

    DELETE FROM [Block] 
    WHERE [PageId] IS NULL 
    AND [LayoutId] IS NULL
    AND [Guid] IN (
        '5A5C6063-EA0D-4EDD-A394-4B1B772F2041',
        'AD5D5155-D5AC-4445-A2C1-C4E8DC6CF23E',
        '5CE3D668-85BF-4B3F-91BE-AB4BF8BA24B9',
        'ED8662A3-44A9-4181-8D0B-55087E1062D1'
    )

    And, FYI, one of the updates for v3.0 was to enhance the LoginStatus block to show 'Login' when user is not logged in and add a 'My Account' option to drop-down menu when they are logged in that lets them edit their information, change password, and view the groups they belong to.

    • Trey Hendon III

      Great, that got my going. My GUIDs were different, but I got the ID of the "Login Status" block and got it in. I did see the release note about the block getting that update and will probably go back to the original block. If I don't change back is this going to give me problems on future updates?

  • Photo of Robert Bilderbach

    0

    where did you find info on updating to v3?

  • Photo of Jim Michael

    0

    Robert- 

    If you go to Admin Tools | General Settings | Rock Update in your Rock instance, you will see all of the available updates. Be sure to read the release notes for each update as there have been some significant updates to some components.

  • Photo of Robert Bilderbach

    0

    Thanks!