java.io.IOException

There are no available Samebug tips for this exception. Do you have an idea how to solve this issue? A short tip would help users who saw this issue last week.

  • We are using Atlassian Stash as SCM, jenkins as CI-Server and Artifactory as binary version control. I have a job setup to pull from stash (with private/public ssh key pair), build and publish to artifactory. This build runs smoothly. But when i try to stage a release build with the artifactory plugin form within the jenkins job, i get the following errors at the end of the build: {code}[RELEASE] Committing release version on branch 'release/project-0.0.2' [RELEASE] Creating tag 'project-0.0.2' [RELEASE] Pushing branch 'release/project-0.0.2' to 'ssh://git@gitserver:7999/test/project_main.git' Failure in post build SCM action: Failed to push: Command "git push ssh://git@gitserver:7999/test/project_main.git refs/heads/release/project-0.0.2" returned status code 128: stdout: stderr: Permission denied (publickey). fatal: Could not read from remote repository. Please make sure you have the correct access rights and the repository exists. ERROR: [RELEASE] Failed on build completion java.io.IOException: Failed checkout branch: Command "git checkout develop" returned status code 1: stdout: stderr: error: pathspec 'develop' did not match any file(s) known to git. at org.jfrog.hudson.release.scm.git.GitManager$CheckoutBranchCallable.invoke(GitManager.java:234) at org.jfrog.hudson.release.scm.git.GitManager$CheckoutBranchCallable.invoke(GitManager.java:199) at hudson.FilePath.act(FilePath.java:914) at hudson.FilePath.act(FilePath.java:887) at org.jfrog.hudson.release.scm.git.GitManager.checkoutBranch(GitManager.java:60) at org.jfrog.hudson.release.scm.git.GitCoordinator.buildCompleted(GitCoordinator.java:137) at org.jfrog.hudson.release.maven.MavenReleaseWrapper$ReleaseRunListener.onCompleted(MavenReleaseWrapper.java:308) at org.jfrog.hudson.release.maven.MavenReleaseWrapper$ReleaseRunListener.onCompleted(MavenReleaseWrapper.java:276) at hudson.model.listeners.RunListener.fireCompleted(RunListener.java:199) at hudson.model.Run.execute(Run.java:1720) at hudson.maven.MavenModuleSetBuild.run(MavenModuleSetBuild.java:519) at hudson.model.ResourceController.execute(ResourceController.java:88) at hudson.model.Executor.run(Executor.java:231) Finished: FAILURE {code} When i change the authentication with Stash to username and password i get a different error just saying "authentication failed". So the plugin seems to fetch the credentials from the git client plugin. But for some reasing it can't push anyways. The user has the necessary rights inside stash. Can anybody point me in the right direction, how to solve this issue or at least, where i could go on searching for the root cause. Thanks in advance
    via by Christopher Timm,
  • We are using Atlassian Stash as SCM, jenkins as CI-Server and Artifactory as binary version control. I have a job setup to pull from stash (with private/public ssh key pair), build and publish to artifactory. This build runs smoothly. But when i try to stage a release build with the artifactory plugin form within the jenkins job, i get the following errors at the end of the build: {code}[RELEASE] Committing release version on branch 'release/project-0.0.2' [RELEASE] Creating tag 'project-0.0.2' [RELEASE] Pushing branch 'release/project-0.0.2' to 'ssh://git@gitserver:7999/test/project_main.git' Failure in post build SCM action: Failed to push: Command "git push ssh://git@gitserver:7999/test/project_main.git refs/heads/release/project-0.0.2" returned status code 128: stdout: stderr: Permission denied (publickey). fatal: Could not read from remote repository. Please make sure you have the correct access rights and the repository exists. ERROR: [RELEASE] Failed on build completion java.io.IOException: Failed checkout branch: Command "git checkout develop" returned status code 1: stdout: stderr: error: pathspec 'develop' did not match any file(s) known to git. at org.jfrog.hudson.release.scm.git.GitManager$CheckoutBranchCallable.invoke(GitManager.java:234) at org.jfrog.hudson.release.scm.git.GitManager$CheckoutBranchCallable.invoke(GitManager.java:199) at hudson.FilePath.act(FilePath.java:914) at hudson.FilePath.act(FilePath.java:887) at org.jfrog.hudson.release.scm.git.GitManager.checkoutBranch(GitManager.java:60) at org.jfrog.hudson.release.scm.git.GitCoordinator.buildCompleted(GitCoordinator.java:137) at org.jfrog.hudson.release.maven.MavenReleaseWrapper$ReleaseRunListener.onCompleted(MavenReleaseWrapper.java:308) at org.jfrog.hudson.release.maven.MavenReleaseWrapper$ReleaseRunListener.onCompleted(MavenReleaseWrapper.java:276) at hudson.model.listeners.RunListener.fireCompleted(RunListener.java:199) at hudson.model.Run.execute(Run.java:1720) at hudson.maven.MavenModuleSetBuild.run(MavenModuleSetBuild.java:519) at hudson.model.ResourceController.execute(ResourceController.java:88) at hudson.model.Executor.run(Executor.java:231) Finished: FAILURE {code} When i change the authentication with Stash to username and password i get a different error just saying "authentication failed". So the plugin seems to fetch the credentials from the git client plugin. But for some reasing it can't push anyways. The user has the necessary rights inside stash. Can anybody point me in the right direction, how to solve this issue or at least, where i could go on searching for the root cause. Thanks in advance
    via by Christopher Timm,
  • The Artifactory Release process can leave invalid branches in the local Git repository when it fails. When a release build fails I expect to see: {noformat} [RELEASE] Deleting local git branch: release-0.2 [RELEASE] Deleting remote branch 'release-0.2' on 'git@test-repo.git [RELEASE] Deleting local tag: 0.2 [RELEASE] Deleting remote tag '0.2' from 'git@test-repo.git' [RELEASE] Reverting git working copy back to initial commit: 111ece6c5ec424c42edd0c4175a1044a59511866 {noformat} But this didn't happen for the following failure when the artifact was mistakenly released to a snapshot repository and rejected: {noformat} * What went wrong: Execution failed for task ':artifactoryPublish'. > Failed to deploy file: HTTP response code: 409. HTTP response message: Conflict ... ERROR: [RELEASE] Failed on build completion java.io.IOException: Failed checkout branch: Command "/usr/bin/git checkout develop" returned status code 1: stdout: stderr: error: Your local changes to the following files would be overwritten by checkout: gradle.properties Please, commit your changes or stash them before you can switch branches. Aborting at org.jfrog.hudson.release.scm.git.GitManager$CheckoutBranchCallable.invoke(GitManager.java:234) at org.jfrog.hudson.release.scm.git.GitManager$CheckoutBranchCallable.invoke(GitManager.java:199) at hudson.FilePath.act(FilePath.java:865) at hudson.FilePath.act(FilePath.java:838) at org.jfrog.hudson.release.scm.git.GitManager.checkoutBranch(GitManager.java:60) at org.jfrog.hudson.release.scm.git.GitCoordinator.buildCompleted(GitCoordinator.java:142) at org.jfrog.hudson.gradle.ArtifactoryGradleConfigurator$ReleaseRunListener.onCompleted(ArtifactoryGradleConfigurator.java:660) at org.jfrog.hudson.gradle.ArtifactoryGradleConfigurator$ReleaseRunListener.onCompleted(ArtifactoryGradleConfigurator.java:630) at hudson.model.listeners.RunListener.fireCompleted(RunListener.java:199) at hudson.model.Run.execute(Run.java:1625) at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:46) at hudson.model.ResourceController.execute(ResourceController.java:88) at hudson.model.Executor.run(Executor.java:237) {noformat} The build exited without cleaning up the repo. Subsequent release builds also fail because the local branch exists: {noformat} [RELEASE] Release build triggered FATAL: Failed checkout branch: Command "/usr/bin/git checkout -b release-0.2.2" returned status code 128: stdout: stderr: fatal: A branch named 'release-0.2.2' already exists. java.io.IOException: Failed checkout branch: Command "/usr/bin/git checkout -b release-0.2.2" returned status code 128: stdout: stderr: fatal: A branch named 'release-0.2.2' already exists. at org.jfrog.hudson.release.scm.git.GitManager$CheckoutBranchCallable.invoke(GitManager.java:234) at org.jfrog.hudson.release.scm.git.GitManager$CheckoutBranchCallable.invoke(GitManager.java:199) at hudson.FilePath.act(FilePath.java:865) at hudson.FilePath.act(FilePath.java:838) at org.jfrog.hudson.release.scm.git.GitManager.checkoutBranch(GitManager.java:60) at org.jfrog.hudson.release.scm.git.GitCoordinator.beforeReleaseVersionChange(GitCoordinator.java:80) at org.jfrog.hudson.release.gradle.GradleReleaseWrapper.setUp(GradleReleaseWrapper.java:139) at org.jfrog.hudson.gradle.ArtifactoryGradleConfigurator.setUp(ArtifactoryGradleConfigurator.java:358) at hudson.model.Build$BuildExecution.doRun(Build.java:154) at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:580) at hudson.model.Run.execute(Run.java:1575) at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:46) at hudson.model.ResourceController.execute(ResourceController.java:88) at hudson.model.Executor.run(Executor.java:237) {noformat} In this case {{release-0.2.2}} only exists on the Jenkins build machine. I need to know this and wipe the workspace in order for the build to proceed. I've tried to use the Git plugin option to "Prune remote branches before build" but that didn't help. This situation is easy to get into and takes some level of investigation to correct.
    via by Ryan Maki,
  • The Artifactory Release process can leave invalid branches in the local Git repository when it fails. When a release build fails I expect to see: {noformat} [RELEASE] Deleting local git branch: release-0.2 [RELEASE] Deleting remote branch 'release-0.2' on 'git@test-repo.git [RELEASE] Deleting local tag: 0.2 [RELEASE] Deleting remote tag '0.2' from 'git@test-repo.git' [RELEASE] Reverting git working copy back to initial commit: 111ece6c5ec424c42edd0c4175a1044a59511866 {noformat} But this didn't happen for the following failure when the artifact was mistakenly released to a snapshot repository and rejected: {noformat} * What went wrong: Execution failed for task ':artifactoryPublish'. > Failed to deploy file: HTTP response code: 409. HTTP response message: Conflict ... ERROR: [RELEASE] Failed on build completion java.io.IOException: Failed checkout branch: Command "/usr/bin/git checkout develop" returned status code 1: stdout: stderr: error: Your local changes to the following files would be overwritten by checkout: gradle.properties Please, commit your changes or stash them before you can switch branches. Aborting at org.jfrog.hudson.release.scm.git.GitManager$CheckoutBranchCallable.invoke(GitManager.java:234) at org.jfrog.hudson.release.scm.git.GitManager$CheckoutBranchCallable.invoke(GitManager.java:199) at hudson.FilePath.act(FilePath.java:865) at hudson.FilePath.act(FilePath.java:838) at org.jfrog.hudson.release.scm.git.GitManager.checkoutBranch(GitManager.java:60) at org.jfrog.hudson.release.scm.git.GitCoordinator.buildCompleted(GitCoordinator.java:142) at org.jfrog.hudson.gradle.ArtifactoryGradleConfigurator$ReleaseRunListener.onCompleted(ArtifactoryGradleConfigurator.java:660) at org.jfrog.hudson.gradle.ArtifactoryGradleConfigurator$ReleaseRunListener.onCompleted(ArtifactoryGradleConfigurator.java:630) at hudson.model.listeners.RunListener.fireCompleted(RunListener.java:199) at hudson.model.Run.execute(Run.java:1625) at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:46) at hudson.model.ResourceController.execute(ResourceController.java:88) at hudson.model.Executor.run(Executor.java:237) {noformat} The build exited without cleaning up the repo. Subsequent release builds also fail because the local branch exists: {noformat} [RELEASE] Release build triggered FATAL: Failed checkout branch: Command "/usr/bin/git checkout -b release-0.2.2" returned status code 128: stdout: stderr: fatal: A branch named 'release-0.2.2' already exists. java.io.IOException: Failed checkout branch: Command "/usr/bin/git checkout -b release-0.2.2" returned status code 128: stdout: stderr: fatal: A branch named 'release-0.2.2' already exists. at org.jfrog.hudson.release.scm.git.GitManager$CheckoutBranchCallable.invoke(GitManager.java:234) at org.jfrog.hudson.release.scm.git.GitManager$CheckoutBranchCallable.invoke(GitManager.java:199) at hudson.FilePath.act(FilePath.java:865) at hudson.FilePath.act(FilePath.java:838) at org.jfrog.hudson.release.scm.git.GitManager.checkoutBranch(GitManager.java:60) at org.jfrog.hudson.release.scm.git.GitCoordinator.beforeReleaseVersionChange(GitCoordinator.java:80) at org.jfrog.hudson.release.gradle.GradleReleaseWrapper.setUp(GradleReleaseWrapper.java:139) at org.jfrog.hudson.gradle.ArtifactoryGradleConfigurator.setUp(ArtifactoryGradleConfigurator.java:358) at hudson.model.Build$BuildExecution.doRun(Build.java:154) at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:580) at hudson.model.Run.execute(Run.java:1575) at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:46) at hudson.model.ResourceController.execute(ResourceController.java:88) at hudson.model.Executor.run(Executor.java:237) {noformat} In this case {{release-0.2.2}} only exists on the Jenkins build machine. I need to know this and wipe the workspace in order for the build to proceed. I've tried to use the Git plugin option to "Prune remote branches before build" but that didn't help. This situation is easy to get into and takes some level of investigation to correct.
    via by Ryan Maki,
    • java.io.IOException: Failed checkout branch: Command "git checkout develop" returned status code 1: stdout: stderr: error: pathspec 'develop' did not match any file(s) known to git. at org.jfrog.hudson.release.scm.git.GitManager$CheckoutBranchCallable.invoke(GitManager.java:234) at org.jfrog.hudson.release.scm.git.GitManager$CheckoutBranchCallable.invoke(GitManager.java:199) at hudson.FilePath.act(FilePath.java:914) at hudson.FilePath.act(FilePath.java:887) at org.jfrog.hudson.release.scm.git.GitManager.checkoutBranch(GitManager.java:60) at org.jfrog.hudson.release.scm.git.GitCoordinator.buildCompleted(GitCoordinator.java:137) at org.jfrog.hudson.release.maven.MavenReleaseWrapper$ReleaseRunListener.onCompleted(MavenReleaseWrapper.java:308) at org.jfrog.hudson.release.maven.MavenReleaseWrapper$ReleaseRunListener.onCompleted(MavenReleaseWrapper.java:276) at hudson.model.listeners.RunListener.fireCompleted(RunListener.java:199) at hudson.model.Run.execute(Run.java:1720) at hudson.maven.MavenModuleSetBuild.run(MavenModuleSetBuild.java:519) at hudson.model.ResourceController.execute(ResourceController.java:88) at hudson.model.Executor.run(Executor.java:231)
    No Bugmate found.