GIT error: Could not parse object '<revision>'

2,498 views
Skip to first unread message

Jeff

unread,
Apr 3, 2017, 5:07:12 PM4/3/17
to GoCD User Mailing List
I'm seeing this error on some of my pipelines and I'm not sure why nor how to get around it.

14:09:20.638 [go] Start updating salt-pillars at revision 58a95d9e73a9b3384b4c8736960e3701cfa1ee65 from g...@gitlab.mycompany.com:group/salt-pillars.git
14:09:20.641 STDERR: Cloning into '/var/lib/go-agent/pipelines/App_Prep_Materials/salt-pillars'...
14:09:21.866 [GIT] Fetching changes
14:09:23.056 [GIT] Performing git gc
14:09:23.058 [GIT] Reset working directory pipelines/App_Prep_Materials/salt-pillars
14:09:23.058 [GIT] Cleaning all unversioned files in working copy
14:09:23.264 [GIT] Cleaning submodule configurations in .git/config
14:09:23.366 [GIT] Updating working copy to revision 58a95d9e73a9b3384b4c8736960e3701cfa1ee65
14:09:23.369 STDERR: fatal: Could not parse object '58a95d9e73a9b3384b4c8736960e3701cfa1ee65'.
14:09:23.470 git reset failed for [pipelines/App_Prep_Materials/salt-pillars]
14:09:23.488 [go] Job completed App_Prep_Materials/122/PublishMaterials/1/update_pillars on go-agent06 [/var/lib/go-agent]

My pipeline is set to clean working directory and I've even tried removing all pipeline folders from the go-agent.

If I manually try:

go@go-agent06:~$ cd /var/lib/go-agent/pipelines/App_Prep_Materials/salt-pillars/
go@go-agent06:/var/lib/go-agent/pipelines/App_Prep_Materials/salt-pillars$ git checkout 58a95d9e73a9b3384b4c8736960e3701cfa1ee65
fatal: reference is not a tree: 58a95d9e73a9b3384b4c8736960e3701cfa1ee65

So I don't know is where it is getting revision '58a95d9e73a9b3384b4c8736960e3701cfa1ee65 ' from?

Any help would be appreciated!

-Jeff

Jeff

unread,
Apr 3, 2017, 5:12:02 PM4/3/17
to GoCD User Mailing List
Forgot to mention I'm using GoCD (server and agent) version `17.3.0`.  

Varsha Varadarajan

unread,
Apr 3, 2017, 11:10:31 PM4/3/17
to go-cd
Hi Jeff,

The GoCD agent, after fetching the changes from the remote repository, does git reset to the revision that has been identified previously by the GoCD server as the commit or revision that it needs to build the project for. Supposing you did a force push to the remote repository and the revision can no longer be found, that's when you get the error "Could not parse object.". 
When you did git checkout to the non-existent revision, git informed you that the commit was not to be found. 

Hope this helps.

- Varsha

Jeff

unread,
Apr 4, 2017, 10:34:27 AM4/4/17
to GoCD User Mailing List
I don't believe I've ever done a force push, but at this point it doesn't matter.  How do I get around it?  All my pipelines are literally blocked due to this and I can't seem to force GoCD to just use the latest revision.

Thanks!


--
You received this message because you are subscribed to the Google Groups "go-cd" group.
To unsubscribe from this group and stop receiving emails from it, send an email to go-cd+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Jyoti Singh

unread,
Apr 4, 2017, 10:39:53 AM4/4/17
to go...@googlegroups.com
Force push or recreating the repo with the same url will cause this. A combination of your db and config could confirm.


Workaround: add a '/' to the end of your material url.  This would trick Go into thinking of this as a new material and would kick the build afresh. 

Ashwanth Kumar

unread,
Apr 4, 2017, 10:48:04 AM4/4/17
to go...@googlegroups.com
Jeff the other way to think about this force push is that, it has removed a commit at HEAD, after GoCD has picked it up. The fact that your pipelines are stuck with the error could mean that.

For the work around (permanent), try adding another commit to the repo. 
If the pipelines that's dependent on this material is auto-triggered, GoCD will automatically pick it up and start the pipelines. Else you can manually trigger one of the pipelines which will make GoCD force update the dependency. Any consecutive runs of the pipeline should pick the latest commit you've made just now. 

Another temporary work around is to trigger the stuck pipelines using the >+ button (trigger with options) and choose a different version of the material. 

HTH
--

Ashwanth Kumar / ashwanthkumar.in

Jeff

unread,
Apr 4, 2017, 3:52:00 PM4/4/17
to GoCD User Mailing List
I made a small commit and it fixed it.  Thanks for the help everyone!
Reply all
Reply to author
Forward
0 new messages