christiangalsterer / stash-filehooks-plugin

An Atlassian Stash plugin to check on various file attributes, like size, name
Apache License 2.0
14 stars 27 forks source link

Unable to push after upgrade to 3.3.0 version #41

Closed paderka closed 6 years ago

paderka commented 6 years ago

We are using only file name hook where we reject commit of two files to the specific list of branches. After upgrading the plugin to the latest version a strange error occurs which suppress push to the repository (even when none of the two files were committed)

2018-03-02 19:59:24,962 WARN [threadpool:thread-4] jan.padera @1MTB2V6x1199x300436x0 ftwzfc 172.20.1.55 SSH - git-receive-pack '/<repo>' c.a.s.i.h.r.DefaultRepositoryHookService [<repo>] Error calling com.atlassian.sta sh.internal.plugin.legacy.CompositeRepositoryHook.preUpdate (org.christiangalsterer.stash-filehooks-plugin:filename-hook) java.lang.IllegalStateException: At least one commit ID must be provided to retrieve changesets at com.atlassian.bitbucket.scm.ChangesetsCommandParameters.<init>(ChangesetsCommandParameters.java:26) at com.atlassian.bitbucket.scm.ChangesetsCommandParameters.<init>(ChangesetsCommandParameters.java:10) at com.atlassian.bitbucket.scm.ChangesetsCommandParameters$Builder.build(ChangesetsCommandParameters.java:75) at org.christiangalsterer.stash.filehooks.plugin.hook.ChangesetServiceImpl.lambda$getChangesets$0(ChangesetServiceImpl.java:106) at com.atlassian.bitbucket.util.PagedIterable.iterator(PagedIterable.java:27) at org.christiangalsterer.stash.filehooks.plugin.hook.ChangesetServiceImpl.getChanges(ChangesetServiceImpl.java:49) at org.christiangalsterer.stash.filehooks.plugin.hook.ChangesetServiceImpl.getChanges(ChangesetServiceImpl.java:37) at org.christiangalsterer.stash.filehooks.plugin.hook.FileNameHook.onReceive(FileNameHook.java:76) 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.scm.git.GitQuarantineHelper.lambda$null$0(GitQuarantineHelper.java:89) at com.atlassian.stash.internal.hook.DefaultHookService.doHandleRequest(DefaultHookService.java:303) at com.atlassian.stash.internal.hook.DefaultHookService.handleRequest(DefaultHookService.java:289) at com.atlassian.stash.internal.hook.DefaultHookService.handleRawRequest(DefaultHookService.java:230) at com.atlassian.stash.internal.hook.DefaultHookService$1.lambda$run$0(DefaultHookService.java:197) at com.atlassian.stash.internal.concurrent.DefaultTransferableStateManager$StateTransferringRunnable.run(DefaultTransferableStateManager.java:166) at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) at java.util.concurrent.FutureTask.run(FutureTask.java:266) at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:180) at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:293) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) at java.lang.Thread.run(Thread.java:748) ... 26 frames trimmed

christiangalsterer commented 6 years ago

New version 3.3.1 just released and made available in Atlassian Marketplace to fix this issue.

paderka commented 6 years ago

It works! Thanks.