Exception when changing state of issue

A user here is seeing this when trying to comment on an issue:

TypeError: Cannot call method "get" of null (jetbrains-youtrack-updateFixBuild->Clear Fixed in build on issue unresolve#2). Workflow rule "jetbrains-youtrack-updateFixBuild->Clear Fixed in build on issue unresolve" thrown exception in project Support. Contact rule owner root (root) for futher information.

Any ideas?

Thanks,

Kevin Jones

5 comments
Comment actions Permalink

Hi Kevin,

it seems you detached custom field "Fixed in build" from project "Support", it is required for the workflow "jetbrains-youtrack-updateFixBuild".

So you can attach field "Fixed in build" again or detach mentioned workflow from project.

0
Comment actions Permalink

Thanks for the reply. I don't think I have detached the field. I checked yesterday (before posting) and the field was still referenced,

This is a snapshot of the Projects page

teamcity.png

Kevin



Attachment(s):
teamcity.png
0
Comment actions Permalink

Sorry for long delay,

does field "State" was attached when this error occured?

Probably you modified this workflow in Workflow Editor so it now requires detached or unexisting custom fields?

Please provide also Youtrack version number and logs, thank you.

0
Comment actions Permalink

You track version is 3.0.4

> does field "State" was attached when this error occured?

Not sure what you mean by this?

I don't think the workflow has been edited. I have looked at the workflow in the editor and it looks pretty standard but I can check again.

This looks like the exception from the log file:

04 Jan 2012 16:28:26,211 ERROR [Rule                          ] [ /_events?window_id=340 [l.I.cd:methodCall_submit]] Workflow runtime exception

com.jetbrains.teamsys.database.exceptions.ConstraintsValidationException: Constrains validation exception. Causes:

  1: Can't create value from string [Duplicate] for field [State]

at jetbrains.charisma.customfields.complex.common.BundleProjectCustomFieldImpl.createValueFromString(BundleProjectCustomFieldImpl.java:135)

at jetbrains.youtrack.workflow.wrappers.CustomReferenceFieldValueResolver.resolveEnumReference(CustomReferenceFieldValueResolver.java:29)

at jetbrains.youtrack.workflow.wrappers.EntityValueResolver.unwrap(EntityValueResolver.java:42)

at jetbrains.youtrack.workflow.wrappers.CustomReferenceFieldValueResolver.set(CustomReferenceFieldValueResolver.java:39)

at jetbrains.youtrack.workflow.wrappers.EntityWrapper.set(EntityWrapper.java:242)

at jetbrains.youtrack.workflow.wrappers.IssueWrapper.set(IssueWrapper.java:97)

at jetbrains.youtrack.workflow.wrappers.IssueWrapper.set(IssueWrapper.java:26)

at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)

at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)

at java.lang.reflect.Method.invoke(Unknown Source)

at org.mozilla.javascript.MemberBox.invoke(MemberBox.java:161)

at org.mozilla.javascript.NativeJavaMethod.call(NativeJavaMethod.java:247)

at org.mozilla.javascript.optimizer.OptRuntime.call2(OptRuntime.java:76)

at org.mozilla.javascript.gen.c20._c2(jetbrains-youtrack-duplicates->When have duplicate link set issue state to Duplicate:5)

at org.mozilla.javascript.gen.c20.call(jetbrains-youtrack-duplicates->When have duplicate link set issue state to Duplicate)

at org.mozilla.javascript.ContextFactory.doTopCall(ContextFactory.java:398)

at org.mozilla.javascript.ScriptRuntime.doTopCall(ScriptRuntime.java:3065)

at org.mozilla.javascript.gen.c20.call(jetbrains-youtrack-duplicates->When have duplicate link set issue state to Duplicate)

at org.mozilla.javascript.JavaAdapter.doCall(JavaAdapter.java:578)

at org.mozilla.javascript.JavaAdapter.callMethod(JavaAdapter.java:553)

at adapter2.action(<adapter>)

at jetbrains.youtrack.workflow.model.StatelessRule.handle(StatelessRule.java:42)

at jetbrains.youtrack.workflow.persistent.WorkflowRuleImpl.beforeFlush(WorkflowRuleImpl.java:116)

at jetbrains.youtrack.workflow.persistent.WorkflowRuleImpl.access$000(WorkflowRuleImpl.java:44)

at jetbrains.youtrack.workflow.persistent.WorkflowRuleImpl$1$1.visit(WorkflowRuleImpl.java:165)

at jetbrains.youtrack.workflow.persistent.WorkflowRuleImpl$1$1.visit(WorkflowRuleImpl.java:163)

at jetbrains.mps.internal.collections.runtime.IVisitor.invoke(IVisitor.java:14)

at jetbrains.mps.internal.collections.runtime.IterableUtils.visitAll(IterableUtils.java:17)

at jetbrains.mps.internal.collections.runtime.Sequence.visitAll(Sequence.java:80)

at jetbrains.youtrack.workflow.persistent.WorkflowRuleImpl$1.invoke(WorkflowRuleImpl.java:163)

at jetbrains.youtrack.workflow.persistent.WorkflowRuleImpl$1.invoke(WorkflowRuleImpl.java:161)

at jetbrains.youtrack.workflow.model.Rule.processRuleInContext(Rule.java:101)

at jetbrains.youtrack.workflow.persistent.WorkflowRuleImpl.beforeFlush(WorkflowRuleImpl.java:161)

at jetbrains.youtrack.workflow.ext.WorkflowIssueListener.beforeFlush(WorkflowIssueListener.java:83)

at jetbrains.charisma.persistent.IssueImpl.executeBeforeFlushTrigger(IssueImpl.java:161)

at com.jetbrains.teamsys.dnq.database.TransientSessionImpl.executeBeforeFlushTriggers(TransientSessionImpl.java:996)

at com.jetbrains.teamsys.dnq.database.TransientSessionImpl.beforeFlush(TransientSessionImpl.java:1139)

at com.jetbrains.teamsys.dnq.database.TransientSessionImpl.flush(TransientSessionImpl.java:1036)

at com.jetbrains.teamsys.dnq.database.TransientSessionImpl.intermediateCommitReturnChanges(TransientSessionImpl.java:755)

at com.jetbrains.teamsys.dnq.database.TransientSessionImpl.intermediateCommit(TransientSessionImpl.java:210)

at jetbrains.mps.webr.runtime.templateComponent.PerRequestTransactionExecutor.doAfterEventsHandle(PerRequestTransactionExecutor.java:48)

at jetbrains.mps.webr.runtime.templateComponent.TemplateComponent.onAfterEventHandle(TemplateComponent.java:749)

at jetbrains.mps.webr.runtime.templateComponent.TemplateComponent.onAfterEventHandle(TemplateComponent.java:741)

at jetbrains.mps.webr.runtime.templateComponent.TemplateComponent.onAfterEventHandle(TemplateComponent.java:741)

at jetbrains.mps.webr.runtime.templateComponent.TemplateActionController.handleEventImpl(TemplateActionController.java:116)

at jetbrains.mps.webr.runtime.templateComponent.TemplateActionController.handleEvent(TemplateActionController.java:101)

at jetbrains.mps.webr.runtime.requestProcessor.EventRequestProcessor.processRequest(EventRequestProcessor.java:75)

at jetbrains.mps.webr.runtime.servlet.MainServlet.processRequest(MainServlet.java:198)

at jetbrains.mps.webr.runtime.servlet.MainServlet.doGet(MainServlet.java:93)

at jetbrains.mps.webr.runtime.servlet.MainServlet.doPost(MainServlet.java:167)

at javax.servlet.http.HttpServlet.service(HttpServlet.java:637)

at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)

at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)

at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)

at jetbrains.mps.webr.runtime.filter.QueryParameterFilter.doFilter(QueryParameterFilter.java:25)

at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)

at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)

at org.eclipse.jetty.continuation.ContinuationFilter.doFilter(ContinuationFilter.java:92)

at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)

at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)

at org.eclipse.jetty.servlets.UserAgentFilter.doFilter(UserAgentFilter.java:77)

at org.eclipse.jetty.servlets.GzipFilter.doFilter(GzipFilter.java:133)

at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)

at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)

at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)

at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)

at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)

at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)

at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)

at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:298)

at org.apache.coyote.http11.Http11AprProcessor.process(Http11AprProcessor.java:859)

at org.apache.coyote.http11.Http11AprProtocol$Http11ConnectionHandler.process(Http11AprProtocol.java:579)

at org.apache.tomcat.util.net.AprEndpoint$Worker.run(AprEndpoint.java:1555)

at java.lang.Thread.run(Unknown Source)

Thanks,

Kevin Jones

0
Comment actions Permalink

It seems you allowed custom field "State" to have empty value. Empty value is treated as "null" in workflow so you got error (TypeError: Cannot call method "get" of null...).

Thus you can either detach workflow, prohibit field "State" to be empty or modify jetbrains-youtrack-updateFixBuildworkflow(check 'issue.State != null' was added):

rule Clear Fixed in build on issue unresolve 

when issue.isReported() && issue.State != null && !(issue.State.isResolved) && issue.State.oldValue != null && issue.State.oldValue.isResolved {
  issue.Fixed in build = null;
}

Exception says that you deleted "Duplicate" value from "States" bundle and worklfow tries to create it in runtime. To fix it add "Duplicate" value to "States" bundle, fix workflow or detach it.

If you will have question feel free to ask.

0

Please sign in to leave a comment.