java.io.IOException

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.

You have a different solution? A short tip here would help you and many other users who saw this issue last week.

  • 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}
    via by Abel Hegedus,
  • 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}
    via by Abel Hegedus,
  • Unable to Download Image behind Proxy Server
    via by Unknown author,
  • issuehub.io
    via by Unknown author,
  • GitHub comment 4#154647978
    via GitHub by mig5
    ,
  • GitHub comment 150#161436434
    via GitHub by michaelrice
    ,
  • java.net.SocketTimeoutException: connect timed out
    via by Janardhan Korada,
  • GitHub comment 492#207033729
    via GitHub by ianibo
    ,
    • 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

    Users with the same issue

    Unknown visitor1 times, last one,
    Unknown visitor1 times, last one,
    Unknown visitor1 times, last one,
    tfr
    35 times, last one,
    davidvanlaatum
    1 times, last one,
    69 more bugmates