Google Drive Upload会间歇性返回50x服务器错误 [英] Google Drive Upload returns 50x server errors intermittently

查看:283
本文介绍了Google Drive Upload会间歇性返回50x服务器错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用java谷歌驱动器API将一些文件上传到各种Google云端硬盘文件夹。我使用的用户凭据可以访问所有文件夹。



我从运行CentOS的两个不同服务器上传大约100个PDF和100个CSV文件。虽然我偶尔会插入文件,但这些通常都是更新。这些文件的大小在35k到700字节之间,所以不会太大。



大约一周前,我上传CSV文件时(但不是PDF文件) )。例外情况如下所示:

  com.google.api.client.googleapis.json.GoogleJsonResponseException:500内部服务器错误

code:500,
errors:[{
domain:global,
message:Internal Error,
reason:internalError
}],
message:内部错误
}
,位于com.google.api.client.googleapis.json。 GoogleJsonResponseException.from(GoogleJsonResponseException.java:145)
,位于com.google.api处,位于com.google.api.client.googleapis.services.json.AbstractGoogleJsonClientRequest.newExceptionOnError(AbstractGoogleJsonClientRequest.java:113)
处。 client.googleapis.services.json.AbstractGoogleJsonClientRequest.newExceptionOnError(AbstractGoogleJsonClientRequest.java:40)

转换csv文件时和不转换时(此答案意味着转换是问题: Google Drive SDK - 500:内部服务器错误:大部分时间文件上传成功)。

我也看到了503错误:

  com.google.api.client.googleapis.json.GoogleJsonResponseException:503服务不可用
{
code:503,
errors:[{
domain:global,
message:Backend Error ,
reason:backendError
}],
message:后端错误
}
,位于com.google.api.client。 googleapis.json.GoogleJsonResponseException.from(GoogleJsonResponseException.java:145)
,位于com.google.api.client.googleapis.services.json.AbstractGoogleJsonClientRequest.newExceptionOnError(AbstractGoogleJsonClientRequest.java:113)
at com。 google.api.client.googleapis.services.json.AbstractGoogleJsonClientRequest.newExceptionOnError(AbstractGoogleJsonClientRequest.java:40)
,位于com.google.api.client.googl eapis.services.AbstractGoogleClientRequest $ 1.interceptResponse(AbstractGoogleClientRequest.java:312)

这些错误似乎没有在一天中的不同时间尝试,并从不同的计算机,不同的凭据和不同的文件夹(尽管总是使用相同的API项目访问)。



谷歌状态页面没有提到有关Drive API停机的信息: http:// www.google.com/appsstatus#hl=en&v=status



我用来查看API请求数的API控制台没有任何信息。



以下是我的环境信息:


  • java 1.6.0_25-b06 li>
  • google-api-services-drive:v2-rev126-1.18.0-rc

  • 使用jackson:com.google.api.client.json。 jackson.JacksonFactory

  • com.google.api.client.http.javanet.NetHttpTransport()

  • l>

    我做了指数回退,如下所示: https://developers.google.com/drive/web/handle-errors#implementing_exponential_backoff ,但仅适用于403错误。



    我已经完成了一些Google错误消息的搜索并查看SO问题。这表示唯一的回应是等待: 500内部服务器错误v3上传API:GoogleJsonResponseException ,但已经过了一个多星期。



    我很难过。我在此处发帖,因为这显然是获得Google云端硬盘问题支持的最佳位置( https:// developers.google.com/drive/support



    更新:



    更多详情。我试过:


    • 将线程数减少到1(我有多达15个线程推送文件)。没有变化,仍然出现错误。只有推送了CSV的
    • (不是PDF)。没有变化,仍然收到错误消息。 在更新时将$ new $ revision设置为false:
    • https://developers.google.com/drive/v2/reference/files/update 没有变化,仍然出现错误。

    • 将CSV推送到不同的文件名称。这工作!

    • 从文件夹中删除CSV。


    • $ b $
    • 正在上传的PDF文件的修订版本少了两个数量级(〜20)。某些csv文件的修订数量高达2000+。我不确定这是否是个问题。解决方案

解决方案一个解决方法是通过Web界面删除CSV文件。确保你完全删除它们,因为将它们移动到垃圾桶是不够的。


I'm using the java google drive API to upload some files into various Google Drive folders. The user whose credentials I'm using has access to all the folders.

I am uploading around 100 PDFs and 100 CSV files from two different servers running CentOS. These are typically updates though I do occasionally insert the files. These files are between 35k and 700 bytes in size, so not large.

About a week ago, I started getting exceptions when uploading the CSV files (but not the PDF files). The exceptions look like this:

com.google.api.client.googleapis.json.GoogleJsonResponseException: 500 Internal Server Error
{
"code" : 500,
"errors" : [ {
"domain" : "global",
"message" : "Internal Error",
"reason" : "internalError"
} ],
"message" : "Internal Error"
}
at com.google.api.client.googleapis.json.GoogleJsonResponseException.from(GoogleJsonResponseException.java:145)
at com.google.api.client.googleapis.services.json.AbstractGoogleJsonClientRequest.newExceptionOnError(AbstractGoogleJsonClientRequest.java:113)
at com.google.api.client.googleapis.services.json.AbstractGoogleJsonClientRequest.newExceptionOnError(AbstractGoogleJsonClientRequest.java:40)

This happens both when converting the csv file and when not converting (this answer implies that the conversion is the issue: Google Drive SDK - 500: Internal Server error: File uploads successfully most of the time ).

I have seen 503 errors as well:

com.google.api.client.googleapis.json.GoogleJsonResponseException: 503 Service Unavailable
{
  "code" : 503,
  "errors" : [ {
    "domain" : "global",
    "message" : "Backend Error",
    "reason" : "backendError"
  } ],
  "message" : "Backend Error"
}
        at com.google.api.client.googleapis.json.GoogleJsonResponseException.from(GoogleJsonResponseException.java:145)
        at com.google.api.client.googleapis.services.json.AbstractGoogleJsonClientRequest.newExceptionOnError(AbstractGoogleJsonClientRequest.java:113)
        at com.google.api.client.googleapis.services.json.AbstractGoogleJsonClientRequest.newExceptionOnError(AbstractGoogleJsonClientRequest.java:40)
        at com.google.api.client.googleapis.services.AbstractGoogleClientRequest$1.interceptResponse(AbstractGoogleClientRequest.java:312)

The errors don't seem to go away--have tried at different times of the day and from different computers and with different credentials and to different folders (though always accessed using the same API project).

The Google status page says nothing about the Drive API being down: http://www.google.com/appsstatus#hl=en&v=status

The API console that I use to view number of API requests has no information.

Here's my environment information:

  • java 1.6.0_25-b06
  • google-api-services-drive: v2-rev126-1.18.0-rc
  • using jackson: com.google.api.client.json.jackson.JacksonFactory
  • com.google.api.client.http.javanet.NetHttpTransport()

I do exponential backoff as outlined here: https://developers.google.com/drive/web/handle-errors#implementing_exponential_backoff but only for 403 errors.

I've done some googling of the error message and looking at SO questions. This one indicates that the only response is to wait: 500 Internal Server Error v3 Upload API: GoogleJsonResponseException but it has been over a week.

I'm stumped. I'm posting here because this is apparently the best place to get support for Google Drive issues (https://developers.google.com/drive/support)

Update:

More details. I've tried:

  • lowering the number of threads to 1 (I had up to 15 threads pushing files). No change, still get the error.
  • only having the CSVs pushed (not the PDFs). No change, still get the error.
  • setting 'create new revision' to false on update: https://developers.google.com/drive/v2/reference/files/update No change, still get the error.
  • pushing the CSVs to different file names. This worked!
  • deleting the CSV from the folder. This worked!
  • adding in waits before calls to google, ranging from 200ms to 500ms

The PDFs which are uploading fine have two orders of magnitude fewer revisions (~20). The number of revisions on some of the csv files is up to 2000+. I'm not sure if that is an issue or not.

解决方案

One work around is to delete the CSV files via the web interface. Make sure you delete them entirely, as just moving them to the trash is insufficient.

这篇关于Google Drive Upload会间歇性返回50x服务器错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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