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

Invalid JWT: Token must be a short-lived token and in a reasonable timeframe

    Details

    • Type: Bug
    • Status: Closed (View Workflow)
    • Priority: Blocker
    • Resolution: Not A Defect
    • Labels:
      None
    • Environment:
      Linux jenkins 3.2.0-4-amd64 #1 SMP Debian 3.2.68-1+deb7u2 x86_64 GNU/Linux
      Jenkins 1.652
      Google Play Android Publisher Plugin 1.4.1
    • Similar Issues:

      Description

      First of all thank you for the excellent plugin and your hard work.

      Unfortunately I'm started to receive the following error, I have tried to upload a newer key from the Google, but no luck.

      Upload failed: org.jenkinsci.plugins.googleplayandroidpublisher.UploadException: java.security.GeneralSecurityException: Unable to retrieve an access token with the provided credentials
      at org.jenkinsci.plugins.googleplayandroidpublisher.CredentialsHandler.getServiceAccountCredentials(CredentialsHandler.java:60)
      at org.jenkinsci.plugins.googleplayandroidpublisher.ApkPublisher.perform(ApkPublisher.java:301)
      at hudson.tasks.BuildStepMonitor$2.perform(BuildStepMonitor.java:32)
      at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:785)
      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:410)
      Caused by: java.security.GeneralSecurityException: Unable to retrieve an access token with the provided credentials
      at com.google.jenkins.plugins.credentials.oauth.RemotableGoogleCredentials.<init>(RemotableGoogleCredentials.java:70)
      at com.google.jenkins.plugins.credentials.oauth.GoogleRobotCredentials.forRemote(GoogleRobotCredentials.java:204)
      at org.jenkinsci.plugins.googleplayandroidpublisher.CredentialsHandler.getServiceAccountCredentials(CredentialsHandler.java:36)
      ... 10 more
      Caused by: com.google.api.client.auth.oauth2.TokenResponseException: 400 Bad Request

      { "error" : "invalid_grant", "error_description" : "Invalid JWT: Token must be a short-lived token and in a reasonable timeframe" }

      at com.google.api.client.auth.oauth2.TokenResponseException.from(TokenResponseException.java:105)
      at com.google.api.client.auth.oauth2.TokenRequest.executeUnparsed(TokenRequest.java:287)
      at com.google.api.client.auth.oauth2.TokenRequest.execute(TokenRequest.java:307)
      at com.google.api.client.googleapis.auth.oauth2.GoogleCredential.executeRefreshToken(GoogleCredential.java:269)
      at com.google.api.client.auth.oauth2.Credential.refreshToken(Credential.java:489)
      at com.google.jenkins.plugins.credentials.oauth.RemotableGoogleCredentials.<init>(RemotableGoogleCredentials.java:64)
      ... 12 more

        Attachments

          Activity

          Hide
          orrc Christopher Orr added a comment -

          I've heard of another report of this — doesn't sound good.

          I would try getting in touch with Google Play Developer Support, asking them about this error, as it seems to be a problem on their end, and the API certainly isn't always very stable.

          When I get a chance, I will check whether there is a newer version of the Google Play Java library available, as that's what this plugin uses.

          Show
          orrc Christopher Orr added a comment - I've heard of another report of this — doesn't sound good. I would try getting in touch with Google Play Developer Support, asking them about this error, as it seems to be a problem on their end, and the API certainly isn't always very stable. When I get a chance, I will check whether there is a newer version of the Google Play Java library available, as that's what this plugin uses.
          Hide
          wataru wataru oguchi added a comment -

          Christopher Orr
          Hi, I had the same error out of Jenkins. Take a look the question I posted on stackoverflow.
          http://stackoverflow.com/questions/36189612/token-must-be-a-short-lived-token-and-in-a-reasonable-timeframe
          Cheers,

          Show
          wataru wataru oguchi added a comment - Christopher Orr Hi, I had the same error out of Jenkins. Take a look the question I posted on stackoverflow. http://stackoverflow.com/questions/36189612/token-must-be-a-short-lived-token-and-in-a-reasonable-timeframe Cheers,
          Hide
          dmytrop Dmytro Pohromskyy added a comment -

          I can confirm that I've resolved the original problem by synchronizing Jenkins' server time. Thank you wataru oguchi for pointing out to the relevant StackOverflow thread. I'm closing the issue.

          Show
          dmytrop Dmytro Pohromskyy added a comment - I can confirm that I've resolved the original problem by synchronizing Jenkins' server time. Thank you wataru oguchi for pointing out to the relevant StackOverflow thread. I'm closing the issue.
          Hide
          orrc Christopher Orr added a comment -

          Thanks for the update!

          I've added a troubleshooting note for this issue to this plugin's wiki page.

          Show
          orrc Christopher Orr added a comment - Thanks for the update! I've added a troubleshooting note for this issue to this plugin's wiki page.

            People

            • Assignee:
              orrc Christopher Orr
              Reporter:
              dmytrop Dmytro Pohromskyy
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: