#4022 Fedmsg gets stuck when deleting a remote branch
Closed: Will Not/Can Not fix 6 years ago Opened 10 years ago by robyduck.

= bug description =

When deleting a remote branch on fedorahosted (in my case fedora-web repo) the fedmsg system gets stuck and doesn't send out any notification.

= bug analysis =

{{{#!python
$ git push origin :web-dl-redesign
remote: Traceback (most recent call last):
remote: File "./hooks/post-receive-chained.d/post-receive-fedmsg", line 47, in <module>
remote: commits = map(build_commit, lines)
remote: File "./hooks/post-receive-chained.d/post-receive-fedmsg", line 31, in _build_commit
remote: name=commit.author.name,
remote: File "/usr/lib64/python2.6/site-packages/gitdb/util.py", line 238, in getattr
remote: self._set_cache
(attr)
remote: File "/usr/lib/python2.6/site-packages/git/objects/commit.py", line 131, in set_cache
remote: binsha, typename, self.size, stream = self.repo.odb.stream(self.binsha)
remote: File "/usr/lib64/python2.6/site-packages/gitdb/db/base.py", line 259, in stream
remote: return self._db_query(sha).stream(sha)
remote: File "/usr/lib64/python2.6/site-packages/gitdb/db/base.py", line 243, in _db_query
remote: raise BadObject(sha)
remote: gitdb.exc.BadObject: BadObject: 0000000000000000000000000000000000000000
To ssh://git.fedorahosted.org/git/fedora-web.git
- [deleted] web-dl-redesign
}}}


The post-receive-fedmsg hook is managed by puppet.

I think the problem goes like this:

  • When a push happens, all the normal repo stuff happens first and then execution is handed off to the fedmsg hook. The fedmsg hook reads in the repo history and says "what branch is this?"
  • When a branch is deleted with a push, git first deletes the branch and then hands off execution to the fedmsg hook. The fedmsg hook tries to read in the branch -- but it has been deleted! .. and so it crashes.

We just need to protect against it.

The question is: do we want to announce branch deletion or not?

In pagure I just bail if the push is removing a branch, but it shouldn't be too hard to have a new message type for branch deletion if we want to go that way.

I am fine either way. :expressionless:

Since fedorahosted has been decommissioned, should we close this ticket?

Yes, lets.

Closing this now, please re-open if it's an issue with any new systems.

Metadata Update from @kevin:
- Issue close_status updated to: Will Not/Can Not fix
- Issue status updated to: Closed (was: Open)

6 years ago

Login to comment on this ticket.

Metadata