0
Under review

Following error started appearing on google apps connector

Hayden Gray 9 months ago in UNIFYBroker/Google Apps updated by Beau Harrison (Senior Software Engineer) 8 months ago 7

Hi All,

Noticed a ticket in voice with basically the same error as the one below. Adam noted an internal change made by google as the cause of the error (https://voice.unifysolutions.net/communities/6/topics/2802-google-apps-group-import-error). Would you be able to take a look and see if this is the same scenario. This occurrence is likely for the same client as the ticket linked.

Change detection engine import all items failed.
Change detection engine import all items for connector Google STAFF: Groups Connector failed with reason One or more errors occurred.. Duration: 00:14:34.7327688
Error details:
System.AggregateException: One or more errors occurred. ---> System.Exception: A Google API exception was thrown for call GroupsSettings.Get with message "Google.Apis.Requests.RequestError
Invalid Value [400]
Errors [
Message[Invalid Value] Location[ - ] Reason[invalid] Domain[global]
]
". See inner exception for details. Processing continued: False. ---> Google.GoogleApiException: Google.Apis.Requests.RequestError
Invalid Value [400]
Errors [
Message[Invalid Value] Location[ - ] Reason[invalid] Domain[global]
]

at Google.Apis.Requests.ClientServiceRequest`1.Execute()
at Unify.Product.IdentityBroker.GoogleAgent.BackoffRetry[TResult](String logEvent, Boolean throwExceptions, Func`1 request, Action newClient, TResult& result, Int32 retries)
--- End of inner exception stack trace ---
at Unify.Product.IdentityBroker.GoogleAgent.<>c__DisplayClass69_3`1.b__1()
at Unify.Product.IdentityBroker.GoogleAgent.ThrowIfPrimaryCall(Boolean primaryCall, Action throwException)
at Unify.Product.IdentityBroker.GoogleAgent.BackoffRetry[TResult](String logEvent, Boolean throwExceptions, Func`1 request, Action newClient, TResult& result, Int32 retries)
at Unify.Product.IdentityBroker.GoogleAgent.<>c__DisplayClass83_0.b__2(Tuple`2 group)
at System.Threading.Tasks.Parallel.<>c__DisplayClass17_0`1.b__1()
at System.Threading.Tasks.Task.InnerInvokeWithArg(Task childTask)
at System.Threading.Tasks.Task.<>c__DisplayClass176_0.b__0(Object )
--- End of inner exception stack trace ---
at System.Threading.Tasks.Task.ThrowIfExceptional(Boolean includeTaskCanceledExceptions)
at System.Threading.Tasks.Task.Wait(Int32 millisecondsTimeout, CancellationToken cancellationToken)
at System.Threading.Tasks.Parallel.ForWorker[TLocal](Int32 fromInclusive, Int32 toExclusive, ParallelOptions parallelOptions, Action`1 body, Action`2 bodyWithState, Func`4 bodyWithLocal, Func`1 localInit, Action`1 localFinally)
at System.Threading.Tasks.Parallel.ForEachWorker[TSource,TLocal](IEnumerable`1 source, ParallelOptions parallelOptions, Action`1 body, Action`2 bodyWithState, Action`3 bodyWithStateAndIndex, Func`4 bodyWithStateAndLocal, Func`5 bodyWithEverything, Func`1 localInit, Action`1 localFinally)
at System.Threading.Tasks.Parallel.ForEach[TSource](IEnumerable`1 source, ParallelOptions parallelOptions, Action`1 body)
at Unify.Product.IdentityBroker.GoogleAgent.ProcessedGroups(Func`1 getDirectoryService, Func`1 getGroupsSettingsService, ConcurrentBag`1 directoryServices, ConcurrentBag`1 groupsSettingsServices, GroupEntityAdapter groupAdapter, GroupSettingsEntityAdapter groupSettingAdapter, IGroupMembersEntityAdapter groupMembersAdapter, IEnumerable`1 groupsValue, Boolean manageGroupSettings, GroupMembersReadMethod groupMembersReadMethod, String[] groupNameSuffixWhitelistFilter)
at Unify.Product.IdentityBroker.GoogleAgent.d__57.MoveNext()
at System.Linq.Enumerable.d__17`2.MoveNext()
at System.Linq.Enumerable.WhereSelectEnumerableIterator`2.MoveNext()
at System.Linq.Buffer`1..ctor(IEnumerable`1 source)
at System.Linq.Enumerable.ToArray[TSource](IEnumerable`1 source)
at Unify.Product.IdentityBroker.AuditReadingConnectorDecorator.GetAllEntities(IStoredValueCollection storedValues, CancellationToken cancellationToken)
at Unify.Product.IdentityBroker.EventNotifierReadingConnectorDecoratorBase`1.GetAllEntities(IStoredValueCollection storedValues, CancellationToken cancellationToken)
at Unify.Product.IdentityBroker.ChangeDetectionImportAllJob.ImportAllChangeProcess()
at Unify.Product.IdentityBroker.ChangeDetectionImportAllJob.RunBase()
at Unify.Framework.DefinedScopeJobAuditTrailJobDecorator.Run()
at Unify.Product.IdentityBroker.ConnectorJobExecutor.<>c__DisplayClass30_0.b__0()
at Unify.Framework.AsynchronousJobExecutor.PerformJobCallback(Object state)
---> (Inner Exception #0) System.Exception: A Google API exception was thrown for call GroupsSettings.Get with message "Google.Apis.Requests.RequestError
Invalid Value [400]
Errors [
Message[Invalid Value] Location[ - ] Reason[invalid] Domain[global]
]
". See inner exception for details. Processing continued: False. ---> Google.GoogleApiException: Google.Apis.Requests.RequestError
Invalid Value [400]
Errors [
Message[Invalid Value] Location[ - ] Reason[invalid] Domain[global]
]

at Google.Apis.Requests.ClientServiceRequest`1.Execute()
at Unify.Product.IdentityBroker.GoogleAgent.BackoffRetry[TResult](String logEvent, Boolean throwExceptions, Func`1 request, Action newClient, TResult& result, Int32 retries)
--- End of inner exception stack trace ---
at Unify.Product.IdentityBroker.GoogleAgent.<>c__DisplayClass69_3`1.b__1()
at Unify.Product.IdentityBroker.GoogleAgent.ThrowIfPrimaryCall(Boolean primaryCall, Action throwException)
at Unify.Product.IdentityBroker.GoogleAgent.BackoffRetry[TResult](String logEvent, Boolean throwExceptions, Func`1 request, Action newClient, TResult& result, Int32 retries)
at Unify.Product.IdentityBroker.GoogleAgent.<>c__DisplayClass83_0.b__2(Tuple`2 group)
at System.Threading.Tasks.Parallel.<>c__DisplayClass17_0`1.b__1()
at System.Threading.Tasks.Task.InnerInvokeWithArg(Task childTask)
at System.Threading.Tasks.Task.<>c__DisplayClass176_0.b__0(Object )<---

UNIFYBroker Version: v5.3.1 Revision #4

Google Connector Version: v5.3.2.0

Let me know if you need any further information.

Thank you

Affected Versions:
Fixed by Version:
Under review

Hi Hayden,

I've tested the connector in a dev environment but have been unable to reproduce. Can you provide your connector configuration? Does this error occur consistently? Does it occur for all groups or only specific ones?  This can be tested using the connector's Group Filter feature. Just ensure that when testing the deleting of filtered groups do not propagate downstream.

Sorry forgot to mention that exports appear to be working fine by the looks of things, just the import from what I see. As for whether its all groups or not, I'll need to see if I can organise some time to stop imports to adjust the filter.

Just realized that DEV had also been experiencing the error, and changing the filter in DEV has allowed for a small subset of groups to be committed. So does this suggest that a particular group being returned is causing it to throw an error?

The debug patch I gave you should include a DEBUG ERROR: ... message for all failing groups, so that group should be the only one causing problems.

If you have access, or can find someone who does, you can test the api call here: https://developers.google.com/admin-sdk/groups-settings/v1/reference/groups/get

ok great thanks Beau, I'm chatting with someone now who has access so I'll get them to replicate

We tried replicating the call with the information of the failing group and it we are getting the group just fine on its own. We are going to install fiddler on the box and see what different call Broker is making that is returning the result.

This is the reference documentation for the failing call: https://developers.google.com/gmail/api/v1/reference/users/settings/sendAs/create.

As this document and the customer said, me instructs the api to use the authenticated account for the operation, aka the service account configured in the connector. We need to run these kind of operation on other accounts, not the service account so that's not an option.

If the call succeeds against the service account but not any other, then that does sound like a permissions error. Like it doesn't have the proper admin permissions or something.

Refer to this calls required scope on this page https://developers.google.com/gmail/api/auth/scopes and note the special conditions for its use. Check that it applies to the service account.