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

FATAL: Could not checkout null with start point after a reset --hard to remove a commit

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Reopened (View Workflow)
    • Priority: Major
    • Resolution: Unresolved
    • Component/s: git-plugin
    • Labels:
      None
    • Environment:
      Jenkins 1.421 + git plugin 1.1.10
    • Similar Issues:

      Description

      This morning, we accidentally merged (on github' UI) one pull request to social client master. When I realized that, I reset --hard to the commit that is before the mis-merged commit and then force push (rewrite commit history).

      After that, we met this problem:

      1. The mis-merged commit is still there: https://ci.exoplatform.org/job/social-client-master-ci/changes SCL-14 | Switch to use TestNG instead of JUnit (commit: ad11e95eba2343fb8c14c04be981f74bc3035465) — hoatlevan / detail
      2. failed build with this: https://ci.exoplatform.org/view/%C2%B0%20IT%20%C2%B0/job/social-client-master-it/42/
        This is a matrix build. The parent went fine
        Started by upstream project "social-client-master-ci" build number 31
        Building on master
        Checkout:workspace / /home/swfhudson/data/jobs/social-client-master-it/workspace - hudson.remoting.LocalChannel@129a4ed
        Using strategy: Default
        Last Built Revision: Revision a63d278c2c0c2999b7686e86e4759bc4be902bb1 (origin/master)
        Checkout:workspace / /home/swfhudson/data/jobs/social-client-master-it/workspace - hudson.remoting.LocalChannel@129a4ed
        Fetching changes from 1 remote Git repository
        Fetching upstream changes from https://github.com/exosocial/exo.social.client.git
        Pruning obsolete local branches
        Commencing build of Revision 44bdde2ce4035bfd5fca0f81c18cd4d070f12135 (origin/master)
        Checking out Revision 44bdde2ce4035bfd5fca0f81c18cd4d070f12135 (origin/master)
        Cleaning workspace
        Triggering 1.2.1-SNAPSHOT
        Triggering 1.2.0-GA
        Triggering 1.3.0-SNAPSHOT
        Interrupting #42
        Finished: FAILURE
        

        But children builds failed, for example : https://ci.exoplatform.org/job/social-client-master-it/42/social.server.version=1.2.0-GA/console

        Started by upstream project "social-client-master-it" build number 42
        Building on master
        Checkout:1.2.0-GA / /home/swfhudson/data/jobs/social-client-master-it/workspace/social.server.version/1.2.0-GA - hudson.remoting.LocalChannel@129a4ed
        Using strategy: Default
        Last Built Revision: Revision a63d278c2c0c2999b7686e86e4759bc4be902bb1 (origin/master)
        Checkout:1.2.0-GA / /home/swfhudson/data/jobs/social-client-master-it/workspace/social.server.version/1.2.0-GA - hudson.remoting.LocalChannel@129a4ed
        Cloning the remote Git repository
        Cloning repository origin
        Fetching upstream changes from https://github.com/exosocial/exo.social.client.git
        Cleaning workspace
        Commencing build of Revision 44bdde2ce4035bfd5fca0f81c18cd4d070f12135 (origin/master)
        Checking out Revision 44bdde2ce4035bfd5fca0f81c18cd4d070f12135 (origin/master)
        Cleaning workspace
        FATAL: Could not checkout null with start point 44bdde2ce4035bfd5fca0f81c18cd4d070f12135
        hudson.plugins.git.GitException: Could not checkout null with start point 44bdde2ce4035bfd5fca0f81c18cd4d070f12135
        	at hudson.plugins.git.GitAPI.checkoutBranch(GitAPI.java:831)
        	at hudson.plugins.git.GitSCM$4.invoke(GitSCM.java:1143)
        	at hudson.plugins.git.GitSCM$4.invoke(GitSCM.java:1127)
        	at hudson.FilePath.act(FilePath.java:758)
        	at hudson.FilePath.act(FilePath.java:740)
        	at hudson.plugins.git.GitSCM.checkout(GitSCM.java:1127)
        	at hudson.model.AbstractProject.checkout(AbstractProject.java:1193)
        	at hudson.model.AbstractBuild$AbstractRunner.checkout(AbstractBuild.java:555)
        	at hudson.model.AbstractBuild$AbstractRunner.run(AbstractBuild.java:443)
        	at hudson.model.Run.run(Run.java:1376)
        	at hudson.matrix.MatrixRun.run(MatrixRun.java:146)
        	at hudson.model.ResourceController.execute(ResourceController.java:88)
        	at hudson.model.Executor.run(Executor.java:175)
        Caused by: hudson.plugins.git.GitException: Error performing command: git checkout -f 44bdde2ce4035bfd5fca0f81c18cd4d070f12135
        Command "git checkout -f 44bdde2ce4035bfd5fca0f81c18cd4d070f12135" returned status code 128: fatal: reference is not a tree: 44bdde2ce4035bfd5fca0f81c18cd4d070f12135
        
        	at hudson.plugins.git.GitAPI.launchCommandIn(GitAPI.java:744)
        	at hudson.plugins.git.GitAPI.launchCommand(GitAPI.java:709)
        	at hudson.plugins.git.GitAPI.launchCommand(GitAPI.java:719)
        	at hudson.plugins.git.GitAPI.checkoutBranch(GitAPI.java:818)
        	... 12 more
        Caused by: hudson.plugins.git.GitException: Command "git checkout -f 44bdde2ce4035bfd5fca0f81c18cd4d070f12135" returned status code 128: fatal: reference is not a tree: 44bdde2ce4035bfd5fca0f81c18cd4d070f12135
        
        	at hudson.plugins.git.GitAPI.launchCommandIn(GitAPI.java:739)
        	... 15 more
        

        Attachments

          Issue Links

            Activity

            Hide
            roaet Justin Hammond added a comment - - edited

            Just ran into this error. I will attempt restarting the server, but otherwise it's locked up.

            Edit:
            Alright I restarted my server and it didn't make a difference. I noticed that git was checking out origin/master but when it was building it was referencing origin1/master. I believe this was caused because I added a second git repo and removed it.

            The work around was to copy the job to a new one.

            Edit 2:
            I've been able to recreate this issue by creating a project that checks out from some repo, then in a bash script during the build process, performing a git clone on some other repo (it's crazy, yeah..).

            Show
            roaet Justin Hammond added a comment - - edited Just ran into this error. I will attempt restarting the server, but otherwise it's locked up. Edit: Alright I restarted my server and it didn't make a difference. I noticed that git was checking out origin/master but when it was building it was referencing origin1/master. I believe this was caused because I added a second git repo and removed it. The work around was to copy the job to a new one. Edit 2: I've been able to recreate this issue by creating a project that checks out from some repo, then in a bash script during the build process, performing a git clone on some other repo (it's crazy, yeah..).
            Hide
            dsachdev David Sachdev added a comment -

            I also came across this issue after adding in a second repository to pull from, and then deleting it. Also the build was referred to as (master1/master) instead of master/master) like it was prior to the addition of the repo.

            I tried to:

            1) manually remove the Workspace - didn't work
            2) remove the workspace from Jenkins - didn't work
            3) copied the job to a new job - the new job worked just fine
            4) finally I decided to delete the builds since I had added in the second repo, hoping that whatever metadata referred to the other repo would be deleted from the jobs cache - and it worked beautifully.

            Now to better understand this problem...and make the correct modifications to my build to use two repos.

            Show
            dsachdev David Sachdev added a comment - I also came across this issue after adding in a second repository to pull from, and then deleting it. Also the build was referred to as (master1/master) instead of master/master) like it was prior to the addition of the repo. I tried to: 1) manually remove the Workspace - didn't work 2) remove the workspace from Jenkins - didn't work 3) copied the job to a new job - the new job worked just fine 4) finally I decided to delete the builds since I had added in the second repo, hoping that whatever metadata referred to the other repo would be deleted from the jobs cache - and it worked beautifully. Now to better understand this problem...and make the correct modifications to my build to use two repos.
            Hide
            eguess74 eguess74 added a comment -

            I think I found a good workaround for the problem:
            When you have a faulty commit pushed and Jenkins already built, it instead of going into the project workspace and trying to reset --hard it there do the "git reset --hard" operation from the execute shell build step. IT will find the previous build revision no problem and then this command will put the project into the state you need and record that last build revision properly. There will be no issues!

            I hope that helps!

            Show
            eguess74 eguess74 added a comment - I think I found a good workaround for the problem: When you have a faulty commit pushed and Jenkins already built, it instead of going into the project workspace and trying to reset --hard it there do the "git reset --hard" operation from the execute shell build step. IT will find the previous build revision no problem and then this command will put the project into the state you need and record that last build revision properly. There will be no issues! I hope that helps!
            Hide
            wannessels Wannes Sels added a comment -

            probable root cause: DefaultBuildChooser returns lastBuildRevision when there are no changes. It should probably check if that revision still exists

            Show
            wannessels Wannes Sels added a comment - probable root cause: DefaultBuildChooser returns lastBuildRevision when there are no changes. It should probably check if that revision still exists
            Show
            ldachary Loic Dachary added a comment - I added a USD 500 bounty on this issue. https://freedomsponsors.org/issue/679/fatal-could-not-checkout-null-with-start-point-after-a-reset-hard-to-remove-a-commit

              People

              • Assignee:
                kevinsawicki Kevin Sawicki
                Reporter:
                aheritier Arnaud Héritier
              • Votes:
                6 Vote for this issue
                Watchers:
                9 Start watching this issue

                Dates

                • Created:
                  Updated: