java.io.IOException: {"message":"No commit found for SHA: <revision>","documentation_url":"https://developer.github.com/v3/repos/statuses/"}

Jenkins JIRA | Abel Hegedus | 2 years ago
tip
Do you find the tips below useful? Click on the to mark them and say thanks to rafael . Or join the community to write better ones.
  1. 0

    When using Multiple SCMs to check out several Git repositories in a single build job, the "revision" of the Build (https://github.com/jenkinsci/git-plugin/blob/master/src/main/java/hudson/plugins/git/util/Build.java) will be the revision of the first repository in the list in Multiple SCMs. However, the Github commit status updater will use the same revision for _all_ repositories (https://github.com/jenkinsci/github-plugin/blob/master/src/main/java/com/cloudbees/jenkins/GitHubCommitNotifier.java#L102). This will cause failures on all repositories other than the first repository. Workaround: set "Result on failure" to SUCCESS in the Advanced part of the plugin in the Job Configuration. {CODE} Exception: ERROR: Publisher com.cloudbees.jenkins.GitHubCommitNotifier aborted due to exception java.io.IOException: {"message":"No commit found for SHA: <revision>","documentation_url":"https://developer.github.com/v3/repos/statuses/"} at org.kohsuke.github.Requester.handleApiError(Requester.java:440) at org.kohsuke.github.Requester._to(Requester.java:219) at org.kohsuke.github.Requester.to(Requester.java:173) at org.kohsuke.github.GHRepository.createCommitStatus(GHRepository.java:731) 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) at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:770) at hudson.model.AbstractBuild$AbstractBuildExecution.performAllBuildSteps(AbstractBuild.java:734) at hudson.model.Build$BuildExecution.post2(Build.java:183) at hudson.model.AbstractBuild$AbstractBuildExecution.post(AbstractBuild.java:683) at hudson.model.Run.execute(Run.java:1784) at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43) at hudson.model.ResourceController.execute(ResourceController.java:89) at hudson.model.Executor.run(Executor.java:240) Caused by: java.io.IOException: Server returned HTTP response code: 422 for URL: https://api.github.com/repos/<myrepo>/statuses/<revision> at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1627) at sun.net.www.protocol.https.HttpsURLConnectionImpl.getInputStream(HttpsURLConnectionImpl.java:254) at org.kohsuke.github.Requester.parse(Requester.java:396) at org.kohsuke.github.Requester._to(Requester.java:198) ... 13 more {CODE}

    Jenkins JIRA | 2 years ago | Abel Hegedus
    java.io.IOException: {"message":"No commit found for SHA: <revision>","documentation_url":"https://developer.github.com/v3/repos/statuses/"}
  2. 0

    When using Multiple SCMs to check out several Git repositories in a single build job, the "revision" of the Build (https://github.com/jenkinsci/git-plugin/blob/master/src/main/java/hudson/plugins/git/util/Build.java) will be the revision of the first repository in the list in Multiple SCMs. However, the Github commit status updater will use the same revision for _all_ repositories (https://github.com/jenkinsci/github-plugin/blob/master/src/main/java/com/cloudbees/jenkins/GitHubCommitNotifier.java#L102). This will cause failures on all repositories other than the first repository. Workaround: set "Result on failure" to SUCCESS in the Advanced part of the plugin in the Job Configuration. {CODE} Exception: ERROR: Publisher com.cloudbees.jenkins.GitHubCommitNotifier aborted due to exception java.io.IOException: {"message":"No commit found for SHA: <revision>","documentation_url":"https://developer.github.com/v3/repos/statuses/"} at org.kohsuke.github.Requester.handleApiError(Requester.java:440) at org.kohsuke.github.Requester._to(Requester.java:219) at org.kohsuke.github.Requester.to(Requester.java:173) at org.kohsuke.github.GHRepository.createCommitStatus(GHRepository.java:731) 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) at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:770) at hudson.model.AbstractBuild$AbstractBuildExecution.performAllBuildSteps(AbstractBuild.java:734) at hudson.model.Build$BuildExecution.post2(Build.java:183) at hudson.model.AbstractBuild$AbstractBuildExecution.post(AbstractBuild.java:683) at hudson.model.Run.execute(Run.java:1784) at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43) at hudson.model.ResourceController.execute(ResourceController.java:89) at hudson.model.Executor.run(Executor.java:240) Caused by: java.io.IOException: Server returned HTTP response code: 422 for URL: https://api.github.com/repos/<myrepo>/statuses/<revision> at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1627) at sun.net.www.protocol.https.HttpsURLConnectionImpl.getInputStream(HttpsURLConnectionImpl.java:254) at org.kohsuke.github.Requester.parse(Requester.java:396) at org.kohsuke.github.Requester._to(Requester.java:198) ... 13 more {CODE}

    Jenkins JIRA | 2 years ago | Abel Hegedus
    java.io.IOException: {"message":"No commit found for SHA: <revision>","documentation_url":"https://developer.github.com/v3/repos/statuses/"}
  3. 0
    samebug tip
    Check if you didn't set RequestProperty Content-Type to the wrong type or if you're trying to send the wrong file to the server.
  4. Speed up your debug routine!

    Automated exception search integrated into your IDE

  5. 0

    Unable to Download Image behind Proxy Server

    Stack Overflow | 2 years ago
    java.io.IOException: Server returned HTTP response code: 400 for URL: https://drive.google.com/viewerng/img?id=ACFrOgAJjqc29Qp5SCU7TFHN7pEskq8BQPXHZxaORsnhS5LW1Nl1ypxZTiW0Kylbltw3Z0XkMsACVpvmQWyHef3HdXB-XDXduE1HMXblNAMeZ2N5opRAViKbl8GrAYA=&u=0&w=800&page=1
  6. 0

    issuehub.io

    issuehub.io | 2 years ago
    java.io.IOException: Server returned HTTP response code: 401 for URL: https://ec2.amazonaws.com/?Action=DescribeInstances&Version=2014-06-15&X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=XXXXXXXXXXXXXXXX%2F20150703%2Feu-west-1%2Fec2%2Faws4_request&X-Amz-Date=20150703T094417Z&X-Amz-Expires=30&X-Amz-Signature=YYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYY&X-Amz-SignedHeaders=host
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

    Server returned HTTP response code: 422 for URL: https://api.github.com/repos/<myrepo>/statuses/<revision>

    at sun.net.www.protocol.http.HttpURLConnection.getInputStream()
  2. Java RT
    HttpsURLConnectionImpl.getInputStream
    1. sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1627)
    2. sun.net.www.protocol.https.HttpsURLConnectionImpl.getInputStream(HttpsURLConnectionImpl.java:254)
    2 frames
  3. org.kohsuke.github
    GHRepository.createCommitStatus
    1. org.kohsuke.github.Requester.parse(Requester.java:396)
    2. org.kohsuke.github.Requester._to(Requester.java:198)
    3. org.kohsuke.github.Requester.to(Requester.java:173)
    4. org.kohsuke.github.GHRepository.createCommitStatus(GHRepository.java:731)
    4 frames
  4. 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
  5. Hudson
    Executor.run
    1. hudson.tasks.BuildStepMonitor$1.perform(BuildStepMonitor.java:20)
    2. hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:770)
    3. hudson.model.AbstractBuild$AbstractBuildExecution.performAllBuildSteps(AbstractBuild.java:734)
    4. hudson.model.Build$BuildExecution.post2(Build.java:183)
    5. hudson.model.AbstractBuild$AbstractBuildExecution.post(AbstractBuild.java:683)
    6. hudson.model.Run.execute(Run.java:1784)
    7. hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)
    8. hudson.model.ResourceController.execute(ResourceController.java:89)
    9. hudson.model.Executor.run(Executor.java:240)
    9 frames