Issues with the scripts

Originally asked by Jillani Fazal on 19 May 2022 (original question)


Having issues with the script for a while now.

Errors on Jira on Prem:

Cannot get property 'name' on null object - Incoming script error

Stack Trace:

com.exalate.api.exception.script.ScriptException: Cannot get property 'name' on null object at com.exalate.error.services.ScriptExceptionCategoryService.categorizeProcessorAndIssueTrackerExceptionsIntoScriptExceptions(ScriptExceptionCategoryService.scala:40) at com.exalate.processor.ExalateProcessor.executeProcessor(ExalateProcessor.java:57) at com.exalate.processor.jira.JiraCreateIssueProcessor.executeCreateProcessor(JiraCreateIssueProcessor.java:336) at com.exalate.processor.jira.JiraCreateIssueProcessor.createIssue(JiraCreateIssueProcessor.java:189) at com.exalate.replication.request.CreateIssueSyncRequestState.transition(CreateIssueSyncRequestState.java:81) at com.exalate.replication.request.CreateIssueSyncRequestState.transition(CreateIssueSyncRequestState.java:28) at com.exalate.replication.in.RequestProcessorService.processSyncRequest(RequestProcessorService.java:454) at com.exalate.replication.in.RequestProcessorService.processSyncRequestsWithPriorities(RequestProcessorService.java:179) at com.exalate.replication.in.RequestProcessorService.processSyncRequests(RequestProcessorService.java:130) at com.exalate.replication.in.RequestWorker.runProcessing(RequestWorker.java:32) at com.exalate.replication.ReplicationWorker.lambda$run$0(ReplicationWorker.java:85) at com.exalate.node.util.concurrent.ClusteredSensitiveExecutorService.lambda$executeHandlingLocks$0(ClusteredSensitiveExecutorService.java:31) at com.exalate.node.util.concurrent.ClusteredSensitiveExecutorService.executeHandlingLocks(ClusteredSensitiveExecutorService.java:52) at com.exalate.node.util.concurrent.ClusteredSensitiveExecutorService.executeHandlingLocks(ClusteredSensitiveExecutorService.java:29) at com.exalate.replication.ReplicationWorker.run(ReplicationWorker.java:78) at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source) at java.base/java.util.concurrent.FutureTask.runAndReset(Unknown Source) at java.base/java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(Unknown Source) at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source) at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) at java.base/java.lang.Thread.run(Unknown Source) Caused by: javax.script.ScriptException: javax.script.ScriptException: java.lang.NullPointerException: Cannot get property 'name' on null object at org.codehaus.groovy.jsr223.GroovyScriptEngineImpl.eval(GroovyScriptEngineImpl.java:158) at java.scripting/javax.script.AbstractScriptEngine.eval(Unknown Source) at com.exalate.processor.ExalateProcessor.execute(ExalateProcessor.java:98) at com.exalate.processor.ExalateProcessor.executeProcessor(ExalateProcessor.java:55) ... 19 more Caused by: javax.script.ScriptException: java.lang.NullPointerException: Cannot get property 'name' on null object at org.codehaus.groovy.jsr223.GroovyScriptEngineImpl.eval(GroovyScriptEngineImpl.java:320) at org.codehaus.groovy.jsr223.GroovyScriptEngineImpl.eval(GroovyScriptEngineImpl.java:155) ... 22 more Caused by: java.lang.NullPointerException: Cannot get property 'name' on null object at org.codehaus.groovy.runtime.NullObject.getProperty(NullObject.java:60) at org.codehaus.groovy.runtime.InvokerHelper.getProperty(InvokerHelper.java:190) at org.codehaus.groovy.runtime.callsite.NullCallSite.getProperty(NullCallSite.java:46) at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callGetProperty(AbstractCallSite.java:298) at Script17.run(Script17.groovy:29) at org.codehaus.groovy.jsr223.GroovyScriptEngineImpl.eval(GroovyScriptEngineImpl.java:317) ... 23 more

------------------------------------------------------------------------------------------------------------------------

Errors on Jira Cloud:

Could not create an issue with type `Support Case` on project `SUP`: Your request could not be created. Please check the fields have been correctly filled in. ug:091bd77b-8e53-4f2d-9b68-0960cb6cdc1e is not a valid email address. Check the documentation for more details. – Create issue error

Stack Trace:

services.jcloud.exception.CreateIssueJiraCloudException: Could not create an issue with type `Support Case` on project `SUP`: Your request could not be created. Please check the fields have been correctly filled in. ug:091bd77b-8e53-4f2d-9b68-0960cb6cdc1e is not a valid email address. at services.node.JCloudTrackerExceptionCategoryService.generateCreateIssueJiraCloudTrackerException(JCloudTrackerExceptionCategoryService.scala:413) at services.jcloud.transport.ServiceDeskClient.$anonfun$createRequest$12(ServiceDeskClient.scala:110) at services.jcloud.transport.JCloudRestErrorHandlingService$$anonfun$recoverFromRestExceptionToJiraCloudTrackerExceptionOrBugException$1.applyOrElse(JCloudRestErrorHandlingService.scala:187) at services.jcloud.transport.JCloudRestErrorHandlingService$$anonfun$recoverFromRestExceptionToJiraCloudTrackerExceptionOrBugException$1.applyOrElse(JCloudRestErrorHandlingService.scala:180) at scala.concurrent.Future.$anonfun$recoverWith$1(Future.scala:417) at scala.concurrent.impl.Promise.$anonfun$transformWith$1(Promise.scala:41) at scala.concurrent.impl.CallbackRunnable.run(Promise.scala:64) at akka.dispatch.BatchingExecutor$AbstractBatch.processBatch(BatchingExecutor.scala:56) at akka.dispatch.BatchingExecutor$BlockableBatch.$anonfun$run$1(BatchingExecutor.scala:93) at scala.runtime.java8.JFunction0$mcV$sp.apply(JFunction0$mcV$sp.java:23) at scala.concurrent.BlockContext$.withBlockContext(BlockContext.scala:85) at akka.dispatch.BatchingExecutor$BlockableBatch.run(BatchingExecutor.scala:93) at akka.dispatch.TaskInvocation.run(AbstractDispatcher.scala:48) at akka.dispatch.ForkJoinExecutorConfigurator$AkkaForkJoinTask.exec(ForkJoinExecutorConfigurator.scala:48) at java.base/java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:290) at java.base/java.util.concurrent.ForkJoinPool$WorkQueue.topLevelExec(ForkJoinPool.java:1020) at java.base/java.util.concurrent.ForkJoinPool.scan(ForkJoinPool.java:1656) at java.base/java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1594) at java.base/java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:183) Caused by: com.exalate.domain.exception.issuetracker.BadRequestTrackerRestException: Your request could not be created. Please check the fields have been correctly filled in. ug:091bd77b-8e53-4f2d-9b68-0960cb6cdc1e is not a valid email address. at services.jcloud.transport.JCloudRestErrorHandlingService$.handleTrackerFourZeroZeroAndHigherRestResponse(JCloudRestErrorHandlingService.scala:91) at services.jcloud.transport.JCloudRestErrorHandlingService$.filterTrackerRestErrorResponse(JCloudRestErrorHandlingService.scala:81) at services.jcloud.transport.ServiceDeskClient.$anonfun$createRequest$4(ServiceDeskClient.scala:95) at scala.concurrent.Future.$anonfun$flatMap$1(Future.scala:307) ... 14 more

It has been going for a while now and blocking our operations. Please have a look and advise how the script can be fixed in order to avoid this in the future.

Looking very much forward for the resolution.

Posting this on behalf of an Exalate Client Ori Arbel (oria@Cyrebro.io)


Answer by Jillani Fazal on 23 May 2022

Hi Ori Arbel

“Cannot get property on null” means that there is a line in script saying ... .name and that … can be null (not present). The rules need to be checked closely. May I know if it is possible for you to share the error stack trace along with the incoming and outgoing sync rules, please?

Also, check this community link, where the same issue has been discussed.

Resolution sync issue - Cannot get property name on null object (old community)