Forum Discussion
503 UnknownError for all /sites calls
Every call I make to one of the /sites/ endpoints gives me a 503 UnknownError response. The prime example of this is the inability to do a GET request to /sites/root. I have ensured that my API has all six site permissions (set as application permissions) and have given Admin consent for the organization. I have even done further testing to see if this is an issue strictly with the /sites endpoint. If I leave all functions, headers, access token, etc. exactly the same and simply change the endpoint from /sites/root to /users or /groups, the call works exactly as intended.
This 503 error has now been happening on every call to the /sites/ endpoints for multiple days and even going over the weekend. This tells me it is not simply throttling which some resources have said it would be. After working with Microsoft support they informed me their trained to help with the M365 apps so I have now been directed to posting on here. Any insight into possible fixes whether it is an issue with my code or with some form of admin permissions would be greatly appreciated. I have exhausted most resources and have found many possible solutions, though none have actually fixed the issue.
2 Replies
I've run into scenarios where 503 was indeed caused by throttling, but that should go away in time. The easiest way to confirm whether it's throttling related is to run a test with a new AppID, preferably from a different tenant.
FWIW, the endpoint does work as expected here, but that's no guarantee that a service-side issue is happening somewhere in the vast MS cloud. Support is provided for the Graph API as well, so tell the agent you worked with to stop slacking and transfer you to the corresponding team. These forums are not an official support channel and there's barely any presence from Microsoft folks on them, outside of the blog section.
- phwilson17Copper Contributor
The issue is still persisting and Microsoft Support has been no help. Their regular support channels bring me to people that say they are trained with the 365 apps and cannot help with actual Graph API calls. Attempting to make a request through the Azure Admin center prompts me to purchase a service subscription before being able to get any help.
As said the call gives 503 error. I then went ahead and removed all the site permissions from my app registration and waited a day before trying again. Regardless of the permissions the app is given, so long as the token is valid I get a 503 error, so it is returning that before even validating app permissions. The only time I do not get a 503 error is when I purposefully provide an incorrect access token for example using graph_header = {"Authorization" : f"Bearer {graphAuth()[:-1]}"} In that case I get a 401 error which is expected since the token is invalid, but so long as it is a real token the request never checks permissions before giving me an UnknownError. I also did try creating a new app registration in Entra and making the request with that though the 503 error remained.
Between the time the error has been happening, the inability to get direct Microsoft support, and the lack of information coming from the error, I am at a loss of how to proceed.