lithnet / googleapps-managementagent

Google Workspace Management Agent for MIM 2016
MIT License
12 stars 4 forks source link

Adding members during group creation can fail with message 'Resource Not Found: groupKey [404]' #7

Closed khandelwalpiyush closed 8 years ago

khandelwalpiyush commented 8 years ago

If we create a group with an explicit member in it during creation, it fails to export to google. The group itself is created and on the next sync it joins up and exports the member fine.

If we create the same group without any member it exports fine. Adding the same explicit member after initial export to the group also works.

Error: The group member update operation failed.

*******************************************************************************
5/09/2016 7:37:08 AM: Opening export connection
-------------------------------------------------------------------------------
5/09/2016 7:37:18 AM: Starting export Add for user XXXXXXXXXXXXXXXXXXXXXXXX
5/09/2016 7:37:18 AM: Updating description -> distgroup
5/09/2016 7:37:18 AM: Updating name -> distgroup
5/09/2016 7:37:20 AM: An unexpected error occurred while processing XXXXXXXXXXXXXX
****************************************
An exception has occurred in <PutExportEntries>b__0
Type: Lithnet.GoogleApps.AggregateGroupUpdateException
Message: The group member update operation failed. Group ID XXXXXXXXXXXXXXXXXX
Source: Lithnet.GoogleApps
TargetSite: Void AddMembers(System.String, System.Collections.Generic.IList`1[Google.Apis.Admin.Directory.directory_v1.Data.Member], Boolean)
StackTrace:
   at Lithnet.GoogleApps.GroupMemberRequestFactory.AddMembers(String id, IList`1 members, Boolean throwOnExistingMember)
   at Lithnet.GoogleApps.MA.ApiInterfaceGroupMembership.ApplyChanges(CSEntryChange csentry, SchemaType type, Object& target, Boolean patch) in D:\github\lithnet\googleapps-managementagent\src\Lithnet.GoogleApps.MA\ApiInterfaces\ApiInterfaceGroupMembership.cs:line 108
   at Lithnet.GoogleApps.MA.ApiInterfaceGroup.ApplyChanges(CSEntryChange csentry, SchemaType type, Object& target, Boolean patch) in D:\github\lithnet\googleapps-managementagent\src\Lithnet.GoogleApps.MA\ApiInterfaces\ApiInterfaceGroup.cs:line 117
   at Lithnet.GoogleApps.MA.ExportProcessor.PutCSEntryChangeAdd(CSEntryChange csentry, CSEntryChange deltaCSEntry, MASchemaType maType, SchemaType type) in D:\github\lithnet\googleapps-managementagent\src\Lithnet.GoogleApps.MA\ExportProcessor.cs:line 102
   at Lithnet.GoogleApps.MA.ExportProcessor.PutCSEntryChangeObject(CSEntryChange csentry, SchemaType type) in D:\github\lithnet\googleapps-managementagent\src\Lithnet.GoogleApps.MA\ExportProcessor.cs:line 59
   at Lithnet.GoogleApps.MA.ExportProcessor.PutCSEntryChange(CSEntryChange csentry, SchemaType type) in D:\github\lithnet\googleapps-managementagent\src\Lithnet.GoogleApps.MA\ExportProcessor.cs:line 16
   at Lithnet.GoogleApps.MA.ManagementAgent.<>c__DisplayClass33_0.<PutExportEntries>b__0(CSEntryChange csentry) in D:\github\lithnet\googleapps-managementagent\src\Lithnet.GoogleApps.MA\ManagementAgent.cs:line 136
****************************************
-------------------------------------------------------------------------------
5/09/2016 7:37:20 AM: Closing export connection: Normal
5/09/2016 7:37:20 AM: Writing 0 delta entries to file
*******************************************************************************
khandelwalpiyush commented 8 years ago

I was able to reproduce the error with the enhanced logging binary.. Tried to export 4 members while creation of the group..

I can confirm all 4 members exist in google and are not suspended.. me@test.com is an externalMember..

FIDS on the same groups confirms the creation of group and then exports those members with no errors..

*******************************************************************************
5/09/2016 1:52:48 PM: Opening export connection
-------------------------------------------------------------------------------
5/09/2016 1:52:58 PM: Starting export Add for mailprefix3-l@d2-monash-edu.ga-staff-dev.monash.edu
5/09/2016 1:52:58 PM: Updating description -> distgroup
5/09/2016 1:52:58 PM: Updating name -> distgroup
5/09/2016 1:53:00 PM: The following member additions failed
****************************************
An exception has occurred in ApplyChanges
Type: Google.GoogleApiException
Message: Google.Apis.Requests.RequestError
Resource Not Found: groupKey [404]
Errors [
    Message[Resource Not Found: groupKey] Location[ - ] Reason[notFound] Domain[global]
]
Failed member add: Jason.Wasiak@d2-monash-edu.ga-staff-dev.monash.edu
Group: mailprefix3-l@d2-monash-edu.ga-staff-dev.monash.edu
Source: 
StackTrace:
****************************************
****************************************
An exception has occurred in ApplyChanges
Type: Google.GoogleApiException
Message: Google.Apis.Requests.RequestError
Resource Not Found: groupKey [404]
Errors [
    Message[Resource Not Found: groupKey] Location[ - ] Reason[notFound] Domain[global]
]
Failed member add: Natasha.Nelson@d2-monash-edu.ga-staff-dev.monash.edu
Group: mailprefix3-l@d2-monash-edu.ga-staff-dev.monash.edu
Source: 
StackTrace:
****************************************
****************************************
An exception has occurred in ApplyChanges
Type: Google.GoogleApiException
Message: Google.Apis.Requests.RequestError
Resource Not Found: groupKey [404]
Errors [
    Message[Resource Not Found: groupKey] Location[ - ] Reason[notFound] Domain[global]
]
Failed member add: c-davinc@d2-monash-edu.ga-staff-dev.monash.edu
Group: mailprefix3-l@d2-monash-edu.ga-staff-dev.monash.edu
Source: 
StackTrace:
****************************************
****************************************
An exception has occurred in ApplyChanges
Type: Google.GoogleApiException
Message: Google.Apis.Requests.RequestError
Resource Not Found: groupKey [404]
Errors [
    Message[Resource Not Found: groupKey] Location[ - ] Reason[notFound] Domain[global]
]
Failed member add: c-test@d2-monash-edu.ga-staff-dev.monash.edu
Group: mailprefix3-l@d2-monash-edu.ga-staff-dev.monash.edu
Source: 
StackTrace:
****************************************
****************************************
An exception has occurred in ApplyChanges
Type: Google.GoogleApiException
Message: Google.Apis.Requests.RequestError
Resource Not Found: groupKey [404]
Errors [
    Message[Resource Not Found: groupKey] Location[ - ] Reason[notFound] Domain[global]
]
Failed member add: me@test.com
Group: mailprefix3-l@d2-monash-edu.ga-staff-dev.monash.edu
Source: 
StackTrace:
****************************************
****************************************
An exception has occurred in ApplyChanges
Type: Google.GoogleApiException
Message: Google.Apis.Requests.RequestError
Resource Not Found: groupKey [404]
Errors [
    Message[Resource Not Found: groupKey] Location[ - ] Reason[notFound] Domain[global]
]
Failed member add: mgr-piyushk@d2.ga-staff-dev.monash.edu
Group: mailprefix3-l@d2-monash-edu.ga-staff-dev.monash.edu
Source: 
StackTrace:
****************************************
5/09/2016 1:53:00 PM: An unexpected error occurred while processing mailprefix3-l@d2-monash-edu.ga-staff-dev.monash.edu
****************************************
An exception has occurred in <PutExportEntries>b__0
Type: Lithnet.GoogleApps.AggregateGroupUpdateException
Message: The group member update operation failed. Group ID mailprefix3-l@d2-monash-edu.ga-staff-dev.monash.edu
Source: Lithnet.GoogleApps
TargetSite: Void AddMembers(System.String, System.Collections.Generic.IList`1[Google.Apis.Admin.Directory.directory_v1.Data.Member], Boolean)
StackTrace:
   at Lithnet.GoogleApps.GroupMemberRequestFactory.AddMembers(String id, IList`1 members, Boolean throwOnExistingMember)
   at Lithnet.GoogleApps.MA.ApiInterfaceGroupMembership.ApplyChanges(CSEntryChange csentry, SchemaType type, Object& target, Boolean patch) in D:\github\lithnet\googleapps-managementagent\src\Lithnet.GoogleApps.MA\ApiInterfaces\ApiInterfaceGroupMembership.cs:line 120
   at Lithnet.GoogleApps.MA.ApiInterfaceGroup.ApplyChanges(CSEntryChange csentry, SchemaType type, Object& target, Boolean patch) in D:\github\lithnet\googleapps-managementagent\src\Lithnet.GoogleApps.MA\ApiInterfaces\ApiInterfaceGroup.cs:line 117
   at Lithnet.GoogleApps.MA.ExportProcessor.PutCSEntryChangeAdd(CSEntryChange csentry, CSEntryChange deltaCSEntry, MASchemaType maType, SchemaType type) in D:\github\lithnet\googleapps-managementagent\src\Lithnet.GoogleApps.MA\ExportProcessor.cs:line 102
   at Lithnet.GoogleApps.MA.ExportProcessor.PutCSEntryChangeObject(CSEntryChange csentry, SchemaType type) in D:\github\lithnet\googleapps-managementagent\src\Lithnet.GoogleApps.MA\ExportProcessor.cs:line 59
   at Lithnet.GoogleApps.MA.ExportProcessor.PutCSEntryChange(CSEntryChange csentry, SchemaType type) in D:\github\lithnet\googleapps-managementagent\src\Lithnet.GoogleApps.MA\ExportProcessor.cs:line 16
   at Lithnet.GoogleApps.MA.ManagementAgent.<>c__DisplayClass33_0.<PutExportEntries>b__0(CSEntryChange csentry) in D:\github\lithnet\googleapps-managementagent\src\Lithnet.GoogleApps.MA\ManagementAgent.cs:line 136
****************************************
-------------------------------------------------------------------------------
5/09/2016 1:53:00 PM: Closing export connection: Normal
5/09/2016 1:53:00 PM: Writing 0 delta entries to file
*******************************************************************************
5/09/2016 1:53:00 PM: Operation statistics
5/09/2016 1:53:00 PM: Export objects: 1
5/09/2016 1:53:00 PM: Operation time: 00:00:02.4655488
5/09/2016 1:53:00 PM: Ops/sec: 0.406
*******************************************************************************
ryannewington commented 8 years ago

I've added a 1 second sleep after creating a group before adding members. See if it can be reproduced now.

Lithnet.GoogleApps.MA.Setup.zip

khandelwalpiyush commented 8 years ago

Initial testing with the latest patch given looks good.. created couple of groups (one with 4 members and another with 1) and they created fine..

ryannewington commented 8 years ago

Fixed in v1.1.6093