Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-63896

post-build git push fails with rebasing

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed (View Workflow)
    • Priority: Minor
    • Resolution: Not A Defect
    • Component/s: git-plugin
    • Labels:
      None
    • Environment:
      AWS Linux 2 AMI
    • Similar Issues:

      Description

       

      I have a job that rebases before pushing and for some reason it sometimes fails to push to the branch with the following output every time. It happens more often then not and I can't find anything that would cause it. I can provide more information if needed.

      > **** rev-parse HEAD^{commit} # timeout=10
       > **** rev-parse origin/master^{commit} # timeout=10
       > **** rebase origin/master # timeout=10
       > **** rebase --abort # timeout=10
      ERROR: Failed to push branch master to origin
      hudson.plugins.****.GitException: Command "**** rebase --abort" returned status code 128:
      stdout: 
      stderr: fatal: No rebase in progress?
      
      	at org.jenkinsci.plugins.****client.CliGitAPIImpl.launchCommandIn(CliGitAPIImpl.java:2450)
      	at org.jenkinsci.plugins.****client.CliGitAPIImpl.launchCommandIn(CliGitAPIImpl.java:2380)
      	at org.jenkinsci.plugins.****client.CliGitAPIImpl.launchCommandIn(CliGitAPIImpl.java:2376)
      	at org.jenkinsci.plugins.****client.CliGitAPIImpl.launchCommand(CliGitAPIImpl.java:1923)
      	at org.jenkinsci.plugins.****client.CliGitAPIImpl.launchCommand(CliGitAPIImpl.java:1935)
      	at org.jenkinsci.plugins.****client.CliGitAPIImpl$4.execute(CliGitAPIImpl.java:944)
      	at hudson.plugins.****.GitPublisher.perform(GitPublisher.java:307)
      	at hudson.tasks.BuildStepMonitor$1.perform(BuildStepMonitor.java:20)
      	at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:804)
      	at hudson.model.AbstractBuild$AbstractBuildExecution.performAllBuildSteps(AbstractBuild.java:753)
      	at hudson.model.Build$BuildExecution.post2(Build.java:177)
      	at hudson.model.AbstractBuild$AbstractBuildExecution.post(AbstractBuild.java:698)
      	at hudson.model.Run.execute(Run.java:1919)
      	at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)
      	at hudson.model.ResourceController.execute(ResourceController.java:97)
      	at hudson.model.Executor.run(Executor.java:428)
      Build step 'Git Publisher' marked build as failure
      [Checks API] No suitable checks publisher found.
      Sending notification to Discord.
      Finished: FAILURE
      
      

      The configuration of the post-build push:

       

        Attachments

          Activity

          Hide
          markewaite Mark Waite added a comment -

          If the log output is unmodified, then there is a configuration error or a bug that is causing Jenkins to use the empty string as the git tool implementation to perform the rebase.

          The log you provided shows:

          > **** rev-parse HEAD^{commit} # timeout=10
           > **** rev-parse origin/master^{commit} # timeout=10
           > **** rebase origin/master # timeout=10
           > **** rebase --abort # timeout=10
          

          It should show:

          > **** git rev-parse HEAD^{commit} # timeout=10
           > **** git rev-parse origin/master^{commit} # timeout=10
           > **** git rebase origin/master # timeout=10
           > **** git rebase --abort # timeout=10
          
          Show
          markewaite Mark Waite added a comment - If the log output is unmodified, then there is a configuration error or a bug that is causing Jenkins to use the empty string as the git tool implementation to perform the rebase. The log you provided shows: > **** rev-parse HEAD^{commit} # timeout=10 > **** rev-parse origin/master^{commit} # timeout=10 > **** rebase origin/master # timeout=10 > **** rebase --abort # timeout=10 It should show: > **** git rev-parse HEAD^{commit} # timeout=10 > **** git rev-parse origin/master^{commit} # timeout=10 > **** git rebase origin/master # timeout=10 > **** git rebase --abort # timeout=10
          Hide
          khumps Kevin Humphreys added a comment -

          Mark Waite that's what I thought at first. This is the output when it succeeds though:

           

           > **** rev-parse HEAD^{commit} # timeout=10
           > **** rev-parse origin/master^{commit} # timeout=10
          No rebase required. HEAD equals origin/master
          Pushing HEAD to branch master at repo origin
          using GIT_SSH to set credentials 

          I am not sure what causes the asterisks  in this instance because there shouldn't be any of my variables there. I am using an internal SSH key as such but it should't censor anything:

          Within the jenkins job I am using the SSH_KEY for a yarn git command by calling:

          git config core.sshCommand "ssh -i ${SSH_KEY}"
          

          This was breaking the post push completely until I ran this at the end of my jenkins job:

          git config --unset core.sshCommand

           

          Show
          khumps Kevin Humphreys added a comment - Mark Waite that's what I thought at first. This is the output when it succeeds though:   > **** rev-parse HEAD^{commit} # timeout=10 > **** rev-parse origin/master^{commit} # timeout=10 No rebase required. HEAD equals origin/master Pushing HEAD to branch master at repo origin using GIT_SSH to set credentials I am not sure what causes the asterisks  in this instance because there shouldn't be any of my variables there. I am using an internal SSH key as such but it should't censor anything: Within the jenkins job I am using the SSH_KEY for a yarn git command by calling: git config core.sshCommand "ssh -i ${SSH_KEY}" This was breaking the post push completely until I ran this at the end of my jenkins job: git config --unset core.sshCommand  
          Hide
          markewaite Mark Waite added a comment -

          Your choice to name the credential git has caused one of the plugins to decide that the string "git" needs to be masked in your output. Use a more specific name for the credential so that the password masking facility does not mask the string "git".

          Show
          markewaite Mark Waite added a comment - Your choice to name the credential git has caused one of the plugins to decide that the string "git" needs to be masked in your output. Use a more specific name for the credential so that the password masking facility does not mask the string "git".
          Hide
          khumps Kevin Humphreys added a comment - - edited

          Mark Waite no luck on renaming the credential. It seems that the base of the name is from the username (which is git as per all git ssh commands)

          Show
          khumps Kevin Humphreys added a comment - - edited Mark Waite no luck on renaming the credential. It seems that the base of the name is from the username (which is git as per all git ssh commands)
          Hide
          markewaite Mark Waite added a comment -

          Kevin Humphreys I'd prefer that you not assign this issue to me. I've offered my ideas of things you can explore and have confirmed that the git publisher inside the plugin is able to push in the cases that I've tested.

          I assign issues to myself when I am actively working on them. I don't plan to do any further work on this issue, since I believe it is a local configuration error that you'll need to diagnose and resolve in your environment.

          Show
          markewaite Mark Waite added a comment - Kevin Humphreys I'd prefer that you not assign this issue to me. I've offered my ideas of things you can explore and have confirmed that the git publisher inside the plugin is able to push in the cases that I've tested. I assign issues to myself when I am actively working on them. I don't plan to do any further work on this issue, since I believe it is a local configuration error that you'll need to diagnose and resolve in your environment.
          Hide
          khumps Kevin Humphreys added a comment - - edited

          Hi Mark Waite, my apologies. I tried to clear the assignee and whenever I did it was auto assigning to you. As for the local configuration, I am not sure what I could possibly have misconfigured to do this. This is a fresh install of jenkins with a single project.

          Show
          khumps Kevin Humphreys added a comment - - edited Hi Mark Waite , my apologies. I tried to clear the assignee and whenever I did it was auto assigning to you. As for the local configuration, I am not sure what I could possibly have misconfigured to do this. This is a fresh install of jenkins with a single project.

            People

            Assignee:
            Unassigned Unassigned
            Reporter:
            khumps Kevin Humphreys
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: