Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-40234

Google OAuth plugin can't parse GCP credentials

    XMLWordPrintable

    Details

    • Similar Issues:

      Description

      Using the most recent google oauth plugin with the google storage plugin, I get this output when running a job that's configured to upload the build artifacts to GCS:

      ERROR: Build step failed with exception
      java.lang.IllegalStateException: An error occurred deducing a username from the provided credentials files.
      at com.google.jenkins.plugins.credentials.oauth.GoogleRobotPrivateKeyCredentials.getUsername(GoogleRobotPrivateKeyCredentials.java:130)
      at com.google.jenkins.plugins.credentials.oauth.RemotableGoogleCredentials.<init>(RemotableGoogleCredentials.java:54)
      at com.google.jenkins.plugins.credentials.oauth.GoogleRobotCredentials.forRemote(GoogleRobotCredentials.java:204)
      at com.google.jenkins.plugins.storage.AbstractUpload.performUploads(AbstractUpload.java:413)
      at com.google.jenkins.plugins.storage.AbstractUpload.access$000(AbstractUpload.java:101)
      at com.google.jenkins.plugins.storage.AbstractUpload$1.call(AbstractUpload.java:367)
      at com.google.jenkins.plugins.storage.AbstractUpload$1.call(AbstractUpload.java:364)
      at hudson.FilePath.act(FilePath.java:1078)
      at com.google.jenkins.plugins.storage.AbstractUpload.initiateUploadsAtWorkspace(AbstractUpload.java:363)
      at com.google.jenkins.plugins.storage.AbstractUpload.perform(AbstractUpload.java:182)
      at com.google.jenkins.plugins.storage.GoogleCloudStorageUploader.perform(GoogleCloudStorageUploader.java:109)
      at hudson.tasks.BuildStepMonitor$1.perform(BuildStepMonitor.java:20)
      at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:779)
      at hudson.model.AbstractBuild$AbstractBuildExecution.performAllBuildSteps(AbstractBuild.java:726)
      at hudson.model.Build$BuildExecution.post2(Build.java:185)
      at hudson.model.AbstractBuild$AbstractBuildExecution.post(AbstractBuild.java:671)
      at hudson.model.Run.execute(Run.java:1766)
      at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)
      at hudson.model.ResourceController.execute(ResourceController.java:98)
      at hudson.model.Executor.run(Executor.java:381)
      Caused by: java.security.GeneralSecurityException: An unknown problem occured while retrieving token
      at com.google.jenkins.plugins.credentials.oauth.GoogleRobotPrivateKeyCredentials.getGoogleCredential(GoogleRobotPrivateKeyCredentials.java:196)
      at com.google.jenkins.plugins.credentials.oauth.GoogleRobotPrivateKeyCredentials.getUsername(GoogleRobotPrivateKeyCredentials.java:118)
      ... 19 more
      Caused by: java.io.FileNotFoundException: (No such file or directory)
      at java.io.FileInputStream.open0(Native Method)
      at java.io.FileInputStream.open(FileInputStream.java:195)
      at java.io.FileInputStream.<init>(FileInputStream.java:138)
      at com.google.api.client.googleapis.auth.oauth2.GoogleCredential$Builder.setServiceAccountPrivateKeyFromP12File(GoogleCredential.java:504)
      at com.google.jenkins.plugins.credentials.oauth.GoogleRobotPrivateKeyCredentials.getGoogleCredential(GoogleRobotPrivateKeyCredentials.java:188)
      ... 20 more
      Build step 'Google Cloud Storage Uploader' marked build as failure
      Finished: FAILURE

        Attachments

          Activity

          Show
          craigbarber Craig Barber added a comment - Migrated to: https://github.com/jenkinsci/google-oauth-plugin/issues/37

            People

            Assignee:
            astroilov Andrey Stroilov
            Reporter:
            jolamb John Lamb
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: