Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

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

nicolaspoisson July 20, 2017

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

 

 

3 comments

Comment

Log in or Sign up to comment
Ruben Anfinnes September 11, 2017

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?

nicolaspoisson September 11, 2017

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

Ruben Anfinnes September 11, 2017

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.

nicolaspoisson September 11, 2017

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,

Gonchik Tsymzhitov September 25, 2017

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

Ruben Anfinnes September 25, 2017

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.

Gonchik Tsymzhitov September 25, 2017

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();
}
Christian Galsterer November 12, 2017

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

Gonchik Tsymzhitov
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
November 12, 2017

Thanks!:)

Dumitrescu Liviu Tudor
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
October 30, 2018

This issue is back on version 3.3.2. Here is the call-stack : 

2018-10-29 17:19:07,808 WARN [hook-callback:thread-1] <username> ... <IP> SSH - git-receive-pack '<project>/<repository>' c.a.s.i.h.r.DefaultRepositoryHookService [<project>/<repository>[556]] Error calling com.atlassian.stash.internal.plugin.legacy.CompositeRepositoryHook.preUpdate (org.christiangalsterer.stash-filehooks-plugin:filesize-hook)
com.atlassian.bitbucket.commit.NoSuchCommitException: Commit '0000000000000000000000000000000000000000' does not exist in repository '<repository>'.
at com.atlassian.bitbucket.scm.git.command.GitCommandExitHandler.newNoSuchCommitException(GitCommandExitHandler.java:167)
at com.atlassian.bitbucket.scm.git.command.GitCommandExitHandler.evaluateStdErr(GitCommandExitHandler.java:70)
at com.atlassian.bitbucket.scm.git.command.GitCommandExitHandler.onError(GitCommandExitHandler.java:197)
at com.atlassian.stash.internal.scm.git.command.revlist.RevCoreExitHandler.onError(RevCoreExitHandler.java:52)
at com.atlassian.bitbucket.scm.DefaultCommandExitHandler.onExit(DefaultCommandExitHandler.java:31)
at com.atlassian.bitbucket.scm.BaseCommand.callExitHandler(BaseCommand.java:153)
at com.atlassian.bitbucket.scm.BaseCommand$CommandFuture.internalGet(BaseCommand.java:287)
at com.atlassian.bitbucket.scm.BaseCommand$CommandFuture.get(BaseCommand.java:251)
at com.atlassian.bitbucket.scm.BaseCommand.call(BaseCommand.java:87)
at org.christiangalsterer.stash.filehooks.plugin.hook.ChangesetServiceImpl.getCommitsBetween(ChangesetServiceImpl.java:86)
at org.christiangalsterer.stash.filehooks.plugin.hook.FileSizeHook.onReceive(FileSizeHook.java:68)
at com.atlassian.stash.internal.plugin.legacy.PreReceiveRepositoryHookAdapter.preUpdate(PreReceiveRepositoryHookAdapter.java:29)
at com.atlassian.stash.internal.plugin.legacy.CompositeRepositoryHook.lambda$preUpdate$2(CompositeRepositoryHook.java:76)
at com.atlassian.stash.internal.plugin.legacy.CompositeRepositoryHook.handlingExceptions(CompositeRepositoryHook.java:92)
at com.atlassian.stash.internal.plugin.legacy.CompositeRepositoryHook.preUpdate(CompositeRepositoryHook.java:75)
at com.atlassian.stash.internal.hook.repository.DefaultRepositoryHookService.preUpdate(DefaultRepositoryHookService.java:860)
at com.atlassian.stash.internal.hook.repository.DefaultRepositoryHookService.lambda$preUpdate$4(DefaultRepositoryHookService.java:458)
at org.springframework.transaction.support.TransactionTemplate.execute(TransactionTemplate.java:133)
at com.atlassian.stash.internal.hook.repository.DefaultRepositoryHookService.preUpdate(DefaultRepositoryHookService.java:437)
at com.atlassian.stash.internal.hook.DefaultBuiltInHookHandlerFactory.lambda$preReceive$0(DefaultBuiltInHookHandlerFactory.java:36)
at com.atlassian.stash.internal.hook.DefaultHookService.doHandleRequest(DefaultHookService.java:299)
at com.atlassian.stash.internal.hook.DefaultHookService.handleRequest(DefaultHookService.java:285)
at com.atlassian.stash.internal.hook.DefaultHookService.handleRawRequest(DefaultHookService.java:219)
at com.atlassian.stash.internal.hook.DefaultHookService$1.lambda$run$0(DefaultHookService.java:186)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.lang.Thread.run(Thread.java:745)
... 26 frames trimmed
2018-10-29 17:19:07,809 INFO [hook-callback:thread-1] <username> ... <IP> SSH - git-receive-pack '<project>/<repository>' c.a.s.i.h.r.DefaultRepositoryHookService [<project>/<repository>[556]] hook 'filesize-hook' vetoed the push request

Dumitrescu Liviu Tudor
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
October 30, 2018

I tried to push a tag. 

TAGS
AUG Leaders

Atlassian Community Events