title: Google Cloud Platform API -> "The OAuth client was deleted." Error
body: <p>I'm using the Google Cloud Platform API for Java (google-api-services-storage - v1beta2-rev39-1.17.0-rc).</p>
  
  <p>For a couple of month It was working fine, but now I got the following error when I execute an operation.</p>
  
  <p>I didn't found why the error appear. I checked if there is new version of the API but the v1beta2-rev39-1.17.0-rc is the last one.</p>
  
  <p>The full stacktrace</p>
  
  <pre><code>2014-36-19 12:36:11.791 [qtp1800676648-24 - PUT /track_processing/process/39793ae0-f936-4ef1-9629-bd36bc5aa469] ERROR com.xxx.common.cloud_storage.GoogleCloudStorageService - Error without Json body.com.google.api.client.auth.oauth2.TokenResponseException: 400 Bad Request{
    "error" : "invalid_client",
    "error_description" : "The OAuth client was deleted."}
      at com.google.api.client.auth.oauth2.TokenResponseException.from(TokenResponseException.java:105) ~[track_processing.jar:0.0.1-SNAPSHOT]
      at com.google.api.client.auth.oauth2.TokenRequest.executeUnparsed(TokenRequest.java:287) ~[track_processing.jar:0.0.1-SNAPSHOT]
      at com.google.api.client.auth.oauth2.TokenRequest.execute(TokenRequest.java:307) ~[track_processing.jar:0.0.1-SNAPSHOT]
      at com.google.api.client.auth.oauth2.Credential.executeRefreshToken(Credential.java:570) ~[track_processing.jar:0.0.1-SNAPSHOT]
      at com.google.api.client.auth.oauth2.Credential.refreshToken(Credential.java:489) ~[track_processing.jar:0.0.1-SNAPSHOT]
      at com.google.api.client.auth.oauth2.Credential.intercept(Credential.java:217) ~[track_processing.jar:0.0.1-SNAPSHOT]
      at com.google.api.client.http.HttpRequest.execute(HttpRequest.java:859) ~[track_processing.jar:0.0.1-SNAPSHOT]
      at com.google.api.client.googleapis.media.MediaHttpUploader.executeCurrentRequestWithoutGZip(MediaHttpUploader.java:545) ~[track_processing.jar:0.0.1-SNAPSHOT]
      at com.google.api.client.googleapis.media.MediaHttpUploader.executeCurrentRequest(MediaHttpUploader.java:562) ~[track_processing.jar:0.0.1-SNAPSHOT]
      at com.google.api.client.googleapis.media.MediaHttpUploader.executeUploadInitiation(MediaHttpUploader.java:519) ~[track_processing.jar:0.0.1-SNAPSHOT]
      at com.google.api.client.googleapis.media.MediaHttpUploader.resumableUpload(MediaHttpUploader.java:384) ~[track_processing.jar:0.0.1-SNAPSHOT]
      at com.google.api.client.googleapis.media.MediaHttpUploader.upload(MediaHttpUploader.java:336) ~[track_processing.jar:0.0.1-SNAPSHOT]
      at com.google.api.client.googleapis.services.AbstractGoogleClientRequest.executeUnparsed(AbstractGoogleClientRequest.java:418) ~[track_processing.jar:0.0.1-SNAPSHOT]
      at com.google.api.client.googleapis.services.AbstractGoogleClientRequest.executeUnparsed(AbstractGoogleClientRequest.java:343) ~[track_processing.jar:0.0.1-SNAPSHOT]
      at com.google.api.client.googleapis.services.AbstractGoogleClientRequest.execute(AbstractGoogleClientRequest.java:460) ~[track_processing.jar:0.0.1-SNAPSHOT]
  </code></pre>
  
  <p>This is the executed code</p>
  
  <pre><code>public URL upload(final InputStream mediaStream, long mediaStreamSize, final String filename) throws IOException {
          InputStreamContent mediaContent = new InputStreamContent(MediaType.APPLICATION_OCTET_STREAM, mediaStream);
          if (mediaStreamSize &gt; 0)
              mediaContent.setLength(mediaStreamSize); // Only an estimate, but allows google to optimize the upload
  
          StorageObject objectMetadata = new StorageObject().setName(filename)
                  .setAcl(Lists.newArrayList(new ObjectAccessControl().setEntity("allUsers").setRole("READER")))
                  .setContentDisposition("attachment");
  
          Storage.Objects.Insert insertObject = client.objects()
                                                      .insert(storageConfiguration.getBucketName(),
                                                              objectMetadata,
                                                              mediaContent);
  
          insertObject.getMediaHttpUploader()
                      .setProgressListener(new UploadProgressListener(mediaStreamSize &gt; 0))
                      .setDisableGZipContent(true);
  
          if (mediaContent.getLength() &gt; 0 &amp;&amp; mediaContent.getLength() &lt;= 2 * 1000 * 1000) {
              logger.info("{} is a small file (&lt;2mb)", filename);
              insertObject.getMediaHttpUploader().setDirectUploadEnabled(true);
          }
  
          return new URL(insertObject.execute().getSelfLink());
      }
  </code></pre>
  
  <p>Regards,
  Ignacio</p>