hudson.plugins.git.GitException: Command "git push git-company@server.company.com:/srv/company.git build-121 " returned status code 128: stdout: stderr: fatal: remote part of refspec is not a valid name in build-121

Jenkins JIRA | Willem Stuursma | 5 years ago
  1. 0

    Using git plugin 1.1.17. If you accidentally leave in whitespace in the "Tag to push" field, git will create a tag with the whitespace replaced by an "_". E.g. if you configure a tag like "build-${BUILD_NUMBER} " (note the whitespace at the end of the field), the created tag will then be "build-121_" or the like. The tag will be created locally but pushing the tag will fail because it will try to push the tag without the "_", and this tag will not exist. {code} Pushing tag build-121 to repo origin ERROR: Failed to push tag build-121 to origin hudson.plugins.git.GitException: Command "git push git-company@server.company.com:/srv/company.git build-121 " returned status code 128: stdout: stderr: fatal: remote part of refspec is not a valid name in build-121 at hudson.plugins.git.GitAPI.launchCommandIn(GitAPI.java:779) at hudson.plugins.git.GitAPI.launchCommand(GitAPI.java:741) at hudson.plugins.git.GitAPI.push(GitAPI.java:797) at hudson.plugins.git.GitPublisher$3.invoke(GitPublisher.java:277) at hudson.plugins.git.GitPublisher$3.invoke(GitPublisher.java:247) at hudson.FilePath.act(FilePath.java:832) at hudson.FilePath.act(FilePath.java:814) at hudson.plugins.git.GitPublisher.perform(GitPublisher.java:247) at hudson.tasks.BuildStepMonitor$3.perform(BuildStepMonitor.java:36) at hudson.model.AbstractBuild$AbstractRunner.perform(AbstractBuild.java:705) at hudson.model.AbstractBuild$AbstractRunner.performAllBuildSteps(AbstractBuild.java:680) at hudson.model.AbstractBuild$AbstractRunner.performAllBuildSteps(AbstractBuild.java:658) at hudson.model.Build$RunnerImpl.post2(Build.java:162) at hudson.model.AbstractBuild$AbstractRunner.post(AbstractBuild.java:627) at hudson.model.Run.run(Run.java:1446) at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:46) at hudson.model.ResourceController.execute(ResourceController.java:88) at hudson.model.Executor.run(Executor.java:238) Build step 'Git Publisher' changed build result to FAILURE {code} This error kind of pointed me in the wrong direction and it took some time to figure this out, it would be really great if the field could be trimmed, hopefully it will save some people some time if they have this same problem. Alternatively, you could give an error when leaving whitespace in the "Tag to push" field.

    Jenkins JIRA | 5 years ago | Willem Stuursma
    hudson.plugins.git.GitException: Command "git push git-company@server.company.com:/srv/company.git build-121 " returned status code 128: stdout: stderr: fatal: remote part of refspec is not a valid name in build-121
  2. 0

    Using git plugin 1.1.17. If you accidentally leave in whitespace in the "Tag to push" field, git will create a tag with the whitespace replaced by an "_". E.g. if you configure a tag like "build-${BUILD_NUMBER} " (note the whitespace at the end of the field), the created tag will then be "build-121_" or the like. The tag will be created locally but pushing the tag will fail because it will try to push the tag without the "_", and this tag will not exist. {code} Pushing tag build-121 to repo origin ERROR: Failed to push tag build-121 to origin hudson.plugins.git.GitException: Command "git push git-company@server.company.com:/srv/company.git build-121 " returned status code 128: stdout: stderr: fatal: remote part of refspec is not a valid name in build-121 at hudson.plugins.git.GitAPI.launchCommandIn(GitAPI.java:779) at hudson.plugins.git.GitAPI.launchCommand(GitAPI.java:741) at hudson.plugins.git.GitAPI.push(GitAPI.java:797) at hudson.plugins.git.GitPublisher$3.invoke(GitPublisher.java:277) at hudson.plugins.git.GitPublisher$3.invoke(GitPublisher.java:247) at hudson.FilePath.act(FilePath.java:832) at hudson.FilePath.act(FilePath.java:814) at hudson.plugins.git.GitPublisher.perform(GitPublisher.java:247) at hudson.tasks.BuildStepMonitor$3.perform(BuildStepMonitor.java:36) at hudson.model.AbstractBuild$AbstractRunner.perform(AbstractBuild.java:705) at hudson.model.AbstractBuild$AbstractRunner.performAllBuildSteps(AbstractBuild.java:680) at hudson.model.AbstractBuild$AbstractRunner.performAllBuildSteps(AbstractBuild.java:658) at hudson.model.Build$RunnerImpl.post2(Build.java:162) at hudson.model.AbstractBuild$AbstractRunner.post(AbstractBuild.java:627) at hudson.model.Run.run(Run.java:1446) at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:46) at hudson.model.ResourceController.execute(ResourceController.java:88) at hudson.model.Executor.run(Executor.java:238) Build step 'Git Publisher' changed build result to FAILURE {code} This error kind of pointed me in the wrong direction and it took some time to figure this out, it would be really great if the field could be trimmed, hopefully it will save some people some time if they have this same problem. Alternatively, you could give an error when leaving whitespace in the "Tag to push" field.

    Jenkins JIRA | 5 years ago | Willem Stuursma
    hudson.plugins.git.GitException: Command "git push git-company@server.company.com:/srv/company.git build-121 " returned status code 128: stdout: stderr: fatal: remote part of refspec is not a valid name in build-121
  3. 0

    Jenkins - Can't push tag to remote repository

    Stack Overflow | 3 years ago | Atul
    hudson.plugins.git.GitException: Error performing command: /usr/bin/git push > git@github.paypal.com:atagrawal/maven-test-3.git tag02 Command "/usr/bin/git push git@github.paypal.com:atagrawal/maven-test-3.git tag02" returned > status code 128: ERROR: Permission to atagrawal/maven-test-3.git > denied to gitadmin. fatal: The remote end hung up unexpectedly
  4. Speed up your debug routine!

    Automated exception search integrated into your IDE

  5. 0

    GitHub comment 1#272744976

    GitHub | 1 week ago | umihai1
    hudson.plugins.git.GitException: Command "git.exe push https://github.com/umihai1/test1 test_free #12" returned status code 128: stdout: stderr: fatal: remote part of refspec is not a valid name in test_free #12
  6. 0

    GitHub comment 1#272747082

    GitHub | 1 week ago | umihai1
    hudson.plugins.git.GitException: Command "git.exe push https://github.com/umihai1/test1 ATRT v2.3.4#22" returned status code 128: stdout: stderr: fatal: remote part of refspec is not a valid name in ATRT v2.3.4#22

    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. hudson.plugins.git.GitException

      Command "git push git-company@server.company.com:/srv/company.git build-121 " returned status code 128: stdout: stderr: fatal: remote part of refspec is not a valid name in build-121

      at hudson.plugins.git.GitAPI.launchCommandIn()
    2. Hudson GIT plugin
      GitPublisher$3.invoke
      1. hudson.plugins.git.GitAPI.launchCommandIn(GitAPI.java:779)
      2. hudson.plugins.git.GitAPI.launchCommand(GitAPI.java:741)
      3. hudson.plugins.git.GitAPI.push(GitAPI.java:797)
      4. hudson.plugins.git.GitPublisher$3.invoke(GitPublisher.java:277)
      5. hudson.plugins.git.GitPublisher$3.invoke(GitPublisher.java:247)
      5 frames
    3. Hudson
      FilePath.act
      1. hudson.FilePath.act(FilePath.java:832)
      2. hudson.FilePath.act(FilePath.java:814)
      2 frames
    4. Hudson GIT plugin
      GitPublisher.perform
      1. hudson.plugins.git.GitPublisher.perform(GitPublisher.java:247)
      1 frame
    5. Hudson
      Executor.run
      1. hudson.tasks.BuildStepMonitor$3.perform(BuildStepMonitor.java:36)
      2. hudson.model.AbstractBuild$AbstractRunner.perform(AbstractBuild.java:705)
      3. hudson.model.AbstractBuild$AbstractRunner.performAllBuildSteps(AbstractBuild.java:680)
      4. hudson.model.AbstractBuild$AbstractRunner.performAllBuildSteps(AbstractBuild.java:658)
      5. hudson.model.Build$RunnerImpl.post2(Build.java:162)
      6. hudson.model.AbstractBuild$AbstractRunner.post(AbstractBuild.java:627)
      7. hudson.model.Run.run(Run.java:1446)
      8. hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:46)
      9. hudson.model.ResourceController.execute(ResourceController.java:88)
      10. hudson.model.Executor.run(Executor.java:238)
      10 frames