【问题标题】:Drive file update error 500驱动器文件更新错误 500
【发布时间】:2014-05-19 09:42:57
【问题描述】:

我的应用程序在 appdata 文件夹中保留了一些特定于应用程序的文件。但是,当文件尝试更新 Drive 应用程序数据中的文件时,会反复从 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"
}

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

更新
Jon Skeet from:answer to this question提出的一个很好的解决方法

我已经设法重现了这个问题。没有 setNewRevision(false) 它 有效 - 我意识到这可能并非在所有情况下都可行,但它是 目前对您来说合理的解决方法?

但是,我现在将保留这种解决方法。我们更喜欢setNewRevision(false),以防止导致用户数据存储配额的使用增加 - http://developers.google.com/drive/v2/reference/files/update


【问题讨论】:

标签: objective-c google-drive-api


【解决方案1】:

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

【讨论】:

    猜你喜欢
    • 2018-09-11
    • 1970-01-01
    • 2019-06-21
    • 2021-02-28
    • 1970-01-01
    • 1970-01-01
    • 2020-10-13
    • 1970-01-01
    • 2018-03-26
    相关资源
    最近更新 更多