locked
Exception from HRESULT: 0x80040E2F at Microsoft.SharePoint.Library.SPRequestInternalClass.UpdateMembers(String bstrUrl, Guid& pguidScopeId, Int32 lGroupID, Int32 lGroupOwnerId, Object& pvarArrayAdd, Object& pvarArrayAddIds, Object& pvarArrayLoginsRemove RRS feed

  • Question

  • Hi Geeks,

      I have three site collections . I can add a user to two site collections. But when i add the user to third site collections i get the following error.

      Exception from HRESULT: 0x80040E2F   at Microsoft.SharePoint.Library.SPRequestInternalClass.UpdateMembers(String bstrUrl, Guid& pguidScopeId, Int32 lGroupID, Int32 lGroupOwnerId, Object& pvarArrayAdd, Object& pvarArrayAddIds, Object& pvarArrayLoginsRemove, Object& pvarArrayIdsRemove, Boolean bSendEmail)
       at Microsoft.SharePoint.Library.SPRequest.UpdateMembers(String bstrUrl, Guid& pguidScopeId, Int32 lGroupID, Int32 lGroupOwnerId, Object& pvarArrayAdd, Object& pvarArrayAddIds, Object& pvarArrayLoginsRemove, Object& pvarArrayIdsRemove, Boolean bSendEmail)
    .

     

    Thursday, April 26, 2012 9:32 AM

Answers

  •  Thanks to our database admin

    I finally fixed it.

    1) first i got the error from ulsviewer

    The error is as below.

    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):

    "SET NOCOUNT ON;

     DECLARE @DN nvarchar(256),

    @LN nvarchar(128),
    @@DocUIVersion int,
    @@Level tinyint,
    @@S uniqueidentifier;

     DECLARE
    @ItemId int;

     DECLARE

    @@iRet int;

     DECLARE
    @ExtraItemSize int;

    DECLARE @Login nvarchar(255);

    DECLARE @Title nvarchar(255);

     DECLARE @Email nvarchar(255);

    DECLARE @Notes nvarchar(1023);

    DECLARE @AddedToTable bit;

    DECLARE @UserIdOut int;

    DECLARE @LoginOut nvarchar(255);

    DECLARE @TitleOut nvarchar(255);

     DECLARE @EmailOut nvarchar(255);

    DECLARE @NotesOut nvarchar(1023);

     DECLARE @DeletedOut bit;

     DECLARE @IsGroup bit;

    SET @IsGroup = 0;

    SET @@Level = 1;

     SELECT @Login = ?;

    SELECT @Title = ?;

    SELECT @Email = ?;

    SELECT @Notes = ?;

     SELECT @@S=?;

    BEGIN TRAN;

     EXEC @@iRet = proc_SecAddUser @@S, ?, ?, ?, ?, ?,
    @Login,
    @Title,
     @Email,
    @Notes, ?, ?, ?, ?,
     @AddedToTable OUTPUT,
     @UserIdOut OUTPUT,
    @LoginOut OUTPUT,
    @TitleOut OUTPUT,
     @EmailOut OUTPUT,
    @NotesOut OUTPUT,
    @DeletedOut;
    IF @@iRet <> 0

    BEGIN ROLLBACK TRAN;

     GOTO DONE;

    END ;

     SELECT @ItemId = @UserIdOut

    IF NOT EXISTS
    ( SELECT tp_ID FROM UserData WHERE tp_ListId = '0CD9DAD1-9089-48DA-BA83-3A36F332F687'

    AND tp_ID = @ItemId  AND tp_Level = 1 AND tp_RowOrdinal =0)

    BEGIN SELECT @ExtraItemSize = 0
     EXEC @@iRet = proc_AddListItem @SiteId = '3C466FB8-5AC0-417B-9F22-2158CD45F1C2',

    @WebId='17FA90F6-3279-4078-A99A-3227121D776F',
    @ListID = '0CD9DAD1-9089-48DA-BA83-3A36F332F687',
    @RowOrdinal = 0,
    @ItemId = @ItemId OUTPUT,
    @ItemDirName=@DN OUTPUT,
    @ItemLeafName=@LN OUTPUT,
    @UserID = 1,
    @TimeNow = '20120430 21:43:52',
    @ServerTemplate = 112,
    @Basetype= 0,
    @Level= 1,
    @tp_GUID =NULL,
    @AddNamespace=1,
    @CheckDiskQuota=1,
    @tp_ContentTypeId = ?,
    @nvarchar1 = ?,
    @nvarchar3 = ?,
    @nvarchar4 = ?,
    @nvarchar5 = ?,
     @bit2 = ?,
     @bit3 = ?,
     @nvarchar8 = ?,
    @nvarchar9 = ?,
    @bit4 = ?,
    @tp_ContentType = ?,
     @tp_ModerationStatus = ?,
     @Size = 76,
    @ExtraItemSize = @ExtraItemSize ,
    @acl=0xF3FE0000010000000000000000000000;

     IF @@iRet <> 0
     BEGIN ROLLBACK TRAN;

     GOTO DONE;
     END  END ;

    COMMIT TRAN;

    DONE:

    SELECT @@iRet,
    @ItemId,
    @AddedToTable,
     @LoginOut,
    @TitleOut,
    @EmailOut,
    @NotesOut,
     @DeletedOut "

    2)  The second step I had to start the sql profiler when i was adding the user .  I had to filter the sql profiler wiith tha database name as it saved me loads of time.

     It gave the following error. primary key viloation error for the alluserdata table.

    3) In the end i found there was a primary constraint on the userdata table which stopped duplicate data.

     I had to delete a record and then it started working.

    Hope this helps someone.


    • Edited by john 1990 Tuesday, May 1, 2012 3:57 PM
    • Marked as answer by john 1990 Tuesday, May 1, 2012 3:57 PM
    Tuesday, May 1, 2012 3:56 PM

All replies

  •  Thanks to our database admin

    I finally fixed it.

    1) first i got the error from ulsviewer

    The error is as below.

    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):

    "SET NOCOUNT ON;

     DECLARE @DN nvarchar(256),

    @LN nvarchar(128),
    @@DocUIVersion int,
    @@Level tinyint,
    @@S uniqueidentifier;

     DECLARE
    @ItemId int;

     DECLARE

    @@iRet int;

     DECLARE
    @ExtraItemSize int;

    DECLARE @Login nvarchar(255);

    DECLARE @Title nvarchar(255);

     DECLARE @Email nvarchar(255);

    DECLARE @Notes nvarchar(1023);

    DECLARE @AddedToTable bit;

    DECLARE @UserIdOut int;

    DECLARE @LoginOut nvarchar(255);

    DECLARE @TitleOut nvarchar(255);

     DECLARE @EmailOut nvarchar(255);

    DECLARE @NotesOut nvarchar(1023);

     DECLARE @DeletedOut bit;

     DECLARE @IsGroup bit;

    SET @IsGroup = 0;

    SET @@Level = 1;

     SELECT @Login = ?;

    SELECT @Title = ?;

    SELECT @Email = ?;

    SELECT @Notes = ?;

     SELECT @@S=?;

    BEGIN TRAN;

     EXEC @@iRet = proc_SecAddUser @@S, ?, ?, ?, ?, ?,
    @Login,
    @Title,
     @Email,
    @Notes, ?, ?, ?, ?,
     @AddedToTable OUTPUT,
     @UserIdOut OUTPUT,
    @LoginOut OUTPUT,
    @TitleOut OUTPUT,
     @EmailOut OUTPUT,
    @NotesOut OUTPUT,
    @DeletedOut;
    IF @@iRet <> 0

    BEGIN ROLLBACK TRAN;

     GOTO DONE;

    END ;

     SELECT @ItemId = @UserIdOut

    IF NOT EXISTS
    ( SELECT tp_ID FROM UserData WHERE tp_ListId = '0CD9DAD1-9089-48DA-BA83-3A36F332F687'

    AND tp_ID = @ItemId  AND tp_Level = 1 AND tp_RowOrdinal =0)

    BEGIN SELECT @ExtraItemSize = 0
     EXEC @@iRet = proc_AddListItem @SiteId = '3C466FB8-5AC0-417B-9F22-2158CD45F1C2',

    @WebId='17FA90F6-3279-4078-A99A-3227121D776F',
    @ListID = '0CD9DAD1-9089-48DA-BA83-3A36F332F687',
    @RowOrdinal = 0,
    @ItemId = @ItemId OUTPUT,
    @ItemDirName=@DN OUTPUT,
    @ItemLeafName=@LN OUTPUT,
    @UserID = 1,
    @TimeNow = '20120430 21:43:52',
    @ServerTemplate = 112,
    @Basetype= 0,
    @Level= 1,
    @tp_GUID =NULL,
    @AddNamespace=1,
    @CheckDiskQuota=1,
    @tp_ContentTypeId = ?,
    @nvarchar1 = ?,
    @nvarchar3 = ?,
    @nvarchar4 = ?,
    @nvarchar5 = ?,
     @bit2 = ?,
     @bit3 = ?,
     @nvarchar8 = ?,
    @nvarchar9 = ?,
    @bit4 = ?,
    @tp_ContentType = ?,
     @tp_ModerationStatus = ?,
     @Size = 76,
    @ExtraItemSize = @ExtraItemSize ,
    @acl=0xF3FE0000010000000000000000000000;

     IF @@iRet <> 0
     BEGIN ROLLBACK TRAN;

     GOTO DONE;
     END  END ;

    COMMIT TRAN;

    DONE:

    SELECT @@iRet,
    @ItemId,
    @AddedToTable,
     @LoginOut,
    @TitleOut,
    @EmailOut,
    @NotesOut,
     @DeletedOut "

    2)  The second step I had to start the sql profiler when i was adding the user .  I had to filter the sql profiler wiith tha database name as it saved me loads of time.

     It gave the following error. primary key viloation error for the alluserdata table.

    3) In the end i found there was a primary constraint on the userdata table which stopped duplicate data.

     I had to delete a record and then it started working.

    Hope this helps someone.


    • Edited by john 1990 Tuesday, May 1, 2012 3:57 PM
    • Marked as answer by john 1990 Tuesday, May 1, 2012 3:57 PM
    Tuesday, May 1, 2012 3:56 PM
  • if you are editing the database (user data table meaning userinfo table), you are putting the database in a not supported state. please refer - http://support.microsoft.com/kb/841057/en-us

    Please ignore \ refrain from performing the above operation. Thanks,

    Friday, February 21, 2014 1:35 AM
  • I was getting an error on the same method - a COM exception that said:

    [COMException (0x81020018): Invalid text value.
    
    A text field contains invalid data. Please check the value and try again.<nativehr>0x81020018</nativehr><nativestack></nativestack>]
       Microsoft.SharePoint.Library.SPRequestInternalClass.UpdateMembers(String bstrUrl, UInt32 dwObjectType, String bstrObjId, Guid& pguidScopeId, Int32 lGroupID, Int32 lGroupOwnerId, Object& pvarArrayAdd, Object& pvarArrayAddIds, Object& pvarArrayLoginsRemove, Object& pvarArrayIdsRemove, Boolean bRemoveFromCurrentScopeOnly, Boolean bSendEmail) +0
       Microsoft.SharePoint.Library.SPRequest.UpdateMembers(String bstrUrl, UInt32 dwObjectType, String bstrObjId, Guid& pguidScopeId, Int32 lGroupID, Int32 lGroupOwnerId, Object& pvarArrayAdd, Object& pvarArrayAddIds, Object& pvarArrayLoginsRemove, Object& pvarArrayIdsRemove, Boolean bRemoveFromCurrentScopeOnly, Boolean bSendEmail) +240

    The user I was trying to add in this case was a custom claim, more like a group than a user.  I was trying to add the claim to an SPGroup through /_layouts/user.aspx.  The claim-group was already in the site collection's user list because it had been used in a Person or Group field in a list item.  Based on your tip (violation of a primary key constraint) I tried 'Delete this user from site collection' from the Edit User dialog.  After that I could add the user again wherever I wanted.  I would suggest you try the same - delete the user through the interface instead of through the db.

    This doesn't explain why the error message was 'invalid text data' since that apparently usually means your text is >255 characters, which doesn't seem relevant at all in this case.

    Thursday, March 19, 2015 10:45 PM