-
Notifications
You must be signed in to change notification settings - Fork 4
Description
Ryan,
We have tenants that have a lot of external domain shared contacts and we've been unable to do full imports on those MAs for the past week or so. Gemini thinks the solution is to request fewer contacts at a time. More detail below, but my question is how feasible is this? Let me know if you want more detail on the problem, or Gemini's suggestions. Thanks so much.
We get this error in the event viewer:
The extensible extension returned an unsupported error.
The stack trace is:
"System.AggregateException: One or more errors occurred. ---> Google.GData.Client.GDataRequestException: Execution of request failed: https://www.google.com/m8/feeds/contacts/DOMAIN/full?max-results=1000 ---> System.Net.WebException: The remote server returned an error: (504) Gateway Timeout.
at System.Net.HttpWebRequest.GetResponse()
at Google.GData.Client.GDataRequest.Execute()
--- End of inner exception stack trace ---
at Lithnet.GoogleApps.MA.ManagementAgent.<>c__DisplayClass40_0.b__0(Task1 _) in D:\dev\git\lithnet\googleapps-managementagent\src\Lithnet.GoogleApps.MA\ManagementAgent.cs:line 380 at System.Threading.Tasks.Task.Execute() --- End of inner exception stack trace --- at Lithnet.GoogleApps.MA.ManagementAgent.GetImportEntriesFull() in D:\dev\git\lithnet\googleapps-managementagent\src\Lithnet.GoogleApps.MA\ManagementAgent.cs:line 481 at Lithnet.GoogleApps.MA.ManagementAgent.GetImportEntries(GetImportEntriesRunStep importRunStep) in D:\dev\git\lithnet\googleapps-managementagent\src\Lithnet.GoogleApps.MA\ManagementAgent.cs:line 399 ---> (Inner Exception #0) Google.GData.Client.GDataRequestException: Execution of request failed: https://www.google.com/m8/feeds/contacts/DOMAIN/full?max-results=1000 ---> System.Net.WebException: The remote server returned an error: (504) Gateway Timeout. at System.Net.HttpWebRequest.GetResponse() at Google.GData.Client.GDataRequest.Execute() --- End of inner exception stack trace --- at Lithnet.GoogleApps.MA.ManagementAgent.<>c__DisplayClass40_0.<OpenImportConnectionFull>b__0(Task1 _) in D:\dev\git\lithnet\googleapps-managementagent\src\Lithnet.GoogleApps.MA\ManagementAgent.cs:line 380
at System.Threading.Tasks.Task.Execute()<---
Forefront Identity Manager 4.6.607.0"
Gemini has some input on the cause being the old contact API infrastructure. It has a lot more detail on the solution but, in summary:
The Real Problem: Legacy Infrastructure Timeout
The error 504 Gateway Timeout with max-results=1000 indicates a performance failure on Google's backend, not a configuration error on your side.
The Bottleneck: You are hitting the legacy GData endpoint (https://www.google.com/m8/feeds/contacts/DOMAIN/full).
The Cause: The Lithnet MA is requesting 1,000 contacts per page (the default maximum). Because this API is running on older, less optimized infrastructure, it frequently struggles to return 1,000 full XML entries within the standard timeout window (usually 100 seconds), especially if the contacts contain photos or extended properties.
The Result: Google's frontend (the "Gateway") waits for the backend to gather the data. The backend takes too long, and the Gateway cuts the connection, returning the 504 error.
How to Fix It
Since you cannot force Google to speed up their legacy API, you must force the Management Agent to be "gentler" with its requests.
...
Recommended Value: Change this from 1000 to 100 or 200.
Why: Requesting 100 entries is much faster for the legacy backend to process, avoiding the timeout. It will result in more round-trips, but the import will actually complete.