YACC Crashing for some users at push when matching JIRA ticket.

Description

UPDATE:
We have managed to isolate the cause of this issue. This crash occurs when a user, that is given clone/push permissions in one project, but has not even read permissions in another project, tries to push to the project where they have permissions. At the same time, the JQL matcher is configured to match for two projects, as an example:

project IN ( "PROJ1", "PROJ2" )

Where the developer has full permissions in PROJ1 but nothing in PROJ2, YACC will crash. Giving some permissions to the developer in PROJ2 stops the crash.

ORIGINAL:
Hello,

We have recently run into some crashing issues with YACC recently. Two developers have recently been getting crashes when trying to push to some JIRA tickets.

after some tries, we were able to localise the crashing to YACC. Here are a couple of stack traces that may be of some help:

  • The issue is isolated to only a few developers.

  • We haven't seen any of these errors before

  • Disabling the plugin means we can commit; we will see if it persists on older versions and update soon.

thank you in advance for your help

Git Log:

```
remote: Push rejected.
remote:
remote: refs/heads/feature/PROJ_SMR-199-PROJ-MTQ-validation-test: 7af7c927de6468f572dc4d3dcb2d9c22405f1959: PROJ_SMR-199: Unable to validate JIRA issue due to an unexpected exception. Please see stack trace in logs.
remote:
To ssh://git@proj.company.corp:2222/proj_smr/projval.git
! [remote rejected] feature/PROJ_SMR-199-PROJ-MTQ-validation-test -> feature/PROJ_SMR-199-PROJ-MTQ-validation-test (pre-receive hook declined)
error: failed to push some refs to 'ssh://git@proj.company.corp:2222/proj_smr/projval.git'
```

STASH Log:

```
2015-09-01 07:21:51,107 WARN [threadpool:thread-11079] a022018 441x111026x0 1p9ggst 53.141.174.67 SSH - git-receive-pack '/proj_smr/projval.git' o.a.c.httpclient.HttpMethodBase Going to buffer response body of large or unknown size. Using getResponseBodyAsStream instead is recommended.
2015-09-01 07:21:51,294 ERROR [threadpool:thread-11079] a022018 441x111026x0 1p9ggst 53.141.174.67 SSH - git-receive-pack '/proj_smr/projval.git' c.i.stash.plugin.YaccServiceImpl unexpected exception while trying to validate JIRA issue
com.atlassian.sal.api.net.ResponseStatusException: Unexpected response received. Status code: 400
at com.atlassian.applinks.core.auth.ApplicationLinksStringReturningResponseHandler.handle(ApplicationLinksStringReturningResponseHandler.java:19) ~[na:na]
```

Stack Trace:

```
2015-08-20 10:46:16,531 WARN [threadpool:thread-7364] a022018 646x88238x0 1ectwov 53.141.170.136 SSH - git-receive-pack '/proj_smr/projval.git' o.a.c.httpclient.HttpMethodBase Going to buffer response body of large or unknown size. Using getResponseBodyAsStream instead is recommended.
2015-08-20 10:46:16,604 ERROR [threadpool:thread-7364] a022018 646x88238x0 1ectwov 53.141.170.136 SSH - git-receive-pack '/proj_smr/projval.git' c.i.stash.plugin.YaccServiceImpl unexpected exception while trying to validate JIRA issue
com.atlassian.sal.api.net.ResponseStatusException: Unexpected response received. Status code: 400
at com.atlassian.applinks.core.auth.ApplicationLinksStringReturningResponseHandler.handle(ApplicationLinksStringReturningResponseHandler.java:19) ~[na:na]
at com.atlassian.applinks.core.auth.ApplicationLinksStringReturningResponseHandler.handle(ApplicationLinksStringReturningResponseHandler.java:13) ~[na:na]
at com.atlassian.applinks.core.auth.oauth.OAuthApplinksReturningResponseHandler.handle(OAuthApplinksReturningResponseHandler.java:51) ~[na:na]
at com.atlassian.sal.core.net.HttpClientRequest.executeAndReturn(HttpClientRequest.java:351) ~[sal-core-2.10.15.jar:na]
at com.atlassian.applinks.core.auth.ApplicationLinkRequestAdaptor.executeAndReturn(ApplicationLinkRequestAdaptor.java:78) ~[na:na]
at com.atlassian.applinks.core.auth.oauth.OAuthRequest.executeAndReturn(OAuthRequest.java:55) ~[na:na]
at com.atlassian.applinks.core.auth.AbstractApplicationLinkRequest.execute(AbstractApplicationLinkRequest.java:159) ~[na:na]
at com.isroot.stash.plugin.JiraServiceImpl.executeJqlQuery(JiraServiceImpl.java:147) ~[plugin_8441589975599849982_yacc-1.5_1436850984000.jar:na]
at com.isroot.stash.plugin.JiraServiceImpl.doesIssueMatchJqlQuery(JiraServiceImpl.java:108) ~[plugin_8441589975599849982_yacc-1.5_1436850984000.jar:na]
at com.isroot.stash.plugin.YaccServiceImpl.checkJiraIssue(YaccServiceImpl.java:222) [plugin_8441589975599849982_yacc-1.5_1436850984000.jar:na]
at com.isroot.stash.plugin.YaccServiceImpl.checkJiraIssues(YaccServiceImpl.java:204) [plugin_8441589975599849982_yacc-1.5_1436850984000.jar:na]
at com.isroot.stash.plugin.YaccServiceImpl.checkChangeset(YaccServiceImpl.java:94) [plugin_8441589975599849982_yacc-1.5_1436850984000.jar:na]
at com.isroot.stash.plugin.YaccServiceImpl.checkRefChange(YaccServiceImpl.java:59) [plugin_8441589975599849982_yacc-1.5_1436850984000.jar:na]
at com.isroot.stash.plugin.YaccHook.onReceive(YaccHook.java:43) [plugin_8441589975599849982_yacc-1.5_1436850984000.jar:na]
at com.atlassian.stash.internal.hook.repository.PreReceiveRepositoryHookAdapter$1.visit(PreReceiveRepositoryHookAdapter.java:39) [stash-service-impl-2.12.3.jar:na]
at com.atlassian.stash.internal.hook.repository.PreReceiveRepositoryHookAdapter$1.visit(PreReceiveRepositoryHookAdapter.java:33) [stash-service-impl-2.12.3.jar:na]
at com.atlassian.stash.internal.hook.repository.DefaultRepositoryHookService$8.doInTransaction(DefaultRepositoryHookService.java:411) [stash-service-impl-2.12.3.jar:na]
at com.atlassian.stash.internal.hook.repository.DefaultRepositoryHookService$8.doInTransaction(DefaultRepositoryHookService.java:405) [stash-service-impl-2.12.3.jar:na]
at org.springframework.transaction.support.TransactionTemplate.execute(TransactionTemplate.java:133) [spring-tx-4.0.2.RELEASE.jar:4.0.2.RELEASE]
at com.atlassian.stash.internal.hook.repository.DefaultRepositoryHookService.visitEnabledHooks(DefaultRepositoryHookService.java:405) [stash-service-impl-2.12.3.jar:na]
at com.sun.proxy.$Proxy223.visitEnabledHooks(Unknown Source) [na:na]
at com.atlassian.stash.internal.hook.repository.PreReceiveRepositoryHookAdapter.onReceive(PreReceiveRepositoryHookAdapter.java:33) [stash-service-impl-2.12.3.jar:na]
at com.atlassian.stash.internal.hook.DefaultBuiltInHookHandlerFactory$1.handle(DefaultBuiltInHookHandlerFactory.java:57) [stash-service-impl-2.12.3.jar:na]
at com.atlassian.stash.internal.hook.DefaultHookService.doHandleRequest(DefaultHookService.java:356) [stash-service-impl-2.12.3.jar:na]
at com.atlassian.stash.internal.hook.DefaultHookService.handleRequest(DefaultHookService.java:342) [stash-service-impl-2.12.3.jar:na]
at com.atlassian.stash.internal.hook.DefaultHookService.handleRawRequest(DefaultHookService.java:253) [stash-service-impl-2.12.3.jar:na]
at com.atlassian.stash.internal.hook.DefaultHookService$2$1.run(DefaultHookService.java:213) [stash-service-impl-2.12.3.jar:na]
at com.atlassian.stash.internal.concurrent.StateTransferringExecutor$StateTransferringRunnable.run(StateTransferringExecutor.java:69) [stash-platform-2.12.3.jar:na]
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471) [na:1.7.0_45]
at java.util.concurrent.FutureTask.run(FutureTask.java:262) [na:1.7.0_45]
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:178) [na:1.7.0_45]
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:292) [na:1.7.0_45]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) [na:1.7.0_45]
at java.lang.Thread.run(Thread.java:744) [na:1.7.0_45]
... 27 frames trimmed
```

Assignee

Unassigned

Reporter

Mohammed Davoodi

Sprint

None

Labels

Priority

Medium
Configure