hook plugin returns null

hi,

I am using stash 3.6.1 and have a shell script to be triggered as a pre-receive hook via the external hook plugin.

I am getting this message and the push is failing:

Writing objects: 100% (8/8), 670 bytes | 0 bytes/s, done.
Total 8 (delta 6), reused 0 (delta 0)
remote: Hook com.ngs.stash.externalhooks.hook.ExternalPreReceiveHook failed. Error:
remote: null
To ssh://git@<server repo url>:7999/hpln/backend.git
! [remote rejected] BudIceEverGreen -> BudIceEverGreen (pre-receive hook declined)
error: failed to push some refs to 'ssh://git@<server repo url>

 

any idea what is going on ?

 

3 answers

0 votes

That means that the hook com.ngs.stash.externalhooks.hook.ExternalPreReceiveHook is running into an exception and failing as a result. Stash then rejects the request to be safe and not let pushes through that shouldn't be accepted.

Looks like a programming error in the hook,. If I'd have to guess, I'd say it ran into a NullPointerException.

I'd check the logs and raise an issue with the plugin developer that provided that hook. In the mean time, I'd disable the repository hook in the repository settings.

 

you were right, there is an exception in the logs. I hope this is the right place to ask for help, let me know if not.

 

2015-02-11 19:17:45,652 WARN [threadpool:thread-5] Access key user (romanog@ROMANOG9) @1QZZ33Kx1157x519x0 95s4cq 16.60.202.173 SSH - gi
t-receive-pack '/hpln/backend.git' c.a.s.i.h.r.PreReceiveRepositoryHookAdapter Receive Hook com.ngs.stash.externalhooks.hook.ExternalPre
ReceiveHook failed.
java.lang.NullPointerException: null
at java.lang.ProcessEnvironment.validateValue(ProcessEnvironment.java:119) ~[na:1.7.0_65]
at java.lang.ProcessEnvironment.access$400(ProcessEnvironment.java:61) ~[na:1.7.0_65]
at java.lang.ProcessEnvironment$Value.valueOf(ProcessEnvironment.java:202) ~[na:1.7.0_65]
at java.lang.ProcessEnvironment$StringEnvironment.put(ProcessEnvironment.java:241) ~[na:1.7.0_65]
at java.lang.ProcessEnvironment$StringEnvironment.put(ProcessEnvironment.java:220) ~[na:1.7.0_65]
at com.ngs.stash.externalhooks.hook.ExternalPreReceiveHook.onReceive(ExternalPreReceiveHook.java:81) ~[na:na]
at com.atlassian.stash.internal.hook.repository.PreReceiveRepositoryHookAdapter$1.visit(PreReceiveRepositoryHookAdapter.java:38)
[stash-service-impl-3.6.1.jar:na]
at com.atlassian.stash.internal.hook.repository.PreReceiveRepositoryHookAdapter$1.visit(PreReceiveRepositoryHookAdapter.java:33)
[stash-service-impl-3.6.1.jar:na]
at com.atlassian.stash.internal.hook.repository.DefaultRepositoryHookService$RepositoryHookPagedTransactionCallback.doInTransact
ion(DefaultRepositoryHookService.java:616) [stash-service-impl-3.6.1.jar:na]
at com.atlassian.stash.internal.hook.repository.DefaultRepositoryHookService$RepositoryHookPagedTransactionCallback.doInTransact
ion(DefaultRepositoryHookService.java:592) [stash-service-impl-3.6.1.jar:na]
at org.springframework.transaction.support.TransactionTemplate.execute(TransactionTemplate.java:133) [spring-tx-4.1.1.RELEASE.ja
r:4.1.1.RELEASE]
at com.atlassian.stash.internal.hook.repository.DefaultRepositoryHookService.visitEnabledHooks(DefaultRepositoryHookService.java
:304) [stash-service-impl-3.6.1.jar:na]
at com.atlassian.stash.internal.plugin.OsgiSafeProxyProvider$1.invoke(OsgiSafeProxyProvider.java:93) [stash-platform-3.6.1.jar:n
a]
at com.atlassian.stash.internal.hook.repository.PreReceiveRepositoryHookAdapter.onReceive(PreReceiveRepositoryHookAdapter.java:3
3) [stash-service-impl-3.6.1.jar:na]
at com.atlassian.stash.internal.hook.DefaultBuiltInHookHandlerFactory$1.handle(DefaultBuiltInHookHandlerFactory.java:43) [stash-
service-impl-3.6.1.jar:na]
at com.atlassian.stash.internal.hook.DefaultHookService.doHandleRequest(DefaultHookService.java:341) [stash-service-impl-3.6.1.j
ar:na]
at com.atlassian.stash.internal.hook.DefaultHookService.handleRequest(DefaultHookService.java:327) [stash-service-impl-3.6.1.jar
:na]
at com.atlassian.stash.internal.hook.DefaultHookService.handleRawRequest(DefaultHookService.java:238) [stash-service-impl-3.6.1.
jar:na]
at com.atlassian.stash.internal.hook.DefaultHookService$2$1.run(DefaultHookService.java:204) [stash-service-impl-3.6.1.jar:na]
at com.atlassian.stash.internal.concurrent.StateTransferringExecutor$StateTransferringRunnable.run(StateTransferringExecutor.jav
a:69) [stash-platform-3.6.1.jar:na]
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471) [na:1.7.0_65]
at java.util.concurrent.FutureTask.run(FutureTask.java:262) [na:1.7.0_65]
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:178) [na:1.7
.0_65]
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:292) [na:1.7.0_65]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) [na:1.7.0_65]

I've added the addon-com.ngs.stash.externalhooks.external-hoo label to your question to bring it to the attention of the plugin developer

You can also try your luck opening an issue here: https://github.com/ngsru/atlassian-external-hooks/issues

thanks - I will try.

Suggest an answer

Log in or Join to answer
Community showcase
Piotr Plewa
Published Dec 27, 2017 in Bitbucket

Recipe: Deploying AWS Lambda functions with Bitbucket Pipelines

Bitbucket Pipelines helps me manage and automate a number of serverless deployments to AWS Lambda and this is how I do it. I'm building Node.js Lambda functions using node-lambda&nbsp...

662 views 0 4
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
Atlassian Team Tour

Join us on the Team Tour

We're bringing product updates and pro tips on teamwork to ten cities around the world.

Save your spot