驱动器文件更新错误500

Rav*_*ash 6 objective-c google-drive-api

我的应用程序在appdata文件夹中保留了少量应用程序特定文 但是当文件尝试重复更新Drive app数据中的文件时,会从Drive服务器反复获取内部错误.我使用Objective-c客户端来调用Drive API.你能帮忙解决这些问题吗?至少给出一些建议,找出导致此错误的原因.

以下是记录的请求和响应:

drive.files.update (bytes 0-40318/40319)

2014-05-19 09:23:44 +0000
Request: PUT https://www.googleapis.com/upload/rpc?uploadType=resumable&prettyPrint=false&upload_id=AEnB2Uo8yrae46aQQ-HYEtQgmXt2qNppZmkBYnPa8iXF4L6xdNYaVij6u3xLTT5kRIeH1mbPUUfUuEDEvYoouZheVwwWT6iw_A
Request headers:
  Content-Length: 40319
  Content-Range: bytes 0-40318/40319
  Content-Type: binary/octet-stream
  User-Agent: com.mycompanyname.appname/1.4.0 google-api-objc-client/2.0 MacOSX/10.8.5 (gzip)

Request body: (40319 bytes)
<<40319 bytes>>

Response: status 200
Response headers:
  Alternate-Protocol: 443:quic
  Cache-Control: no-cache, no-store, max-age=0, must-revalidate
  Content-Length: 144
  Content-Type: application/json; charset=UTF-8
  Date: Mon, 19 May 2014 09:23:44 GMT
  Expires: Fri, 01 Jan 1990 00:00:00 GMT
  Pragma: no-cache
  Server: HTTP Upload Server Built on May 15 2014 11:06:48 (1400177208)

Response body: (144 bytes)
{
  "error" : {
    "message" : "Internal Error",
    "data" : [
      {
        "reason" : "internalError",
        "message" : "Internal Error",
        "domain" : "global"
      }
    ],
    "code" : 500
  },
  "id" : "gtl_20"
}
Run Code Online (Sandbox Code Playgroud)

-------------------------------------------------- ---------

更新Jon Skeet
提出的一个很好的解决方法:回答这个问题

我设法重现了这个问题.没有setNewRevision(false)它可以工作 - 我意识到在所有情况下可能都不可行,但对你来说这是一个合理的解决方法吗?

但是,我现在暂时停止这种解决方法.我们希望setNewRevision(false)避免更多地使用用户的数据存储配额 - http://developers.google.com/drive/v2/reference/files/update


Eri*_*eda 1

此错误是由于未记录的文件限制为 200 个固定修订版本造成的。正如您所提到的,解决方法是不在上传时创建新修订版,或者取消固定某些现有修订版。