我们的应用程序对MS Graph API进行了大量调用,主要是对消息,日历和联系人的调用。由于大量的呼叫,我们会遇到节流现象,有时还会遇到503服务不可用错误。有时以下是“ 503服务不可用”错误的描述:
错误代码:“ UnknownError”,错误消息:“”
通常,这些错误在重试一次或几次后就会消失。
从11月5日开始,此类“ UnknownError” 错误的数量急剧增加。我找不到任何可能导致这些更改的MS Graph API服务更新描述。这些错误增加的原因是什么?我该如何检查?
答案 0 :(得分:1)
请阅读我们的节流指南。 https://docs.microsoft.com/en-us/graph/throttling
您需要遵守随调用返回的重试标头。否则,您将得到429s,有时会得到503s。
如果您使用的是Microsoft Graph SDK,则它具有内置的节流处理程序。
答案 1 :(得分:0)
具有相同的问题,并且显然与节流无关,就像前面的答案建议的那样。 排序似乎是由于某种原因引起的问题。几乎好像有一条错误消息,表明API无法解析并引发异常... 这是完整的跟踪记录:
➜ workturbo curl -v -H "Authorization: Bearer $TOKEN" https://graph.microsoft.com/beta/me/messages\?%24select=changeKey\&%24filter=isDraft+eq+false+and+lastModifiedDateTime+lt+2020-02-01T23%3A19%3A57Z\&%24orderby=lastModifiedDateTime+desc\&%24skip=0\&%24top=5
* Trying 20.190.132.119...
* TCP_NODELAY set
* Connected to graph.microsoft.com (20.190.132.119) port 443 (#0)
* ALPN, offering h2
* ALPN, offering http/1.1
* successfully set certificate verify locations:
* CAfile: /etc/ssl/cert.pem
CApath: none
* TLSv1.2 (OUT), TLS handshake, Client hello (1):
* TLSv1.2 (IN), TLS handshake, Server hello (2):
* TLSv1.2 (IN), TLS handshake, Certificate (11):
* TLSv1.2 (IN), TLS handshake, Server key exchange (12):
* TLSv1.2 (IN), TLS handshake, Server finished (14):
* TLSv1.2 (OUT), TLS handshake, Client key exchange (16):
* TLSv1.2 (OUT), TLS change cipher, Change cipher spec (1):
* TLSv1.2 (OUT), TLS handshake, Finished (20):
* TLSv1.2 (IN), TLS change cipher, Change cipher spec (1):
* TLSv1.2 (IN), TLS handshake, Finished (20):
* SSL connection using TLSv1.2 / ECDHE-RSA-AES128-GCM-SHA256
* ALPN, server did not agree to a protocol
* Server certificate:
* subject: CN=graph.microsoft.com
* start date: Jul 1 21:55:17 2020 GMT
* expire date: Jul 1 21:55:17 2022 GMT
* subjectAltName: host "graph.microsoft.com" matched cert's "graph.microsoft.com"
* issuer: C=US; ST=Washington; L=Redmond; O=Microsoft Corporation; OU=Microsoft IT; CN=Microsoft IT TLS CA 2
* SSL certificate verify ok.
> GET /beta/me/messages?%24select=changeKey&%24filter=isDraft+eq+false+and+lastModifiedDateTime+lt+2020-02-01T23%3A19%3A57Z&%24orderby=lastModifiedDateTime+desc&%24skip=0&%24top=5 HTTP/1.1
> Host: graph.microsoft.com
> User-Agent: curl/7.64.1
> Accept: */*
> Authorization: Bearer <OBFUSCATED>
>
< HTTP/1.1 503 Service Unavailable
< Cache-Control: private
< Content-Type: application/json
< request-id: 3903e2c4-325b-4925-8544-20383e2a2944
< client-request-id: 3903e2c4-325b-4925-8544-20383e2a2944
< x-ms-ags-diagnostic: {"ServerInfo":{"DataCenter":"West US","Slice":"SliceC","Ring":"5","ScaleUnit":"003","RoleInstance":"AGSFE_IN_17"}}
< Strict-Transport-Security: max-age=31536000
< Date: Tue, 21 Jul 2020 19:30:23 GMT
< Content-Length: 198
<
{
"error": {
"code": "UnknownError",
"message": "",
"innerError": {
"date": "2020-07-21T19:30:23",
"request-id": "3903e2c4-325b-4925-8544-20383e2a2944"
}
}
* Connection #0 to host graph.microsoft.com left intact
}* Closing connection 0