While calling the auditLogs/signIns endpoint using paging via $top and $skiptoken, after retrieving dozens of pages sucessfully, some applications will return a 504 gateway timeout error.
Once we get this error, attempting to retry with the same url, we get a 400 with "Skip Token is null" while when we get a 429 error, we are able to retry with the same url after the throttling period has passed.
We have tried using smaller page sizes (as low as 500 records) but still run into the same problem for the same applications.
any idea what could be causing this issue?
Perhaps a certain signin record has more data than others and leads to a timeout?
Also is there a way to limit the data returned per sign in, all we really need is the date of the signin and a user id, but the $select option is not supported.
Here are the headers and response from the Gateway Time Error:
URL: https://graph.microsoft.com/beta/auditLogs/signIns?$filter=createdDateTime+ge+2022-03-16+and+appId+eq+%<<appid>>%27&$top=500&$skiptoken=47d96df265450ef838de40dac783215e22736d0aede079fb5f631fe09364a515
"request-id" "de8908f3-f79e-4f1f-b672-6977089b9329"
client-request-id "de8908f3-f79e-4f1f-b672-6977089b9329"
"x-ms-ags-diagnostic" {"ServerInfo":{"DataCenter":"West US 2","Slice":"E","Ring":"1","ScaleUnit":"002","RoleInstance":"MWH0EPF0005A6AE"}}
"Date" Fri, 15 Apr 2022 03:29:02 GMT
Response Body:
{"error":{"code":"UnknownError","message":"","innerError":{"date":"2022-04-15T03:29:02","request-id":"de8908f3-f79e-4f1f-b672-6977089b9329","client-request-id":"de8908f3-f79e-4f1f-b672-6977089b9329"}}}
And Then if we retry with the same URL:
{"error":{"code":"UnknownError","message":"Invalid Skip Token, skip token is null","innerError":{"date":"2022-04-15T03:36:00","request-id":"c48d64c7-8cd7-487a-901e-b06df5090161","client-request-id":"c48d64c7-8cd7-487a-901e-b06df5090161"}}}
This was on the beta API but experienced the same behavior on the v1.0 version as well
We do use the retry-after header and back off calls for the interval given. It doesn't seem like it's an throttling issue so much as a problem with a specific page load.