×
We value your feedback! Please click here to access our 2024 Client Survey.
The survey will remain open until November 1st. Your perspective will help guide our product/service planning and goals for the upcoming year and beyond!

error messages returned by saveRows.view

LabKey Support Forum
error messages returned by saveRows.view Ben Bimber  2011-01-02 07:17
Status: Closed
 
I submitted data to the server using saveRows.view, where some rows lacked participantIds and dates. The server should clearly reject these; however, instead of an intelligible error message being returned to the client, it threw a java error (below) and simply returned 'Internal Server Error'. It would be better if it returned something more descriptive. That logic is easy enough to throw in an EHR validation script; however, it would be best if the server took care of validating required fields.

Below is the full message:

ERROR ExceptionUtil 2011-01-02 09:11:40,772 http-8080-Processor22 : Unhandled exception: 500: Unexpected server error
java.lang.AssertionError: All dataset rows should be associated with a participant/Id
    at org.labkey.study.query.DatasetUpdateService.getParticipant(DatasetUpdateService.java:99)
    at org.labkey.study.query.DatasetUpdateService.insertRow(DatasetUpdateService.java:77)
    at org.labkey.api.query.AbstractQueryUpdateService.insertRows(AbstractQueryUpdateService.java:99)
    at org.labkey.study.query.DatasetUpdateService.insertRows(DatasetUpdateService.java:66)
    at org.labkey.query.controllers.QueryController$CommandType$2.saveRows(QueryController.java:2672)
    at org.labkey.query.controllers.QueryController$BaseSaveRowsAction.executeJson(QueryController.java:2812)
    at org.labkey.query.controllers.QueryController$SaveRowsAction.execute(QueryController.java:2937)
    at org.labkey.query.controllers.QueryController$SaveRowsAction.execute(QueryController.java:2891)
    at org.labkey.api.action.ApiAction.handlePost(ApiAction.java:144)
    at org.labkey.api.action.ApiAction.handleRequest(ApiAction.java:95)
    at org.labkey.api.action.BaseViewAction.handleRequestInternal(BaseViewAction.java:167)
    at org.springframework.web.servlet.mvc.AbstractController.handleRequest(AbstractController.java:153)
    at org.labkey.api.action.SpringActionController.handleRequest(SpringActionController.java:349)
    at org.labkey.api.module.DefaultModule.dispatch(DefaultModule.java:756)
    at org.labkey.api.view.ViewServlet.service(ViewServlet.java:166)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:729)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:269)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188)
    at org.labkey.api.data.TransactionFilter.doFilter(TransactionFilter.java:36)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:215)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188)
    at org.labkey.core.filters.SetCharacterEncodingFilter.doFilter(SetCharacterEncodingFilter.java:118)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:215)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188)
    at org.labkey.api.module.ModuleLoader.doFilter(ModuleLoader.java:603)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:215)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188)
    at org.labkey.api.security.AuthFilter.doFilter(AuthFilter.java:138)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:215)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188)
    at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
    at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:172)
    at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
    at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:117)
    at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:108)
    at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:174)
    at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:873)
    at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:665)
    at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:528)
    at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:81)
    at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:689)
    at java.lang.Thread.run(Thread.java:619)
 
 
jeckels responded:  2011-01-20 09:45
Hi Ben,

I've converted this to a standard validation error, with the text "All dataset rows must include a value for <SUBJECT COLUMN NAME>".

Thanks,
Josh
 
Ben Bimber responded:  2011-01-20 09:47
hi josh,

thanks. i havent tried this, but will this sort of fix apply to records lacking a date or other required dataset fields? i dont know if there are any user-supplied ones besides participant/date.
 
jeckels responded:  2011-01-20 10:01
Hi Ben,

This fix is specific to missing the subject/participant value. Most other places should already be doing the right thing, though I'm sure there are spots where we could tighten up the validation and/or error messages. We'll improve them as we see them, and let us know if you notice similar problems.

Thanks,
Josh