Thursday, January 15, 2009

HRESULT: 0x80040E2F Why Me?

How did it happen?

I tried to edit an existing SPListItem through the Web UI.

image

What now?
I reach for my search bar and find blah blah Violation of PRIMARY KEY constraint blah Backup blah Restore.

Shouldn't the API gracefully handle such an error?
Time to dig through the logs.
Event logs say nada but I found the following in SharePoint logs.

01/13/2009 14:09:52.60     w3wp.exe (0x1670)                           0x1458    Windows SharePoint Services       General                           0    Verbose     Releasing SPRequest with allocation Id {87F373C4-DE0E-4294-8012-85AF991E4A7F}     


01/13/2009 14:09:52.65     w3wp.exe (0x1670)                           0x1458    Windows SharePoint Services       Database                          6f8g    Unexpected    Unexpected query execution failure, error code 3621. Additional error information from SQL Server is included below. "The statement has been terminated." Query text (if available): "BEGIN TRAN;DECLARE @@iRet INT,@DN nvarchar(256),@LN nvarchar(128),@@S uniqueidentifier,@@Level tinyint,@@DocUIVersion int,@ExtraItemSize bigint;SET @@iRet = 0;SET @@S='73897537-074B-404A-B7FF-814BEF2D21C8';SET @@Level=1;SET @@DocUIVersion = 512;SELECT @ExtraItemSize = 0  EXEC @@iRet = proc_UpdateListItem @SiteId='73897537-074B-404A-B7FF-814BEF2D21C8',@WebId='71DC2E37-8A9D-4FDC-A504-6AA845885ABC', @ListID = '2446D5BB-34F8-4366-8839-B13CB55D24D0', @ItemID=2, @RowOrdinal = 0,@ReturnRowset = 1,@ItemDirName=@DN OUTPUT,@ItemLeafName=@LN OUTPUT,@UserId=2,@TimeNow = '20090113 01:09:52',@MajorVersionsLimit=0,@MajorMinor...     


tabase                          6f8g    Unexpected    Unexpected query execution failure, error code 3621. Additional error information from SQL Server is included below. "The statement has been terminated." Query text (if available): "BEGIN TRAN;DECLARE @@iRet INT,@DN nvarchar(256),@LN nvarchar(128),@@S uniqueidentifier,@@Level tinyint,@@DocUIVersion int,@ExtraItemSize bigint;SET @@iRet = 0;SET @@S='73897537-074B-404A-B7FF-814BEF2D21C8';SET @@Level=1;SET @@DocUIVersion = 512;SELECT @ExtraItemSize = 0  EXEC @@iRet = proc_UpdateListItem @SiteId='73897537-074B-404A-B7FF-814BEF2D21C8',@WebId='71DC2E37-8A9D-4FDC-A504-6AA845885ABC', @ListID = '2446D5BB-34F8-4366-8839-B13CB55D24D0', @ItemID=2, @RowOrdinal = 0,@ReturnRowset = 1,@ItemDirName=@DN OUTPUT,@ItemLeafName=@LN OUTPUT,@UserId=2,@TimeNow = '20090113 01:09:52',@MajorVersionsLimit=0,@MajorMinor...     


01/13/2009 14:09:52.65*    w3wp.exe (0x1670)                           0x1458    Windows SharePoint Services       Database                          6f8g    Unexpected    ...VersionsLimit=0, @NewUIVersion = @@DocUIVersion OUTPUT,@Level=@@Level OUTPUT,@IsDocLib=0, @tp_Version = 4, @tp_ContentTypeId = ?, @nvarchar1 = ?, @uniqueidentifier1 = ?, @ntext2 = ?, @nvarchar3 = ?, @nvarchar4 = ?, @nvarchar5 = ?, @datetime1 = ?, @datetime2 = ?, @bit1 = ?, @nvarchar6 = ?, @ntext3 = ?, @nvarchar7 = ?, @nvarchar9 = ?, @bit3 = ?, @nvarchar10 = ?, @ntext4 = ?, @bit4 = ?, @nvarchar11 = ?, @int2 = ?, @int3 = ?, @ntext5 = ?, @int4 = ?, @ntext7 = ?, @nvarchar14 = ?, @ntext8 = ?, @nvarchar15 = ?, @nvarchar16 = ?, @nvarchar17 = ?, @nvarchar18 = ?, @ntext9 = ?, @nvarchar19 = ?, @nvarchar20 = ?, @nvarchar21 = ?, @tp_ContentType = ?, @tp_Modified = ?, @tp_ModerationStatus = ?, @tp_ItemOrder = 200.000000000000, @Size = 720, @ExtraItemSize = @ExtraItemSize ,@CreateItemVersion=1,@ItemName...     


01/13/2009 14:09:52.65*    w3wp.exe (0x1670)                           0x1458    Windows SharePoint Services       Database                          6f8g    Unexpected    ...=N'2 ,jnkj hgh jk',@acl=0xF3FE000001000000000000000500000002000000FFFFFFFFFFFFFF7F190000006110030C000000001A0000007713830CB00100001B0000007713830CB00100001C0000007713830CB0010000; IF @@iRet <> 0 BEGIN ROLLBACK TRAN; GOTO DONE; END   EXEC @@iRet = proc_RemoveJunctions  @SiteId = '73897537-074B-404A-B7FF-814BEF2D21C8', @DirName = @DN, @LeafName = @LN, @FieldId = '6D58D11E-56A7-48B6-94CC-4F4509383ABA', @Level = @@Level; IF @@iRet <> 0 BEGIN ROLLBACK TRAN; GOTO DONE; END   EXEC @@iRet = proc_InsertJunction  @SiteId = '73897537-074B-404A-B7FF-814BEF2D21C8', @DirName = @DN, @LeafName = @LN, @FieldId = '6D58D11E-56A7-48B6-94CC-4F4509383ABA', @Id = 1, @Ordinal = 0, @Level = @@Level, @UIVersion = @@DocUIVersion; IF @@iRet <> 0 BEGIN ROLLBACK TRAN; GOTO DONE; END  EXEC proc_ClearLinks @@S,@DN,@LN,@@...     


01/13/2009 14:09:52.65*    w3wp.exe (0x1670)                           0x1458    Windows SharePoint Services       Database                          6f8g    Unexpected    ...Level,'9DA97A8A-1DA5-4A77-98D3-4BC10456E700'; EXEC proc_ClearLinks @@S,@DN,@LN,@@Level,'D48838AB-DFC6-466C-9CA1-24D035222458'; EXEC proc_ClearLinks @@S,@DN,@LN,@@Level,'53EFC938-7A3C-4189-BE2B-DC0A170F3CF4'; EXEC proc_ClearLinks @@S,@DN,@LN,@@Level,'D12572D0-0A1E-4438-89B5-4D0430BE7603'; EXEC proc_ClearLinks @@S,@DN,@LN,@@Level,'1D15282F-976B-44C7-B2F5-614AFBA80CCF'; EXEC proc_ClearLinks @@S,@DN,@LN,@@Level,'33FB1043-4DE8-483F-A6C6-42E02EDB42ED'; EXEC proc_ClearLinks @@S,@DN,@LN,@@Level,'4A7EDDD9-8639-4734-B3A7-2A5446605547'; COMMIT TRAN; DONE: RETURN;"     


 


In here I saw the SQL Error Code 3621 which pretty much says "The statement has been terminated."

Normally I wouldn't be so worried but in this case it now happens a lot with separate items in this list.

Thinking maybe something has become corrupted I've tried a stsadm -o backup and restore into a fresh site collection in a fresh web application using a fresh content database, but hey the issue has been restored into the new site collection.

Any help and or suggestion would be greatly appreciated, what a way to start the new year at work.

On a great note my holiday was "O" for awesome! Chur Chur.

7 comments:

  1. hi,

    we have the same problem in a document library with tons of documents. Have you find e solution?

    ReplyDelete
  2. Not yet sorry but will post an answer as soon as I find one.

    ReplyDelete
  3. Hi Johannes!

    I had the same problem but after installing hotfix kb959644 I was able to edit and save the listitem.

    The problem seems to be versioning in combination with a multi-lookup field.

    //Henrik

    ReplyDelete
  4. One step closer!
    I think I may have narrowed down this issue to a specific content type that was initially created using VSeWSS project ported to a WSPBuilder project. The plan (once I get round to it) is to recreate the content type using the MOSS web UI and export it using Andrew Connell stsadm extension. This will be a huge task since the content type is very tightly integrated into my solution.

    ReplyDelete
  5. I'm not sure if this will help you all, but I was having the same issue from a custom list item using a custom editor web part that I wrote. I seemed to have this issue when I was setting a look-up value to a value not found in the look-up list, when the value had previously been set to a value in the look-up list. Once I made sure the user could do nothing other than select a value in the look-up list, the error was fixed. Hope this makes sense.

    ReplyDelete
  6. have you found a solution for this? I am getting this error for a custom list that has multiple lookup and versioning enabled. What is strange is that as far as I can tell the list update does work successfully but even with the error. If I turn off versioning or remove the multiple lookup field, everything is working OK and I get no error message.

    Unfortunately I need to have both on.

    I am not sure if I should be installing the hotfix as @Anonymous mentioned as I have already updated my dev VM to MOSS SP2, and would think that this would have the update already.

    ReplyDelete
  7. solution:


    select * from dbo.AllUserDataJunctions
    where tp_DirName like '%yyyyyy%' and (tp_fieldid = 'xxxxxx')
    order by tp_LeafName

    delete from dbo.AllUserDataJunctions where (tp_DirName like '%yyyyyy%')
    and (tp_fieldid = 'xxxxxxx')


    yyyyy- custom list url

    ReplyDelete