Note that there are some explanatory texts on larger screens.

plurals
  1. POError 500 when inserting a document in Google Drive with a service account
    text
    copied!<p>I need to use Google Drive API to insert and read files in Google Drive from my Java application. I use a service account.</p> <p>I have created a project in my Google API console, enabled the "Drive API" service, created a new service account, and used the downloaded private key in my application :</p> <pre><code>GoogleCredential credential = new GoogleCredential.Builder() .setTransport(HTTP_TRANSPORT) .setJsonFactory(JSON_FACTORY) .setServiceAccountId(this.serviceEmail) .setServiceAccountScopes(DriveScopes.DRIVE) .setServiceAccountPrivateKeyFromP12File(new java.io.File(this.privateKeyFilePath)) .build(); </code></pre> <p>Then my Drive service is instantiated with :</p> <pre><code>Drive driveService = new Drive.Builder(HTTP_TRANSPORT, JSON_FACTORY, null) .setHttpRequestInitializer(credential) .build(); </code></pre> <p>This works fine, I can insert, share, read files in Google Drive.</p> <p>My problem is that I created a second project in my Google API console, did the same steps, but can't make it work. My 2 projects look identical, but with the second, I always have an error response when I try to insert a new document :</p> <pre><code>com.google.api.client.http.HttpResponseException: 500 Internal Server Error { "error": { "errors": [ { "domain": "global", "reason": "internalError", "message": "Internal Error" } ], "code": 500, "message": "Internal Error" } } at com.google.api.client.http.HttpRequest.execute(HttpRequest.java:978) at com.google.api.client.googleapis.media.MediaHttpUploader.upload(MediaHttpUploader.java:237) at com.google.api.services.drive.Drive$Files$Insert.executeUnparsed(Drive.java:309) at com.google.api.services.drive.Drive$Files$Insert.execute(Drive.java:331) </code></pre> <p>The first project has been created 6 months ago, whereas the second (which does not wrok) has been created these days.</p> <p>How can I get more details about this error ? What can cause this issue ?</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload