Unable to push branch created locally when File Hooks plugin is enabled

We have run into a bug using the File Hook plugin, when creating branches locally and trying to push them to the Bitbucket server.

 

At the time of the push, the local UI shows the following error: 

$ git push origin test-branch
Total 0 (delta 0), reused 0 (delta 0)
remote: Communication breakdown with Bitbucket.
To https://xxx/scm/dl/test.git
! [remote rejected] test-branch -> test-branch (pre-receive hook declined)
error: failed to push some refs to 'https://xxx@xxx/scm/dl/test.git'

 

The server logs show the following error (stacktrace severely trimmed to due Atlassian posting rules):

com.atlassian.stash.internal.plugin.legacy.CompositeRepositoryHook.preUpdate (org.christiangalsterer.stash-filehooks-plugin:filename-hook)
com.atlassian.bitbucket.commit.NoSuchCommitException: Commit '0000000000000000000000000000000000000000' does not exist in repository 'test'.
at com.atlassian.bitbucket.scm.git.command.GitCommandExitHandler.newNoSuchCommitException(GitCommandExitHandler.java:167)
 

Disabling the File Hooks plugin enables us to push the new branches but this is of course not ideal.

 

We are running Bitbucket 5.0.4 (with plans to upgrade to latest soon) and File Hooks plugin 3.0.0.

 

Anyone aware of plans to fix this issue?

 

Regards,

Nicolas

 

 

2 comments

We are seeing exactly the same after we upgraded to Bitbucket 5.2.3 and File Hooks plugin 3.0.0 this weekend.

Have you had any luck in resolving the issue?

No, we had to disable the hook in hopes that a fix was forthcoming. We will have to look at alternatives at this point.

Thanks for gettting back. This is disencouraging, but I have emailed Christian Galsterer about the matter. Hoping for a reply and hopefully a fix from him.

Please have him contribute to this discussion if he can, or if there is already another official thread on this issue, please link to it.

Regards,

Hi! 

 

Has this thread been resolved? 

Because I have found the same stacktrace 

https://community.atlassian.com/t5/Bitbucket-questions/Unable-to-push-branch-created-by-JIRA-when-system-Hooks-plugin/qaq-p/645136

 

But it is not File Hooks plugin. 

 

 

Thank you

No resolution that I'm aware of. Mr. Galsterer have not replied to me. From what I can see in the commit log of the File Hooks plugin the last change from July 23 might be related to this issue, but no release yet.

This condition is helped me.:)

if (refChange.getFromHash().equals("0000000000000000000000000000000000000000")) {
request = new CommitsBetweenRequest.Builder(repository)
.include(refChange.getToHash())
.build();
} else {
request = new CommitsBetweenRequest.Builder(repositoryHookRequest.getRepository())
.exclude(refChange.getFromHash())
.include(refChange.getToHash())
.build();
}

A new version 3.0.1 is now available in the Atlassian Marketplace containing a fix for this.

Gonchik Tsymzhitov Community Champion Nov 12, 2017

Thanks!:)

Comment

Log in or Sign up to comment
How to earn badges on the Atlassian Community

How to earn badges on the Atlassian Community

Badges are a great way to show off community activity, whether you’re a newbie or a Champion.

Learn more
Community showcase
Published Apr 30, 2018 in Marketplace Apps

Why moving to Confluence Data Center is only a job half-done

Confluence Data Center is a deployment option that was designed for performance at scale. In other words, Confluence will handle increased traffic much reliably in a clustered environment and yo...

225 views 0 6
Read article

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you