Uploaded image for project: 'Nuxeo Platform'
  1. Nuxeo Platform
  2. NXP-29146

Fix exception when refreshing OAuth2 credentials with Google Cloud Storage

    XMLWordPrintable

    Details

    • Release Notes Summary:
      OAuth2 credentials used with Google Cloud Storage are correctly refreshed.
    • Backlog priority:
      1,000
    • Team:
      PLATFORM
    • Sprint:
      nxsupport 11.1.7

      Description

      After several hours of server inactivity of a Nuxeo server configured to store blobs in GCP, Nuxeo receives erros which indicates that OAuth2Credentials instance does not support refreshing the access token

      ERROR [Nuxeo-Work-default-8:3021634552544738.1060226349] [org.nuxeo.ecm.core.work.AbstractWork] Exception during work: TransiantStorageGCWork(, Progress(?%, ?/0), null)
      com.google.cloud.storage.StorageException: java.lang.IllegalStateException: OAuth2Credentials instance does not support refreshing the access token. An instance with a new access token should be used, or a derived type that supports refreshing.
      	at com.google.cloud.storage.StorageException.translateAndThrow(StorageException.java:74) ~[google-cloud-storage-1.76.0.jar:1.76.0]
      	at com.google.cloud.storage.StorageImpl.listBlobs(StorageImpl.java:376) ~[google-cloud-storage-1.76.0.jar:1.76.0]
      	at com.google.cloud.storage.StorageImpl.list(StorageImpl.java:307) ~[google-cloud-storage-1.76.0.jar:1.76.0]
      	at com.google.cloud.storage.Bucket.list(Bucket.java:783) ~[google-cloud-storage-1.76.0.jar:1.76.0]
      	at org.nuxeo.ecm.core.storage.gcp.GoogleStorageBinaryManager$GoogleStorageBinaryGarbageCollector.getUnmarkedBlobs(GoogleStorageBinaryManager.java:226) ~[nuxeo-core-binarymanager-gcp-10.10-HF14.jar:?]
      	at org.nuxeo.ecm.blob.AbstractBinaryGarbageCollector.stop(AbstractBinaryGarbageCollector.java:67) ~[nuxeo-core-binarymanager-common-10.10-HF21.jar:?]
      	at org.nuxeo.ecm.core.transientstore.keyvalueblob.KeyValueBlobTransientStore.doGC(KeyValueBlobTransientStore.java:288) ~[nuxeo-core-cache-10.10-HF21.jar:?]
      	at java.util.HashMap$Values.forEach(HashMap.java:981) ~[?:1.8.0_252]
      	at org.nuxeo.ecm.core.transientstore.TransientStorageComponent.doGC(TransientStorageComponent.java:98) ~[nuxeo-core-cache-10.10-HF21.jar:?]
      	at org.nuxeo.ecm.core.transientstore.TransiantStorageGCWork.work(TransiantStorageGCWork.java:41) ~[nuxeo-core-cache-10.10-HF21.jar:?]
      	at org.nuxeo.ecm.core.work.AbstractWork.runWorkWithTransaction(AbstractWork.java:493) [nuxeo-core-event-10.10-HF23.jar:?]
      	at org.nuxeo.ecm.core.work.AbstractWork.run(AbstractWork.java:383) [nuxeo-core-event-10.10-HF23.jar:?]
      	at org.nuxeo.ecm.core.work.WorkHolder.run(WorkHolder.java:57) [nuxeo-core-event-10.10-HF23.jar:?]
      	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) [?:1.8.0_252]
      	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) [?:1.8.0_252]
      	at java.lang.Thread.run(Thread.java:748) [?:1.8.0_252]
      Caused by: java.lang.IllegalStateException: OAuth2Credentials instance does not support refreshing the access token. An instance with a new access token should be used, or a derived type that supports refreshing.
      	at com.google.auth.oauth2.OAuth2Credentials.refreshAccessToken(OAuth2Credentials.java:212) ~[google-auth-library-oauth2-http-0.15.0.jar:?]
      	at com.google.auth.oauth2.OAuth2Credentials.refresh(OAuth2Credentials.java:165) ~[google-auth-library-oauth2-http-0.15.0.jar:?]
      	at com.google.auth.oauth2.OAuth2Credentials.getRequestMetadata(OAuth2Credentials.java:151) ~[google-auth-library-oauth2-http-0.15.0.jar:?]
      	at com.google.auth.http.HttpCredentialsAdapter.initialize(HttpCredentialsAdapter.java:96) ~[google-auth-library-oauth2-http-0.15.0.jar:?]
      	at com.google.cloud.http.HttpTransportOptions$1.initialize(HttpTransportOptions.java:159) ~[google-cloud-core-http-1.76.0.jar:1.76.0]
      	at com.google.cloud.http.CensusHttpModule$CensusHttpRequestInitializer.initialize(CensusHttpModule.java:109) ~[google-cloud-core-http-1.76.0.jar:1.76.0]
      	at com.google.api.client.http.HttpRequestFactory.buildRequest(HttpRequestFactory.java:93) ~[google-http-client-1.19.0.jar:1.19.0]
      	at com.google.api.client.googleapis.services.AbstractGoogleClientRequest.buildHttpRequest(AbstractGoogleClientRequest.java:301) ~[google-api-client-1.25.0.jar:1.25.0]
      	at com.google.api.client.googleapis.services.AbstractGoogleClientRequest.executeUnparsed(AbstractGoogleClientRequest.java:419) ~[google-api-client-1.25.0.jar:1.25.0]
      	at com.google.api.client.googleapis.services.AbstractGoogleClientRequest.executeUnparsed(AbstractGoogleClientRequest.java:352) ~[google-api-client-1.25.0.jar:1.25.0]
      	at com.google.api.client.googleapis.services.AbstractGoogleClientRequest.execute(AbstractGoogleClientRequest.java:469) ~[google-api-client-1.25.0.jar:1.25.0]
      	at com.google.cloud.storage.spi.v1.HttpStorageRpc.list(HttpStorageRpc.java:358) ~[google-cloud-storage-1.76.0.jar:1.76.0]
      	at com.google.cloud.storage.StorageImpl$8.call(StorageImpl.java:355) ~[google-cloud-storage-1.76.0.jar:1.76.0]
      	at com.google.cloud.storage.StorageImpl$8.call(StorageImpl.java:352) ~[google-cloud-storage-1.76.0.jar:1.76.0]
      	at com.google.api.gax.retrying.DirectRetryingExecutor.submit(DirectRetryingExecutor.java:105) ~[gax-1.44.0.jar:1.44.0]
      	at com.google.cloud.RetryHelper.run(RetryHelper.java:76) ~[google-cloud-core-1.76.0.jar:1.76.0]
      	at com.google.cloud.RetryHelper.runWithRetries(RetryHelper.java:50) ~[google-cloud-core-1.76.0.jar:1.76.0]
      	at com.google.
      

        Attachments

          Activity

            People

            • Votes:
              1 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Time Tracking

                Estimated:
                Original Estimate - Not Specified
                Not Specified
                Remaining:
                Remaining Estimate - 0 minutes
                0m
                Logged:
                Time Spent - 1 hour
                1h