Flowdock Post-Receive Notification Hook is not working in Proxy ? But UPM and Marketplace are connecting

Flowdock Post-Receive Notification Hook is not working in Proxy ? But UPM and Marketplace are connecting. Please let me know the problem soln. Below is out stashlog

java.net.ConnectException: Connection refused
at java.net.PlainSocketImpl.socketConnect(Native Method) ~[na:1.7.0_45]
at java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:339) ~[na:1.7.0_45]
at java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:200) ~[na:1.7.0_45]
at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:182) ~[na:1.7.0_45]
at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:392) ~[na:1.7.0_45]
at java.net.Socket.connect(Socket.java:579) ~[na:1.7.0_45]
at sun.security.ssl.SSLSocketImpl.connect(SSLSocketImpl.java:618) ~[na:1.7.0_45]
at sun.security.ssl.BaseSSLSocketImpl.connect(BaseSSLSocketImpl.java:160) ~[na:1.7.0_45]
at sun.net.NetworkClient.doConnect(NetworkClient.java:180) ~[na:1.7.0_45]
at sun.net.www.http.HttpClient.openServer(HttpClient.java:432) ~[na:1.7.0_45]
at sun.net.www.http.HttpClient.openServer(HttpClient.java:527) ~[na:1.7.0_45]
at sun.net.www.protocol.https.HttpsClient.<init>(HttpsClient.java:275) ~[na:1.7.0_45]
at sun.net.www.protocol.https.HttpsClient.New(HttpsClient.java:371) ~[na:1.7.0_45]
at sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.getNewHttpClient(AbstractDelegateHttpsURLConnection.java:191) ~[na:1.7.0_45]
at sun.net.www.protocol.http.HttpURLConnection.plainConnect(HttpURLConnection.java:975) ~[na:1.7.0_45]
at sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.connect(AbstractDelegateHttpsURLConnection.java:177) ~[na:1.7.0_45]
at sun.net.www.protocol.http.HttpURLConnection.getOutputStream(HttpURLConnection.java:1091) ~[na:1.7.0_45]
at sun.net.www.protocol.https.HttpsURLConnectionImpl.getOutputStream(HttpsURLConnectionImpl.java:250) ~[na:1.7.0_45]
at us.monoid.web.mime.MultipartContent.addContent(MultipartContent.java:33) ~[na:na]
at us.monoid.web.Resty.doPOSTOrPUT(Resty.java:393) ~[na:na]
at us.monoid.web.Resty.text(Resty.java:258) ~[na:na]
at org.tripside.stash.plugin.hook.postreceive.notification.flowdock.FlowdockPostReceiveNotificationHook.postNotification(FlowdockPostReceiveNotificationHook.java:175) ~[na:na]
at org.tripside.stash.plugin.hook.postreceive.notification.flowdock.FlowdockPostReceiveNotificationHook.processRefChanges(FlowdockPostReceiveNotificationHook.java:71) ~[na:na]
at org.tripside.stash.plugin.hook.postreceive.notification.flowdock.FlowdockPostReceiveNotificationHook.postReceive(FlowdockPostReceiveNotificationHook.java:57) ~[na:na]
at com.atlassian.stash.internal.hook.repository.AsyncPostReceiveRepositoryHookAdapter$1.visit(AsyncPostReceiveRepositoryHookAdapter.java:49) [stash-service-impl-2.8.3.jar:na]
at com.atlassian.stash.internal.hook.repository.AsyncPostReceiveRepositoryHookAdapter$1.visit(AsyncPostReceiveRepositoryHookAdapter.java:44) [stash-service-impl-2.8.3.jar:na]
at com.atlassian.stash.internal.hook.repository.DefaultRepositoryHookService$8.doInTransaction(DefaultRepositoryHookService.java:415) [stash-service-impl-2.8.3.jar:na]
at com.atlassian.stash.internal.hook.repository.DefaultRepositoryHookService$8.doInTransaction(DefaultRepositoryHookService.java:409) [stash-service-impl-2.8.3.jar:na]
at org.springframework.transaction.support.TransactionTemplate.execute(TransactionTemplate.java:131) [spring-tx-3.2.4.RELEASE.jar:3.2.4.RELEASE]
at com.atlassian.stash.internal.hook.repository.DefaultRepositoryHookService.visitEnabledHooks(DefaultRepositoryHookService.java:409) [stash-service-impl-2.8.3.jar:na]
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.7.0_45]
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) ~[na:1.7.0_45]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:1.7.0_45]
at java.lang.reflect.Method.invoke(Method.java:606) ~[na:1.7.0_45]
at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:317) [spring-aop-3.2.4.RELEASE.jar:3.2.4.RELEASE]
at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:183) [spring-aop-3.2.4.RELEASE.jar:3.2.4.RELEASE]
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:150) [spring-aop-3.2.4.RELEASE.jar:3.2.4.RELEASE]
at org.springframework.aop.aspectj.MethodInvocationProceedingJoinPoint.proceed(MethodInvocationProceedingJoinPoint.java:80) [spring-aop-3.2.4.RELEASE.jar:3.2.4.RELEASE]
at com.atlassian.stash.internal.aop.ProfilingAspect.profileMethod(ProfilingAspect.java:38) [stash-platform-2.8.3.jar:na]
at sun.reflect.GeneratedMethodAccessor145.invoke(Unknown Source) ~[na:na]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:1.7.0_45]
at java.lang.reflect.Method.invoke(Method.java:606) ~[na:1.7.0_45]
at org.springframework.aop.aspectj.AbstractAspectJAdvice.invokeAdviceMethodWithGivenArgs(AbstractAspectJAdvice.java:621) [spring-aop-3.2.4.RELEASE.jar:3.2.4.RELEASE]
at org.springframework.aop.aspectj.AbstractAspectJAdvice.invokeAdviceMethod(AbstractAspectJAdvice.java:610) [spring-aop-3.2.4.RELEASE.jar:3.2.4.RELEASE]
at org.springframework.aop.aspectj.AspectJAroundAdvice.invoke(AspectJAroundAdvice.java:65) [spring-aop-3.2.4.RELEASE.jar:3.2.4.RELEASE]
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:161) [spring-aop-3.2.4.RELEASE.jar:3.2.4.RELEASE]
at org.springframework.transaction.interceptor.TransactionInterceptor$1.proceedWithInvocation(TransactionInterceptor.java:96) [spring-tx-3.2.4.RELEASE.jar:3.2.4.RELEASE]
at org.springframework.transaction.interceptor.TransactionAspectSupport.invokeWithinTransaction(TransactionAspectSupport.java:260) [spring-tx-3.2.4.RELEASE.jar:3.2.4.RELEASE]
at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:94) [spring-tx-3.2.4.RELEASE.jar:3.2.4.RELEASE]
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172) [spring-aop-3.2.4.RELEASE.jar:3.2.4.RELEASE]
at org.springframework.aop.framework.adapter.ThrowsAdviceInterceptor.invoke(ThrowsAdviceInterceptor.java:124) [spring-aop-3.2.4.RELEASE.jar:3.2.4.RELEASE]
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:161) [spring-aop-3.2.4.RELEASE.jar:3.2.4.RELEASE]
at org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:91) [spring-aop-3.2.4.RELEASE.jar:3.2.4.RELEASE]
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172) [spring-aop-3.2.4.RELEASE.jar:3.2.4.RELEASE]
at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204) [spring-aop-3.2.4.RELEASE.jar:3.2.4.RELEASE]
at com.sun.proxy.$Proxy204.visitEnabledHooks(Unknown Source) [na:na]
at com.atlassian.stash.internal.hook.repository.AsyncPostReceiveRepositoryHookAdapter.postReceive(AsyncPostReceiveRepositoryHookAdapter.java:44) [stash-service-impl-2.8.3.jar:na]
at com.atlassian.stash.internal.hook.repository.AsyncPostReceiveRepositoryHookAdapter.onRefsChangedEvent(AsyncPostReceiveRepositoryHookAdapter.java:39) [stash-service-impl-2.8.3.jar:na]
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.7.0_45]
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) ~[na:1.7.0_45]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:1.7.0_45]
at java.lang.reflect.Method.invoke(Method.java:606) ~[na:1.7.0_45]
at com.atlassian.event.internal.SingleParameterMethodListenerInvoker.invoke(SingleParameterMethodListenerInvoker.java:36) [atlassian-event-2.3.0.jar:na]
at com.atlassian.stash.internal.event.AsyncBatchingInvokersTransformer$AsyncInvokerBatch.invoke(AsyncBatchingInvokersTransformer.java:100) [stash-platform-2.8.3.jar:na]
at com.atlassian.event.internal.AsynchronousAbleEventDispatcher$2.run(AsynchronousAbleEventDispatcher.java:66) [atlassian-event-2.3.0.jar:na]
at com.atlassian.sal.core.executor.ThreadLocalDelegateRunnable.run(ThreadLocalDelegateRunnable.java:38) [sal-core-2.10.5.jar:na]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) [na:1.7.0_45]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Th

5 answers

Hi Mohammed,

How are you configuring Stash to go via the proxy? Have you set the httpsProxy.host and httpsProxy.port system properties?

https://confluence.atlassian.com/display/DOC/Configuring+Web+Proxy+Support+for+Confluence

Cheers,

Charles

Hi Charles,

My Settings Below.

Stash Process :

01:~ # ps aux | grep stash
root 2882 0.0 0.0 5712 808 pts/1 S+ 02:26 0:00 grep stash
root 30986 15.7 14.2 1652264 1159024 pts/1 Sl 01:31 8:35 /usr/java/jdk1.7.0_45/bin/java -Djava.util.logging.config.file=/usr/local/src/atlassian-stash-2.8.3/conf/logging.properties -Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager -XX:MaxPermSize=256m -Xms512m -Xmx768m -Djava.awt.headless=true -Dfile.encoding=UTF-8 -Datlassian.standalone=STASH -Dorg.apache.jasper.runtime.BodyContentImpl.LIMIT_BUFFER=true -Dmail.mime.decodeparameters=true -Dorg.apache.catalina.connector.Response.ENFORCE_ENCODING_IN_GET_WRITER=false -Djava.library.path=/usr/local/src/atlassian-stash-2.8.3/lib/native:/usr/local/src/stash-home/lib/native -Dstash.home=/usr/local/src/stash-home -Dhttp.proxyHost=11.163.6.1 -Dhttp.proxyPort=8080 -Dhttps.proxyHost=11.163.6.1 -Dhttps.proxyPort=8080 -Djava.endorsed.dirs=/usr/local/src/atlassian-stash-2.8.3/endorsed -classpath /usr/local/src/atlassian-stash-2.8.3/bin/bootstrap.jar:/usr/local/src/atlassian-stash-2.8.3/bin/tomcat-juli.jar -Dcatalina.base=/usr/local/src/atlassian-stash-2.8.3 -Dcatalina.home=/usr/local/src/atlassian-stash-2.8.3 -Djava.io.tmpdir=/usr/local/src/atlassian-stash-2.8.3/temp org.apache.catalina.startup.Bootstrap start

JVM_OPTS:

01:~ # cat /usr/local/src/atlassian-stash-2.8.3/bin/setenv.sh | grep -i JAVA_OPTS
JAVA_OPTS="-Xms${JVM_MINIMUM_MEMORY} -Xmx${JVM_MAXIMUM_MEMORY} ${JAVA_OPTS} ${JVM_REQUIRED_ARGS} ${JVM_SUPPORT_RECOMMENDED_ARGS} ${STASH_HOME_MINUSD} -Dhttp.proxyHost=11.163.6.1 -Dhttp.proxyPort=8080 -Dhttps.proxyHost=11.163.6.1 -Dhttps.proxyPort=8080 "
JAVA_OPTS="-XX:MaxPermSize=${STASH_MAX_PERM_SIZE} ${JAVA_OPTS}"
export JAVA_OPTS

Hi Mohammed,

So it looks like that plugin is using a library called "Resty" which doesn't support a proxy by default. I've fixed the problem and created a pull request back to Tripside:

https://github.com/tripside/stash-plugin-hook-postreceive-notification-flowdock/pull/1

I should warn you I haven't actually tested this, but I'm 99% sure it will work.

Cheers,

Charles

Hi Charles,

Thanks , Great Help. Can you tell me how to update my plugin ( FlowDock Post Recv..) in stash for your new update.

Regards

Mohammed Azfar

I've manualy compiled the plugin (by running 'mvn package'). I've uploaded it here:

https://bitbucket.org/cofarrell/stash-plugin-hook-postreceive-notification-flowdock/downloads

Let me if that works for you or not.

Charles

Hi Charles,

Great !!!!, Its working know. Thanks a lot.

One more help , we would like to use NTLM Proxy can you suggest best method or procedure to integrate with stash.

Mohammed Azfar

Hi Mohammed,

Assuming you mean an NTLM proxy in front of Stash then I'm afraid we don't support them yet, and I haven't seen a plugin that provides that functionality either.

Apologies.

Charles

Suggest an answer

Log in or Sign up to answer
Atlassian Community Anniversary

Happy Anniversary, Atlassian Community!

This community is celebrating its one-year anniversary and Atlassian co-founder Mike Cannon-Brookes has all the feels.

Read more
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...

2,029 views 1 5
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