SyncStateNotFound错误:如何解决或避免? [英] SyncStateNotFound error: how to fix or avoid?

查看:64
本文介绍了SyncStateNotFound错误:如何解决或避免?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用Microsoft Graph API增量查询来定期下载某些信息(消息,联系人,事件).但有时我会收到此错误:

I am using Microsoft Graph API delta queries for downloading some information (messages, contacts, events) regularly. But sometimes I get this error:

{
    "error" :
    {
        "code" : "SyncStateNotFound",
        "innerError" :
        {
            "date" : "2018-06-01T06:31:24",
            "request-id" : "47e918a9-ce5b-42b4-8a86-12b96c93121a"
        },
        "message" : "The sync state generation is not found; generation=605;[highest=841][841][839][840]."
    }
}

我无法为您提供复制步骤,因为我不知道如何复制.有时会在生产环境中发生.

I can't provide you steps for reproducing because I don't know how to reproduce it. It happens sometimes on production environment.

所以我有一些问题:

  1. Microsoft Graph API中的生成是什么?是否有任何可用的文档?我在互联网上找不到任何有用的东西.
  2. 为什么增量链接会过期?增量链接会随着时间过期或使用增量链接进行某些迭代?我可以将增量链接保存在数据库中吗? 1年使用此增量链接再次进行同步吗?
  3. 如何避免增量链接过期?有生活上的麻烦吗?
  4. 如果遇到此问题,该怎么办?完全重新同步并获取新的增量链接?
  5. 这是错误还是功能?

推荐答案

每次同步时,都会生成一个新的同步令牌.我们将当前的同步令牌与前两个令牌一起存储.如果我们在服务器端进行同步,但是在将数据传输到客户端时发生某些情况,因此他们无法获得新的令牌值,这将对我们有帮助.在这种情况下,我们可以回退"到先前的同步令牌,以便客​​户端不必重新同步所有内容.但是,这三个存储的令牌在每次同步时都会发生变化-最旧的令牌会被丢弃,而我们会前进.在您的情况下,您正在向我们传递一个约有230代历史的delta令牌.该令牌早已消失.

Every time you sync, a new sync token is generated. We store the current sync token along with the two previous ones. This helps us in cases where we advance the sync on the server side, but something happens transmitting the data to the client so they don't get the new token value. In such cases, we can "fallback" to the previous sync token so that the client doesn't have to resync everything. But these three stored tokens change with each sync - the oldest one gets dropped and we advance. In your case, you are passing us a delta token that is around 230 generations old. That token is long gone.

要考虑的另一件事是,一个无效"的同步令牌将徘徊约90天,在这一点上,我们认为它已过时,在其上倒入汽油并着火(不是真的).

Another thing to consider is that an "inactive" sync token will hang around for around 90 days at which point we consider it stale, pour gas on it and set it on fire (not really).

这篇关于SyncStateNotFound错误:如何解决或避免?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆