java.io.IOException: {"message":"Validation Failed","errors":[{"resource":"Status","code":"custom","message":"This SHA and context has reached the maximum number of statuses."}],"documentation_url":"https://developer.github.com/v3/repos/statuses/#create-a-status"}

Jenkins JIRA | Michael Grünewald | 1 year ago
  1. 0

    We are using Jenkins in conjunction with GitHub. Sometimes the tests are failing with the following exception: {noformat} Sep 10, 2015 7:19:35 AM hudson.model.AbstractBuild$AbstractBuildExecution reportError WARNING: Publisher 'Set build status on GitHub commit' aborted due to exception: java.io.IOException: {"message":"Validation Failed","errors":[{"resource":"Status","code":"custom","message":"This SHA and context has reached the maximum number of statuses."}],"documentation_url":"https://developer.github.com/v3/repos/statuses/#create-a-status"} at org.kohsuke.github.Requester.handleApiError(Requester.java:493) at org.kohsuke.github.Requester._to(Requester.java:245) at org.kohsuke.github.Requester.to(Requester.java:191) at org.kohsuke.github.GHRepository.createCommitStatus(GHRepository.java:774) at com.cloudbees.jenkins.GitHubCommitNotifier.updateCommitStatus(GitHubCommitNotifier.java:127) at com.cloudbees.jenkins.GitHubCommitNotifier.perform(GitHubCommitNotifier.java:84) at hudson.tasks.BuildStepMonitor$1.perform(BuildStepMonitor.java:20) {noformat} The error message seems to report the error details sent back by the GitHub RPC endpoint, stating that Jenkins tried to update more than 1000 times the statuses associated to a given SHA or “context”. Since we have a hand of different tests, it is strange to hit that 1000 limit. How to more precisely diagnose this (non-fatal) error and figure out what is causing that limit to be hit?

    Jenkins JIRA | 1 year ago | Michael Grünewald
    java.io.IOException: {"message":"Validation Failed","errors":[{"resource":"Status","code":"custom","message":"This SHA and context has reached the maximum number of statuses."}],"documentation_url":"https://developer.github.com/v3/repos/statuses/#create-a-status"}
  2. 0

    We are using Jenkins in conjunction with GitHub. Sometimes the tests are failing with the following exception: {noformat} Sep 10, 2015 7:19:35 AM hudson.model.AbstractBuild$AbstractBuildExecution reportError WARNING: Publisher 'Set build status on GitHub commit' aborted due to exception: java.io.IOException: {"message":"Validation Failed","errors":[{"resource":"Status","code":"custom","message":"This SHA and context has reached the maximum number of statuses."}],"documentation_url":"https://developer.github.com/v3/repos/statuses/#create-a-status"} at org.kohsuke.github.Requester.handleApiError(Requester.java:493) at org.kohsuke.github.Requester._to(Requester.java:245) at org.kohsuke.github.Requester.to(Requester.java:191) at org.kohsuke.github.GHRepository.createCommitStatus(GHRepository.java:774) at com.cloudbees.jenkins.GitHubCommitNotifier.updateCommitStatus(GitHubCommitNotifier.java:127) at com.cloudbees.jenkins.GitHubCommitNotifier.perform(GitHubCommitNotifier.java:84) at hudson.tasks.BuildStepMonitor$1.perform(BuildStepMonitor.java:20) {noformat} The error message seems to report the error details sent back by the GitHub RPC endpoint, stating that Jenkins tried to update more than 1000 times the statuses associated to a given SHA or “context”. Since we have a hand of different tests, it is strange to hit that 1000 limit. How to more precisely diagnose this (non-fatal) error and figure out what is causing that limit to be hit?

    Jenkins JIRA | 1 year ago | Michael Grünewald
    java.io.IOException: {"message":"Validation Failed","errors":[{"resource":"Status","code":"custom","message":"This SHA and context has reached the maximum number of statuses."}],"documentation_url":"https://developer.github.com/v3/repos/statuses/#create-a-status"}
  3. 0

    When {{GitHubPushTrigger.start}} is run (generally because a job configuration was just saved), it forks a thread to update the web hooks. If there are any problems doing that, these are sent to the system log, but the person configuring the job may not know to look there (or may not even have permissions to do so). For example, I have gotten stack traces like {code:none} Failed to obtain repository com.cloudbees.jenkins.GitHubRepositoryName$1$1@... java.io.IOException: {"message":"Bad credentials","documentation_url":"https://developer.github.com/v3"} at org.kohsuke.github.Requester.handleApiError(Requester.java:427) at org.kohsuke.github.Requester._to(Requester.java:206) at org.kohsuke.github.Requester.to(Requester.java:160) at org.kohsuke.github.GitHub.getUser(GitHub.java:279) at com.cloudbees.jenkins.GitHubRepositoryName$1$1.adapt(GitHubRepositoryName.java:101) at com.cloudbees.jenkins.GitHubRepositoryName$1$1.adapt(GitHubRepositoryName.java:98) at hudson.util.AdaptedIterator.next(AdaptedIterator.java:54) at hudson.util.Iterators$FilterIterator.fetch(Iterators.java:109) at hudson.util.Iterators$FilterIterator.hasNext(Iterators.java:127) at com.cloudbees.jenkins.GitHubPushTrigger$2.run(GitHubPushTrigger.java:144) at ... Caused by: java.io.IOException: Server returned HTTP response code: 401 for URL: https://api.github.com/users/<myorg> at sun.net.www.protocol.http.HttpURLConnection.getInputStream(Unknown Source) at sun.net.www.protocol.https.HttpsURLConnectionImpl.getInputStream(Unknown Source) at org.kohsuke.github.Requester.parse(Requester.java:383) at org.kohsuke.github.Requester._to(Requester.java:185) ... 16 more {code} and later on the same job {code:none} org.kohsuke.github.GHException: Failed to update jenkins hooks at com.cloudbees.jenkins.GitHubPushTrigger.createJenkinsHook(GitHubPushTrigger.java:164) at com.cloudbees.jenkins.GitHubPushTrigger.access$700(GitHubPushTrigger.java:46) at com.cloudbees.jenkins.GitHubPushTrigger$2.run(GitHubPushTrigger.java:146) at ... Caused by: java.io.FileNotFoundException: https://api.github.com/repos/<myorg>/<myrepo>/hooks at sun.net.www.protocol.http.HttpURLConnection.getInputStream(Unknown Source) at sun.net.www.protocol.https.HttpsURLConnectionImpl.getInputStream(Unknown Source) at org.kohsuke.github.Requester.parse(Requester.java:383) at org.kohsuke.github.Requester._to(Requester.java:185) at org.kohsuke.github.Requester.to(Requester.java:160) at org.kohsuke.github.GHRepository.createHook(GHRepository.java:754) at com.cloudbees.jenkins.GitHubPushTrigger.createJenkinsHook(GitHubPushTrigger.java:161) ... 10 more {code} By the time these are thrown, it is of course too late to display such errors on the configuration page for the job now, but I would suggest that form validation for the push trigger display any such errors from the _last_ save. (If you are not getting builds triggered, your natural first step would be to double-check the job configuration, where you would see this clearly.)

    Jenkins JIRA | 2 years ago | Jesse Glick
    java.io.IOException: {"message":"Bad credentials","documentation_url":"https://developer.github.com/v3"}
  4. Speed up your debug routine!

    Automated exception search integrated into your IDE

  5. 0

    When {{GitHubPushTrigger.start}} is run (generally because a job configuration was just saved), it forks a thread to update the web hooks. If there are any problems doing that, these are sent to the system log, but the person configuring the job may not know to look there (or may not even have permissions to do so). For example, I have gotten stack traces like {code:none} Failed to obtain repository com.cloudbees.jenkins.GitHubRepositoryName$1$1@... java.io.IOException: {"message":"Bad credentials","documentation_url":"https://developer.github.com/v3"} at org.kohsuke.github.Requester.handleApiError(Requester.java:427) at org.kohsuke.github.Requester._to(Requester.java:206) at org.kohsuke.github.Requester.to(Requester.java:160) at org.kohsuke.github.GitHub.getUser(GitHub.java:279) at com.cloudbees.jenkins.GitHubRepositoryName$1$1.adapt(GitHubRepositoryName.java:101) at com.cloudbees.jenkins.GitHubRepositoryName$1$1.adapt(GitHubRepositoryName.java:98) at hudson.util.AdaptedIterator.next(AdaptedIterator.java:54) at hudson.util.Iterators$FilterIterator.fetch(Iterators.java:109) at hudson.util.Iterators$FilterIterator.hasNext(Iterators.java:127) at com.cloudbees.jenkins.GitHubPushTrigger$2.run(GitHubPushTrigger.java:144) at ... Caused by: java.io.IOException: Server returned HTTP response code: 401 for URL: https://api.github.com/users/<myorg> at sun.net.www.protocol.http.HttpURLConnection.getInputStream(Unknown Source) at sun.net.www.protocol.https.HttpsURLConnectionImpl.getInputStream(Unknown Source) at org.kohsuke.github.Requester.parse(Requester.java:383) at org.kohsuke.github.Requester._to(Requester.java:185) ... 16 more {code} and later on the same job {code:none} org.kohsuke.github.GHException: Failed to update jenkins hooks at com.cloudbees.jenkins.GitHubPushTrigger.createJenkinsHook(GitHubPushTrigger.java:164) at com.cloudbees.jenkins.GitHubPushTrigger.access$700(GitHubPushTrigger.java:46) at com.cloudbees.jenkins.GitHubPushTrigger$2.run(GitHubPushTrigger.java:146) at ... Caused by: java.io.FileNotFoundException: https://api.github.com/repos/<myorg>/<myrepo>/hooks at sun.net.www.protocol.http.HttpURLConnection.getInputStream(Unknown Source) at sun.net.www.protocol.https.HttpsURLConnectionImpl.getInputStream(Unknown Source) at org.kohsuke.github.Requester.parse(Requester.java:383) at org.kohsuke.github.Requester._to(Requester.java:185) at org.kohsuke.github.Requester.to(Requester.java:160) at org.kohsuke.github.GHRepository.createHook(GHRepository.java:754) at com.cloudbees.jenkins.GitHubPushTrigger.createJenkinsHook(GitHubPushTrigger.java:161) ... 10 more {code} By the time these are thrown, it is of course too late to display such errors on the configuration page for the job now, but I would suggest that form validation for the push trigger display any such errors from the _last_ save. (If you are not getting builds triggered, your natural first step would be to double-check the job configuration, where you would see this clearly.)

    Jenkins JIRA | 2 years ago | Jesse Glick
    java.io.IOException: {"message":"Bad credentials","documentation_url":"https://developer.github.com/v3"}
  6. 0

    Error when posting build state to Github

    GitHub | 3 years ago | cstewart87
    java.io.IOException: {"message":"Bad credentials","documentation_url":"http://developer.github.com/v3"}

    Not finding the right solution?
    Take a tour to get the most out of Samebug.

    Tired of useless tips?

    Automated exception search integrated into your IDE

    Root Cause Analysis

    1. java.io.IOException

      {"message":"Validation Failed","errors":[{"resource":"Status","code":"custom","message":"This SHA and context has reached the maximum number of statuses."}],"documentation_url":"https://developer.github.com/v3/repos/statuses/#create-a-status"}

      at org.kohsuke.github.Requester.handleApiError()
    2. org.kohsuke.github
      GHRepository.createCommitStatus
      1. org.kohsuke.github.Requester.handleApiError(Requester.java:493)
      2. org.kohsuke.github.Requester._to(Requester.java:245)
      3. org.kohsuke.github.Requester.to(Requester.java:191)
      4. org.kohsuke.github.GHRepository.createCommitStatus(GHRepository.java:774)
      4 frames
    3. com.cloudbees.jenkins
      GitHubCommitNotifier.perform
      1. com.cloudbees.jenkins.GitHubCommitNotifier.updateCommitStatus(GitHubCommitNotifier.java:127)
      2. com.cloudbees.jenkins.GitHubCommitNotifier.perform(GitHubCommitNotifier.java:84)
      2 frames
    4. Hudson
      BuildStepMonitor$1.perform
      1. hudson.tasks.BuildStepMonitor$1.perform(BuildStepMonitor.java:20)
      1 frame