0
Fixed

Google User Settings - Delete SendAs Address

Boyd Bostock 7 years ago in UNIFYBroker/Google Apps updated by Adam van Vliet 7 years ago 11

I am getting an error using the Google User Settings connector. The error occurs when deleting a custom SendAs address which was previously added using the connector.

Example

DN: CN=gsurname@email.com,OU=GmailSettings,DC=IdentityBroker

SendAs Unchanged: <SendAs name="""" address=""gsurname@email.com"" replyTo="""" signature="""" default=""false"" />

SendAs Unchanged: <SendAs name=""Givenname Surname"" address=""gsurname@email2.com"" replyTo="""" signature="""" default=""true"" />

SendAs Delete: <SendAs name=""Givenname Surname"" address=""gsurname@email3.com"" replyTo="""" signature="""" default=""false"" />

Error Message

System.ArgumentException: An item with the same key has already been added.
   at System.ThrowHelper.ThrowArgumentException(ExceptionResource resource)
   at System.Collections.Generic.Dictionary`2.Insert(TKey key, TValue value, Boolean add)
   at System.Linq.Enumerable.ToDictionary[TSource,TKey,TElement](IEnumerable`1 source, Func`2 keySelector, Func`2 elementSelector, IEqualityComparer`1 comparer)
   at Unify.Product.IdentityBroker.UserSettingsEntityMapper.MapEntity(IEntity originalEntity, IConnectorEntity exportedEntity)
   at Unify.Product.IdentityBroker.GoogleUserSettingsConnector.<>c__DisplayClass20_0.<UpdateEntities>b__4(IConnectorEntity entity)
   at System.Linq.Enumerable.WhereSelectArrayIterator`2.MoveNext()
   at System.Linq.Buffer`1..ctor(IEnumerable`1 source)
   at System.Linq.Enumerable.ToArray[TSource](IEnumerable`1 source)
   at Unify.Product.IdentityBroker.GoogleUserSettingsConnector.UpdateEntities(IEnumerable`1 entities, IEnumerable`1 originalEntities, ISaveEntityResults`2 results)
   at Unify.Product.IdentityBroker.AuditUpdatingConnectorDecorator.UpdateEntities(IEnumerable`1 entities, IEnumerable`1 originalEntities, ISaveEntityResults`2 results)
   at Unify.Product.IdentityBroker.EventNotifierUpdatingConnectorDecorator.UpdateEntities(IEnumerable`1 entities, IEnumerable`1 originalEntities, ISaveEntityResults`2 results)


Answer

Answer

Now that I'm looking at it, name is probably a bad key for the list of send-as (I don't recall making the decision when originally developing it). Shall I give you a patch that uses the email address instead, try to save you going through that fun?

Identity Broker: v5.2.0 Revision #3

Google Connector: 5.2.0.1

Under review

This can only happen if either there's a duplicate in the existing set of send-as or the exported set of send-as. As there isn't a duplicate in the exported set, it must be from Google. Are you able to check the portal?

I will need to see if I can install the Google command line utility GAM, this particular setting cannot be set in the Portal

Answer

Now that I'm looking at it, name is probably a bad key for the list of send-as (I don't recall making the decision when originally developing it). Shall I give you a patch that uses the email address instead, try to save you going through that fun?

Yes please. The name will definitely be duplicate for some users as it is <Firstname> <Lastname>. I believe email address has to be unique

I replaced the file in the Services directory and got the error below when starting.

Service cannot be started. Unify.Framework.UnifyServiceInitializeException: Method 'UserAdd' in type 'Unify.Product.IdentityBroker.GoogleAgent' from assembly 'Unify.IdentityBroker.Communicator.Google, Version=5.2.0.0, Culture=neutral, PublicKeyToken=null' does not have an implementation. ---> System.TypeLoadException: Method 'UserAdd' in type 'Unify.Product.IdentityBroker.GoogleAgent' from assembly 'Unify.IdentityBroker.Communicator.Google, Version=5.2.0.0, Culture=neutral, PublicKeyToken=null' does not have an implementation.
   at Unify.Product.IdentityBroker.GoogleAgentFactory.CreateComponent(IAgentConfiguration factoryInformation)
   at Unify.Product.IdentityBroker.AgentEngine.GenerateAgent(IAgentConfiguration configuration)
   at Unify.Product.IdentityBroker.AgentEngine.InitializeFromXml(XDocument xml)
   at Unify.Product.IdentityBroker.AgentEngineAuditingDecorator.Initialize()
   at Unify.Framework.UnifyEngine`1.Initialize()
   --- End of inner exception stack trace ---
   at Unify.Framework.UnifyEngine`1.Initialize()

Any luck with the release Boyd?

Hi Adam

A small percentage worked, those that are going back to a single value are failing. I have been trying to re-import the Connector to confirm the data is synchronised, unfortunately it is timing out which I expect is related to the amount of activity with the start of school.


System.Exception: An exception was thrown on the last attempt of retry (6). See inner exception for details. ---> Google.GoogleApiException: Google.Apis.Requests.RequestError
Not Found [404]
Errors [
 Message[Not Found] Location[ - ] Reason[notFound] Domain[global]
]

   at Google.Apis.Requests.ClientServiceRequest`1.Execute()
   at Unify.Product.IdentityBroker.GoogleAgent.<>c__DisplayClass69_0.<BackoffRetryNoResult>b__0()
   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__DisplayClass68_0`1.<BackoffRetry>b__2()
   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.BackoffRetryNoResult(String logEvent, Boolean primaryCall, Action request, Action newClient, Int32 retries)
   at Unify.Product.IdentityBroker.GoogleAgent.<>c__DisplayClass50_0.<UserSettingsUpdate>b__1(Tuple`2 userPair)

Boyd

All scenarios appear to working now.