InvalidInputException causes Service Desk error

Jason Dopson May 23, 2016

There is already a bug open that covers throwing an InvalidInputException and passing a field.  However, throwing an InvalidInputException with just an error message is supposed to work (see JSD-3592).

When using the following custom validator I'm getting a Service Desk error in the UI and in the logs.

 

import com.opensymphony.workflow.InvalidInputException
//throw new InvalidInputException("summary", "Summary is incorrect") // this has been filed as a bug
throw new InvalidInputException("Summary is incorrect") // this is *supposed* to work
 

This produces the following error in Service Desk:

Error

We were unable to submit your request. Please refresh the page and try again. Note that this will clear your request details.

If you have already tried again, contact your JIRA Administrator.

 

And the following error in catalina.out:

2016-05-23 19:37:08,979 http-nio-8080-exec-18 ERROR userid 1177x109854x2 11o9kft 1.1.1.1,192.168.0.174 /servicedesk/customer/portal/35/create/206 [c.a.s.internal.rest.CustomerWeb] Unexpected error creating request '[I18nErrorMessage(Summary is incorrect,List())]' : AnErrorToServiceDeskHttpError..com.atlassian.servicedesk.internal.errors.ServiceDeskError$$anon$1

 

Am I doing something wrong?  Is there a workaround to throw a custom error in the Service Desk UI?  This has been happening from JIRA 7.0.10/JSD 3.0.10 and up.  

1 answer

0 votes
maccamlc_old_atlassian
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
May 25, 2016

Hi @Jason Dopson

In reference to https://jira.atlassian.com/browse/JSD-3592, both of the issues you have described here have been fixed. From JIRA Service Desk 3.1.7 using either a field or not field error should be displayed correctly.

Regards

Matt

JIRA Service Desk developer

Jason Dopson May 25, 2016

Thanks for the update!  I saw 3.2.0-OD but not 3.1.7 (must have missed that email).

maccamlc_old_atlassian
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
May 25, 2016

That fix version had been missed. I just updated to reflect smile

Jason Dopson May 26, 2016

This still appears to be broken in 3.1.7.

 

26-May-2016 19:21:21.343 WARNING [http-nio-8080-exec-7] com.sun.jersey.spi.container.servlet.WebComponent.filterFormParameters A servlet request, to the URI https://jira.atldev.cloud.twc.net/rest/servicedesk/1/customer/pages/portal/35/create/206, contains form parameters in the request body but the request body has been consumed by the servlet or a servlet filter accessing the request parameters. Only resource methods using @FormParam will work as expected. Resource methods consuming the request body by other means will not work as expected.
2016-05-26 19:21:21,490 http-nio-8080-exec-7 ERROR user 1161x382x1 7bg9en 1.1.1.1,192.168.0.174 /servicedesk/customer/portal/35/create/206 [c.a.p.r.c.error.jersey.ThrowableExceptionMapper] Uncaught exception thrown by REST service: messages must have at least one entry
java.lang.IllegalArgumentException: messages must have at least one entry
at com.atlassian.pocketknife.api.commons.error.ErrorBuilder.buildSingleError(ErrorBuilder.java:107)
at com.atlassian.pocketknife.api.commons.jira.ErrorCollectionHelper.error(ErrorCollectionHelper.java:22)
at com.atlassian.servicedesk.internal.feature.customer.request.CustomerRequestManager.com$atlassian$servicedesk$internal$feature$customer$request$CustomerRequestManager$$createCustomerRequest(CustomerRequestManager.scala:109)
at com.atlassian.servicedesk.internal.feature.customer.request.CustomerRequestManager$$anonfun$createRequest$2$$anonfun$apply$1$$anonfun$apply$3$$anonfun$apply$4.apply(CustomerRequestManager.scala:86)
at com.atlassian.servicedesk.internal.feature.customer.request.CustomerRequestManager$$anonfun$createRequest$2$$anonfun$apply$1$$anonfun$apply$3$$anonfun$apply$4.apply(CustomerRequestManager.scala:85)
at scalaz.$bslash$div.flatMap(Either.scala:134)
at com.atlassian.servicedesk.internal.feature.customer.request.CustomerRequestManager$$anonfun$createRequest$2$$anonfun$apply$1$$anonfun$apply$3.apply(CustomerRequestManager.scala:85)
at com.atlassian.servicedesk.internal.feature.customer.request.CustomerRequestManager$$anonfun$createRequest$2$$anonfun$apply$1$$anonfun$apply$3.apply(CustomerRequestManager.scala:78)
at scalaz.$bslash$div.flatMap(Either.scala:134)
at com.atlassian.servicedesk.internal.feature.customer.request.CustomerRequestManager$$anonfun$createRequest$2$$anonfun$apply$1.apply(CustomerRequestManager.scala:78)
at com.atlassian.servicedesk.internal.feature.customer.request.CustomerRequestManager$$anonfun$createRequest$2$$anonfun$apply$1.apply(CustomerRequestManager.scala:77)
at scalaz.$bslash$div.flatMap(Either.scala:134)
at com.atlassian.servicedesk.internal.feature.customer.request.CustomerRequestManager$$anonfun$createRequest$2.apply(CustomerRequestManager.scala:77)
at com.atlassian.servicedesk.internal.feature.customer.request.CustomerRequestManager$$anonfun$createRequest$2.apply(CustomerRequestManager.scala:75)
at scalaz.$bslash$div.flatMap(Either.scala:134)
at com.atlassian.servicedesk.internal.feature.customer.request.CustomerRequestManager.createRequest(CustomerRequestManager.scala:75)
at com.atlassian.servicedesk.internal.feature.customer.request.InternalCustomerRequestServiceScala$$anonfun$createRequest$2$$anonfun$apply$1$$anonfun$apply$2$$anonfun$apply$3.apply(InternalCustomerRequestServiceScala.scala:127)
at com.atlassian.servicedesk.internal.feature.customer.request.InternalCustomerRequestServiceScala$$anonfun$createRequest$2$$anonfun$apply$1$$anonfun$apply$2$$anonfun$apply$3.apply(InternalCustomerRequestServiceScala.scala:123)
at scalaz.$bslash$div.flatMap(Either.scala:134)
at com.atlassian.servicedesk.internal.feature.customer.request.InternalCustomerRequestServiceScala$$anonfun$createRequest$2$$anonfun$apply$1$$anonfun$apply$2.apply(InternalCustomerRequestServiceScala.scala:123)
at com.atlassian.servicedesk.internal.feature.customer.request.InternalCustomerRequestServiceScala$$anonfun$createRequest$2$$anonfun$apply$1$$anonfun$apply$2.apply(InternalCustomerRequestServiceScala.scala:122)
at scalaz.$bslash$div.flatMap(Either.scala:134)
at com.atlassian.servicedesk.internal.feature.customer.request.InternalCustomerRequestServiceScala$$anonfun$createRequest$2$$anonfun$apply$1.apply(InternalCustomerRequestServiceScala.scala:122)
at com.atlassian.servicedesk.internal.feature.customer.request.InternalCustomerRequestServiceScala$$anonfun$createRequest$2$$anonfun$apply$1.apply(InternalCustomerRequestServiceScala.scala:121)
at scalaz.$bslash$div.flatMap(Either.scala:134)
at com.atlassian.servicedesk.internal.feature.customer.request.InternalCustomerRequestServiceScala$$anonfun$createRequest$2.apply(InternalCustomerRequestServiceScala.scala:121)
at com.atlassian.servicedesk.internal.feature.customer.request.InternalCustomerRequestServiceScala$$anonfun$createRequest$2.apply(InternalCustomerRequestServiceScala.scala:120)
at scalaz.$bslash$div.flatMap(Either.scala:134)
at com.atlassian.servicedesk.internal.feature.customer.request.InternalCustomerRequestServiceScala.createRequest(InternalCustomerRequestServiceScala.scala:120)
at com.atlassian.servicedesk.internal.rest.CustomerWeb$$anonfun$16$$anonfun$$$$$bcffe462fb1f3a83ef7575c68fe012$$$$nonfun$apply$25$$anonfun$apply$27$$anonfun$apply$28.apply(CustomerWeb.scala:649)
at com.atlassian.servicedesk.internal.rest.CustomerWeb$$anonfun$16$$anonfun$$$$$bcffe462fb1f3a83ef7575c68fe012$$$$nonfun$apply$25$$anonfun$apply$27$$anonfun$apply$28.apply(CustomerWeb.scala:647)
at scalaz.$bslash$div.flatMap(Either.scala:134)
at com.atlassian.servicedesk.internal.rest.CustomerWeb$$anonfun$16$$anonfun$$$$$bcffe462fb1f3a83ef7575c68fe012$$$$nonfun$apply$25$$anonfun$apply$27.apply(CustomerWeb.scala:647)
at com.atlassian.servicedesk.internal.rest.CustomerWeb$$anonfun$16$$anonfun$$$$$bcffe462fb1f3a83ef7575c68fe012$$$$nonfun$apply$25$$anonfun$apply$27.apply(CustomerWeb.scala:646)
at scalaz.$bslash$div.flatMap(Either.scala:134)
at com.atlassian.servicedesk.internal.rest.CustomerWeb$$anonfun$16$$anonfun$apply$20$$anonfun$apply$21$$anonfun$apply$22$$anonfun$apply$23$$anonfun$apply$24$$anonfun$apply$25.apply(CustomerWeb.scala:646)
at com.atlassian.servicedesk.internal.rest.CustomerWeb$$anonfun$16$$anonfun$apply$20$$anonfun$apply$21$$anonfun$apply$22$$anonfun$apply$23$$anonfun$apply$24$$anonfun$apply$25.apply(CustomerWeb.scala:645)
at scalaz.$bslash$div.flatMap(Either.scala:134)
at com.atlassian.servicedesk.internal.rest.CustomerWeb$$anonfun$16$$anonfun$apply$20$$anonfun$apply$21$$anonfun$apply$22$$anonfun$apply$23$$anonfun$apply$24.apply(CustomerWeb.scala:645)
at com.atlassian.servicedesk.internal.rest.CustomerWeb$$anonfun$16$$anonfun$apply$20$$anonfun$apply$21$$anonfun$apply$22$$anonfun$apply$23$$anonfun$apply$24.apply(CustomerWeb.scala:644)
at scalaz.$bslash$div.flatMap(Either.scala:134)
at com.atlassian.servicedesk.internal.rest.CustomerWeb$$anonfun$16$$anonfun$apply$20$$anonfun$apply$21$$anonfun$apply$22$$anonfun$apply$23.apply(CustomerWeb.scala:644)
at com.atlassian.servicedesk.internal.rest.CustomerWeb$$anonfun$16$$anonfun$apply$20$$anonfun$apply$21$$anonfun$apply$22$$anonfun$apply$23.apply(CustomerWeb.scala:643)
at scalaz.$bslash$div.flatMap(Either.scala:134)
at com.atlassian.servicedesk.internal.rest.CustomerWeb$$anonfun$16$$anonfun$apply$20$$anonfun$apply$21$$anonfun$apply$22.apply(CustomerWeb.scala:643)
at com.atlassian.servicedesk.internal.rest.CustomerWeb$$anonfun$16$$anonfun$apply$20$$anonfun$apply$21$$anonfun$apply$22.apply(CustomerWeb.scala:642)
at scalaz.$bslash$div.flatMap(Either.scala:134)
at com.atlassian.servicedesk.internal.rest.CustomerWeb$$anonfun$16$$anonfun$apply$20$$anonfun$apply$21.apply(CustomerWeb.scala:642)
at com.atlassian.servicedesk.internal.rest.CustomerWeb$$anonfun$16$$anonfun$apply$20$$anonfun$apply$21.apply(CustomerWeb.scala:641)
at scalaz.$bslash$div.flatMap(Either.scala:134)
at com.atlassian.servicedesk.internal.rest.CustomerWeb$$anonfun$16$$anonfun$apply$20.apply(CustomerWeb.scala:641)
at com.atlassian.servicedesk.internal.rest.CustomerWeb$$anonfun$16$$anonfun$apply$20.apply(CustomerWeb.scala:640)
at scalaz.$bslash$div.flatMap(Either.scala:134)
at com.atlassian.servicedesk.internal.rest.CustomerWeb$$anonfun$16.apply(CustomerWeb.scala:640)
at com.atlassian.servicedesk.internal.rest.CustomerWeb$$anonfun$16.apply(CustomerWeb.scala:639)
at scalaz.$bslash$div.flatMap(Either.scala:134)
at com.atlassian.servicedesk.internal.rest.CustomerWeb.submitForm(CustomerWeb.scala:639)
... 3 filtered
at java.lang.reflect.Method.invoke(Method.java:498)
at com.sun.jersey.spi.container.JavaMethodInvokerFactory$1.invoke(JavaMethodInvokerFactory.java:60)
... 13 filtered
at com.atlassian.plugins.rest.module.RestDelegatingServletFilter$JerseyOsgiServletContainer.doFilter(RestDelegatingServletFilter.java:154)
... 1 filtered
at com.atlassian.plugins.rest.module.RestDelegatingServletFilter.doFilter(RestDelegatingServletFilter.java:68)
... 37 filtered
at com.atlassian.servicedesk.internal.web.PopulateEyeballForRestFilter.doFilter(PopulateEyeballForRestFilter.java:27)
... 41 filtered
at com.atlassian.jira.security.JiraSecurityFilter.doFilter(JiraSecurityFilter.java:70)
... 22 filtered
at com.atlassian.servicedesk.internal.web.CustomerContextSettingFilter.doFilter(CustomerContextSettingFilter.java:107)
... 48 filtered
at com.atlassian.servicedesk.project.internal.web.filters.NormaliseUrlFilter.doFilter(NormaliseUrlFilter.java:25)
... 16 filtered
at com.atlassian.jira.security.JiraSecurityFilter.doFilter(JiraSecurityFilter.java:70)
... 31 filtered
at com.atlassian.servicedesk.internal.web.CustomerContextSettingFilter.lambda$invokeFilterChain$0(CustomerContextSettingFilter.java:169)
at com.atlassian.servicedesk.internal.util.scala.ScalaJavaInterOp$1.apply(ScalaJavaInterOp.java:25)
at com.atlassian.servicedesk.internal.utils.context.CustomerContextUtil$.inCustomerContext(CustomerContextUtil.scala:24)
at com.atlassian.servicedesk.internal.utils.context.CustomerContextUtil.inCustomerContext(CustomerContextUtil.scala)
at com.atlassian.servicedesk.internal.utils.context.CustomerContextServiceImpl.inCustomerContext(CustomerContextServiceImpl.java:19)
at com.atlassian.servicedesk.internal.web.CustomerContextSettingFilter.inCustomerContext(CustomerContextSettingFilter.java:160)
at com.atlassian.servicedesk.internal.web.CustomerContextSettingFilter.doFilterImpl(CustomerContextSettingFilter.java:118)
at com.atlassian.servicedesk.internal.web.CustomerContextSettingFilter.doFilter(CustomerContextSettingFilter.java:112)
... 54 filtered
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
at java.lang.Thread.run(Thread.java:745)
2016-05-26 19:23:00,093 Caesium-1-3 WARN anonymous JEMH 2 [c.a.mail.incoming.mailfetcherservice] JEMH 2[10400]: no mail server returned from getMailServer(). Exiting run()

maccamlc_old_atlassian
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
May 27, 2016

I apologise for the confusion. This fix unfortunately missed the 3.1.7 release but will be included in 3.1.8. I updated the Fix Version on the relevant issue.

Regards

Matt

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events