0

I'm uploading file to google drive by using service account. And It worked w/o any problem for a while. And it started giving 500 error from 2 days ago.

W/System.err: com.google.api.client.googleapis.json.GoogleJsonResponseException: 500 Internal Server Error
W/System.err: {
W/System.err:   "code" : 500,
W/System.err:   "message" : null
W/System.err: }

But there is file uploaded successfully if I go to gdrive account in web and only success usage in console also. ( only 200 responses )

dongseok0
  • 737
  • 2
  • 7
  • 18

2 Answers2

2

Based on Official Google Documentation '500: Backend Error' is an unexpected error occurred while processing the request. The suggested action is to use exponential backoff.

Exponential backoff is a standard error handling strategy for network applications in which the client periodically retries a failed request over an increasing amount of time. Exponential backoff may be a good strategy for handling those errors.

You may also check this stack overflow related ticket which discuss some other work around: Google Drive uploading file size limit

Community
  • 1
  • 1
Android Enthusiast
  • 4,826
  • 2
  • 15
  • 30
1

Well, It's fixed by removing 'thumbnailLink' field. I used to work but started to giving error about a week ago.

From

Drive.Files.Create insert = drive.files().create(fileMetadata, mediaContent)
            .setFields("id,mimeType,thumbnailLink,webContentLink,webViewLink");

To

Drive.Files.Create insert = drive.files().create(fileMetadata, mediaContent)
            .setFields("id,mimeType,webContentLink,webViewLink");
dongseok0
  • 737
  • 2
  • 7
  • 18