Confluence REST API 更新问题:名称为 sync-rev 的 属性 不是字符串

Confluence REST API update issue: Property with name sync-rev is not a String

我正在编写一个脚本来通过 REST API 更新汇合页面,使用:

curl -u user:password -X PUT -H 'Content-Type: application/json' -d'{"id":173390846,"type":"page","title":"test4","body":{"storage":{"value":"hello world","representation":"storage"}},"version":{"number":10}}' http://confluence.private.com/rest/api/content/173390846

但有时我会收到以下错误。

{"statusCode":500,"message":"java.lang.IllegalArgumentException: Property with name sync-rev is not a String"}

如果我手动编辑并保存页面,可能会发生这种情况,也可能在没有手动编辑页面的情况下发生。
有时如果我 运行 再次更新它会起作用,有时它会持续存在并给出相同的错误。

我写的脚本比 hello world 示例大,但是如果我创建了一个新的空白页面,通过 REST API 更新它,手动编辑它,并尝试再次更新它(使用版本递增)我得到了上述错误。

除此 doc 外,我没有发现任何提及 属性 sync-rev 的内容,但它并没有帮助我解决我的问题。

我们的confluence版本是5.9.6

为什么我会收到此错误,我可以如何 do/change 让它消失?

我也遇到了同样的问题,求助atlassian社区。您可以在 https://answers.atlassian.com/questions/38379050/how-to-update-confluence-pages-using-rest-api

关注我的问题

此外,我联系了支持人员,因为在我看来这个问题是汇合处的错误。我会及时通知您最新的支持响应。

编辑:这是 Atlassian 的建议:

  1. backup the database since this require manual database delete
  2. run the following SQL query:
    // identify how many entries need to be deleted
    select count( distinct propertyid) from CONTENTPROPERTIES where propertyname='sync-rev';

    // delete all of the entries delete from CONTENTPROPERTIES where propertyname='sync-rev';
  3. restart Confluence instance
  4. verify if the problem persist

请注意,我还没有验证他们的解决方案。