PowerShell SDK 500 Downstream service unavailable

I have been running ‘Search-Post’ from the PowerShell SDK regularly for months but as of late last week I get the following error:

Exception occurred when calling Search-Post: @{detailCode=500.1.503 Downstream service unavailable;
     | trackingId=ff8f9c91f38a45b0897b6f73df24415b; messages=System.Object[]; causes=System.Object[]} Error:  {  
     | "detailCode": "500.1.503 Downstream service unavailable",   "trackingId": "ff8f9c91f38a45b0897b6f73df24415b",  
     | "messages": [     {       "locale": "und",       "localeOrigin": "REQUEST",       "text": "A downstream resource was
     | unavailable."     },     {       "locale": "en-US",       "localeOrigin": "DEFAULT",       "text": "A downstream      
     | resource was unavailable."     }   ],   "causes": [] }

Were any changes made to the PowerShell SDK recently?

Hi Dominick,

Error: 500.1.503 is a server-side error. 503 is Service Unavailable error. I don’t think anything wrong with PowerShell SDK scripts.

Are you running the script during any IdentityRefresh or when the tenant is extremely busy with other maintenance tasks? To handle this situation, you can catch this error and retry Search-Post after some time.

Thanks,
Shailee

1 Like

Hi @dominick-miller ,

This error is related to your Search result size.

Try to add in your search body a queryResultFilter by including only the attributes that you need:


{
    "indices": [
        "identities"
    ],
    "query": {
        "query": "yourQUery"
    },
    "queryResultFilter": {
        "includes": [
            "id",
            "displayName"
        ]
    }
}
2 Likes