dhis2-devs team mailing list archive
-
dhis2-devs team
-
Mailing list archive
-
Message #47750
Re: Validation Rules Via /api/##/metadata?
Awesome thanks Morten, I'll get that deployed and test it out! :D
*Timothy Harding*
Sr. Systems Analyst, BAO Systems
+1 202-536-1541 | tharding@xxxxxxxxxxxxxx | http://www.baosystems.com | Skype:
hardingt@xxxxxxxxx | 2900 K Street, Suite 404, Washington D.C. 20007
On Wed, Nov 16, 2016 at 12:38 AM, Morten Olav Hansen <morten@xxxxxxxxx>
wrote:
> Hi Timothy
>
> This should now be fixed in latest 224, 225 and master.
>
> --
> Morten Olav Hansen
> Senior Engineer, DHIS 2
> University of Oslo
> http://www.dhis2.org
>
> On Wed, Nov 16, 2016 at 10:47 AM, Morten Olav Hansen <morten@xxxxxxxxx>
> wrote:
>
>> I found the issue, will have a fix ready today.
>>
>> --
>> Morten Olav Hansen
>> Senior Engineer, DHIS 2
>> University of Oslo
>> http://www.dhis2.org
>>
>> On Wed, Nov 16, 2016 at 10:32 AM, Morten Olav Hansen <morten@xxxxxxxxx>
>> wrote:
>>
>>> Hi
>>>
>>> I have started to look at this now, just a quick question.. when you say
>>> one of the latest builds? from when was it? there was a bunch of these
>>> kinds of issues fixed last week (transient object xyz)
>>>
>>> --
>>> Morten Olav Hansen
>>> Senior Engineer, DHIS 2
>>> University of Oslo
>>> http://www.dhis2.org
>>>
>>> On Wed, Nov 16, 2016 at 1:15 AM, Morten Olav Hansen <morten@xxxxxxxxx>
>>> wrote:
>>>
>>>> Hi Tim
>>>>
>>>> Will have a look tomorrow, probably requires a bit of special handling.
>>>>
>>>> --
>>>> Morten Olav Hansen
>>>> Senior Engineer, DHIS 2
>>>> University of Oslo
>>>> http://www.dhis2.org
>>>>
>>>> On Tue, Nov 15, 2016 at 10:52 PM, Timothy Harding <
>>>> tharding@xxxxxxxxxxxxxx> wrote:
>>>>
>>>>> Hello hello!
>>>>>
>>>>> Jim Grace and I have been attempting to upload validation rules via
>>>>> the (new?) /##/metadata, currently we are using one of the latest builds of
>>>>> 2.24.
>>>>>
>>>>> When I upload via the import metadata via the gui it works as well as
>>>>> uploading to the older /api/metaData/
>>>>> * INFO 2016-11-15 15:47:28,262 Import done. Completed in 2274.20
>>>>> seconds. (DefaultImportService.java [http-nio-18080-exec-8])
>>>>>
>>>>> But when I use the newer location below it fails and gives me this
>>>>> response back:
>>>>>
>>>>> {"httpStatus":"Internal Server Error","httpStatusCode":500,"s
>>>>> tatus":"ERROR","message":"object references an unsaved transient
>>>>> instance - save the transient instance before flushing:
>>>>> org.hisp.dhis.dataelement.DataElement"}
>>>>>
>>>>> Error using /api/24/metadata
>>>>>
>>>>> * INFO 2016-11-15 15:04:10,802 (system_dev-mer2.datim.org)
>>>>> Import:Start (DefaultMetadataImportService.java
>>>>> [http-nio-18080-exec-20])
>>>>> * INFO 2016-11-15 15:04:16,319 (system_dev-mer2.datim.org)
>>>>> Import:Preheat[REFERENCE] took 5.51 seconds (DefaultPreheatService.java
>>>>> [http-nio-18080-exec-20])
>>>>> * INFO 2016-11-15 15:04:16,323 (system_dev-mer2.datim.org)
>>>>> Import:Validation took 0.00 seconds (DefaultObjectBundleValidationService.java
>>>>> [http-nio-18080-exec-20])
>>>>> * INFO 2016-11-15 15:04:16,324 (system_dev-mer2.datim.org) Updating
>>>>> 184 object(s) of type ValidationRule (DefaultObjectBundleService.java
>>>>> [http-nio-18080-exec-20])
>>>>> org.hibernate.TransientObjectException: object references an unsaved
>>>>> transient instance - save the transient instance before flushing:
>>>>> org.hisp.dhis.dataelement.DataElement
>>>>> at org.hibernate.engine.internal.ForeignKeys.getEntityIdentifie
>>>>> rIfNotUnsaved(ForeignKeys.java:279)
>>>>> at org.hibernate.type.EntityType.getIdentifier(EntityType.java:455)
>>>>> at org.hibernate.type.ManyToOneType.nullSafeSet(ManyToOneType.j
>>>>> ava:144)
>>>>> at org.hibernate.persister.collection.AbstractCollectionPersist
>>>>> er.writeElement(AbstractCollectionPersister.java:888)
>>>>> at org.hibernate.persister.collection.AbstractCollectionPersist
>>>>> er.recreate(AbstractCollectionPersister.java:1307)
>>>>> at org.hibernate.action.internal.CollectionRecreateAction.execu
>>>>> te(CollectionRecreateAction.java:50)
>>>>> at org.hibernate.engine.spi.ActionQueue.executeActions(ActionQu
>>>>> eue.java:560)
>>>>> at org.hibernate.engine.spi.ActionQueue.executeActions(ActionQu
>>>>> eue.java:434)
>>>>> at org.hibernate.event.internal.AbstractFlushingEventListener.p
>>>>> erformExecutions(AbstractFlushingEventListener.java:337)
>>>>> at org.hibernate.event.internal.DefaultFlushEventListener.onFlu
>>>>> sh(DefaultFlushEventListener.java:39)
>>>>> at org.hibernate.internal.SessionImpl.flush(SessionImpl.java:1295)
>>>>> at org.hisp.dhis.dxf2.metadata2.objectbundle.DefaultObjectBundl
>>>>> eService.commit(DefaultObjectBundleService.java:156)
>>>>> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>>>>> at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAcce
>>>>> ssorImpl.java:62)
>>>>> at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMe
>>>>> thodAccessorImpl.java:43)
>>>>> at java.lang.reflect.Method.invoke(Method.java:498)
>>>>> at org.springframework.aop.support.AopUtils.invokeJoinpointUsin
>>>>> gReflection(AopUtils.java:302)
>>>>> at org.springframework.aop.framework.ReflectiveMethodInvocation
>>>>> .invokeJoinpoint(ReflectiveMethodInvocation.java:190)
>>>>> at org.springframework.aop.framework.ReflectiveMethodInvocation
>>>>> .proceed(ReflectiveMethodInvocation.java:157)
>>>>> at org.springframework.transaction.interceptor.TransactionInter
>>>>> ceptor$1.proceedWithInvocation(TransactionInterceptor.java:99)
>>>>> at org.springframework.transaction.interceptor.TransactionAspec
>>>>> tSupport.invokeWithinTransaction(TransactionAspectSupport.java:281)
>>>>> at org.springframework.transaction.interceptor.TransactionInter
>>>>> ceptor.invoke(TransactionInterceptor.java:96)
>>>>> at org.springframework.aop.framework.ReflectiveMethodInvocation
>>>>> .proceed(ReflectiveMethodInvocation.java:179)
>>>>> at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(
>>>>> JdkDynamicAopProxy.java:208)
>>>>> at com.sun.proxy.$Proxy189.commit(Unknown Source)
>>>>> at org.hisp.dhis.dxf2.metadata2.DefaultMetadataImportService.im
>>>>> portMetadata(DefaultMetadataImportService.java:104)
>>>>> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>>>>> at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAcce
>>>>> ssorImpl.java:62)
>>>>> at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMe
>>>>> thodAccessorImpl.java:43)
>>>>> at java.lang.reflect.Method.invoke(Method.java:498)
>>>>> at org.springframework.aop.support.AopUtils.invokeJoinpointUsin
>>>>> gReflection(AopUtils.java:302)
>>>>> at org.springframework.aop.framework.ReflectiveMethodInvocation
>>>>> .invokeJoinpoint(ReflectiveMethodInvocation.java:190)
>>>>> at org.springframework.aop.framework.ReflectiveMethodInvocation
>>>>> .proceed(ReflectiveMethodInvocation.java:157)
>>>>> at org.springframework.transaction.interceptor.TransactionInter
>>>>> ceptor$1.proceedWithInvocation(TransactionInterceptor.java:99)
>>>>> at org.springframework.transaction.interceptor.TransactionAspec
>>>>> tSupport.invokeWithinTransaction(TransactionAspectSupport.java:281)
>>>>> at org.springframework.transaction.interceptor.TransactionInter
>>>>> ceptor.invoke(TransactionInterceptor.java:96)
>>>>> at org.springframework.aop.framework.ReflectiveMethodInvocation
>>>>> .proceed(ReflectiveMethodInvocation.java:179)
>>>>> at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(
>>>>> JdkDynamicAopProxy.java:208)
>>>>> at com.sun.proxy.$Proxy191.importMetadata(Unknown Source)
>>>>> at org.hisp.dhis.webapi.controller.metadata.MetadataImportContr
>>>>> oller.postJsonMetadata(MetadataImportController.java:87)
>>>>> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>>>>> at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAcce
>>>>> ssorImpl.java:62)
>>>>> at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMe
>>>>> thodAccessorImpl.java:43)
>>>>> at java.lang.reflect.Method.invoke(Method.java:498)
>>>>> at org.springframework.web.method.support.InvocableHandlerMetho
>>>>> d.doInvoke(InvocableHandlerMethod.java:221)
>>>>> at org.springframework.web.method.support.InvocableHandlerMetho
>>>>> d.invokeForRequest(InvocableHandlerMethod.java:136)
>>>>> at org.springframework.web.servlet.mvc.method.annotation.Servle
>>>>> tInvocableHandlerMethod.invokeAndHandle(ServletInvocableHand
>>>>> lerMethod.java:110)
>>>>> at org.springframework.web.servlet.mvc.method.annotation.Reques
>>>>> tMappingHandlerAdapter.invokeHandlerMethod(RequestMappingHan
>>>>> dlerAdapter.java:817)
>>>>> at org.springframework.web.servlet.mvc.method.annotation.Reques
>>>>> tMappingHandlerAdapter.handleInternal(RequestMappingHandlerA
>>>>> dapter.java:731)
>>>>> at org.springframework.web.servlet.mvc.method.AbstractHandlerMe
>>>>> thodAdapter.handle(AbstractHandlerMethodAdapter.java:85)
>>>>> at org.springframework.web.servlet.DispatcherServlet.doDispatch
>>>>> (DispatcherServlet.java:959)
>>>>> at org.springframework.web.servlet.DispatcherServlet.doService(
>>>>> DispatcherServlet.java:893)
>>>>> at org.springframework.web.servlet.FrameworkServlet.processRequ
>>>>> est(FrameworkServlet.java:968)
>>>>> at org.springframework.web.servlet.FrameworkServlet.doPost(Fram
>>>>> eworkServlet.java:870)
>>>>> at javax.servlet.http.HttpServlet.service(HttpServlet.java:650)
>>>>> at org.springframework.web.servlet.FrameworkServlet.service(Fra
>>>>> meworkServlet.java:844)
>>>>> at javax.servlet.http.HttpServlet.service(HttpServlet.java:731)
>>>>> at org.apache.catalina.core.ApplicationFilterChain.internalDoFi
>>>>> lter(ApplicationFilterChain.java:303)
>>>>> at org.apache.catalina.core.ApplicationFilterChain.doFilter(App
>>>>> licationFilterChain.java:208)
>>>>> at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilte
>>>>> r.java:52)
>>>>> at org.apache.catalina.core.ApplicationFilterChain.internalDoFi
>>>>> lter(ApplicationFilterChain.java:241)
>>>>> at org.apache.catalina.core.ApplicationFilterChain.doFilter(App
>>>>> licationFilterChain.java:208)
>>>>> at org.springframework.security.web.FilterChainProxy$VirtualFil
>>>>> terChain.doFilter(FilterChainProxy.java:330)
>>>>> at org.springframework.security.web.access.intercept.FilterSecu
>>>>> rityInterceptor.invoke(FilterSecurityInterceptor.java:118)
>>>>> at org.springframework.security.web.access.intercept.FilterSecu
>>>>> rityInterceptor.doFilter(FilterSecurityInterceptor.java:84)
>>>>> at org.springframework.security.web.FilterChainProxy$VirtualFil
>>>>> terChain.doFilter(FilterChainProxy.java:342)
>>>>> at org.springframework.security.web.access.ExceptionTranslation
>>>>> Filter.doFilter(ExceptionTranslationFilter.java:113)
>>>>> at org.springframework.security.web.FilterChainProxy$VirtualFil
>>>>> terChain.doFilter(FilterChainProxy.java:342)
>>>>> at org.springframework.security.web.session.SessionManagementFi
>>>>> lter.doFilter(SessionManagementFilter.java:103)
>>>>> at org.springframework.security.web.FilterChainProxy$VirtualFil
>>>>> terChain.doFilter(FilterChainProxy.java:342)
>>>>> at org.springframework.security.web.authentication.AnonymousAut
>>>>> henticationFilter.doFilter(AnonymousAuthenticationFilter.java:113)
>>>>> at org.springframework.security.web.FilterChainProxy$VirtualFil
>>>>> terChain.doFilter(FilterChainProxy.java:342)
>>>>> at org.springframework.security.web.servletapi.SecurityContextH
>>>>> olderAwareRequestFilter.doFilter(SecurityContextHolderAwareR
>>>>> equestFilter.java:154)
>>>>> at org.springframework.security.web.FilterChainProxy$VirtualFil
>>>>> terChain.doFilter(FilterChainProxy.java:342)
>>>>> at org.springframework.security.web.savedrequest.RequestCacheAw
>>>>> areFilter.doFilter(RequestCacheAwareFilter.java:45)
>>>>> at org.springframework.security.web.FilterChainProxy$VirtualFil
>>>>> terChain.doFilter(FilterChainProxy.java:342)
>>>>> at org.springframework.security.web.authentication.www.BasicAut
>>>>> henticationFilter.doFilter(BasicAuthenticationFilter.java:201)
>>>>> at org.springframework.security.web.FilterChainProxy$VirtualFil
>>>>> terChain.doFilter(FilterChainProxy.java:342)
>>>>> at org.hisp.dhis.security.filter.CorsFilter.doFilter(CorsFilter
>>>>> .java:91)
>>>>> at org.springframework.security.web.FilterChainProxy$VirtualFil
>>>>> terChain.doFilter(FilterChainProxy.java:342)
>>>>> at org.springframework.security.web.authentication.AbstractAuth
>>>>> enticationProcessingFilter.doFilter(AbstractAuthenticationPr
>>>>> ocessingFilter.java:199)
>>>>> at org.springframework.security.web.FilterChainProxy$VirtualFil
>>>>> terChain.doFilter(FilterChainProxy.java:342)
>>>>> at org.springframework.security.web.authentication.AbstractAuth
>>>>> enticationProcessingFilter.doFilter(AbstractAuthenticationPr
>>>>> ocessingFilter.java:199)
>>>>> at org.springframework.security.web.FilterChainProxy$VirtualFil
>>>>> terChain.doFilter(FilterChainProxy.java:342)
>>>>> at org.hisp.dhis.security.filter.CustomAuthenticationFilter.doF
>>>>> ilter(CustomAuthenticationFilter.java:64)
>>>>> at org.springframework.security.web.FilterChainProxy$VirtualFil
>>>>> terChain.doFilter(FilterChainProxy.java:342)
>>>>> at org.springframework.security.oauth2.provider.authentication.
>>>>> OAuth2AuthenticationProcessingFilter.doFilter(OAuth2Authenti
>>>>> cationProcessingFilter.java:140)
>>>>> at org.springframework.security.web.FilterChainProxy$VirtualFil
>>>>> terChain.doFilter(FilterChainProxy.java:342)
>>>>> at org.springframework.security.web.authentication.logout.Logou
>>>>> tFilter.doFilter(LogoutFilter.java:110)
>>>>> at org.springframework.security.web.FilterChainProxy$VirtualFil
>>>>> terChain.doFilter(FilterChainProxy.java:342)
>>>>> at org.hisp.dhis.security.filter.AutomaticAccessFilter.doFilter
>>>>> (AutomaticAccessFilter.java:115)
>>>>> at org.springframework.security.web.FilterChainProxy$VirtualFil
>>>>> terChain.doFilter(FilterChainProxy.java:342)
>>>>> at org.springframework.security.web.header.HeaderWriterFilter.d
>>>>> oFilterInternal(HeaderWriterFilter.java:57)
>>>>> at org.springframework.web.filter.OncePerRequestFilter.doFilter
>>>>> (OncePerRequestFilter.java:107)
>>>>> at org.springframework.security.web.FilterChainProxy$VirtualFil
>>>>> terChain.doFilter(FilterChainProxy.java:342)
>>>>> at org.springframework.security.web.context.request.async.WebAs
>>>>> yncManagerIntegrationFilter.doFilterInternal(WebAsyncManager
>>>>> IntegrationFilter.java:50)
>>>>> at org.springframework.web.filter.OncePerRequestFilter.doFilter
>>>>> (OncePerRequestFilter.java:107)
>>>>> at org.springframework.security.web.FilterChainProxy$VirtualFil
>>>>> terChain.doFilter(FilterChainProxy.java:342)
>>>>> at org.springframework.security.web.context.SecurityContextPers
>>>>> istenceFilter.doFilter(SecurityContextPersistenceFilter.java:87)
>>>>> at org.springframework.security.web.FilterChainProxy$VirtualFil
>>>>> terChain.doFilter(FilterChainProxy.java:342)
>>>>> at org.springframework.security.web.FilterChainProxy.doFilterIn
>>>>> ternal(FilterChainProxy.java:192)
>>>>> at org.springframework.security.web.FilterChainProxy.doFilter(F
>>>>> ilterChainProxy.java:160)
>>>>> at org.springframework.web.filter.DelegatingFilterProxy.invokeD
>>>>> elegate(DelegatingFilterProxy.java:346)
>>>>> at org.springframework.web.filter.DelegatingFilterProxy.doFilte
>>>>> r(DelegatingFilterProxy.java:262)
>>>>> at org.apache.catalina.core.ApplicationFilterChain.internalDoFi
>>>>> lter(ApplicationFilterChain.java:241)
>>>>> at org.apache.catalina.core.ApplicationFilterChain.doFilter(App
>>>>> licationFilterChain.java:208)
>>>>> at org.springframework.web.filter.ShallowEtagHeaderFilter.doFil
>>>>> terInternal(ShallowEtagHeaderFilter.java:87)
>>>>> at org.hisp.dhis.servlet.filter.ExcludableShallowEtagHeaderFilt
>>>>> er.doFilterInternal(ExcludableShallowEtagHeaderFilter.java:102)
>>>>> at org.springframework.web.filter.OncePerRequestFilter.doFilter
>>>>> (OncePerRequestFilter.java:107)
>>>>> at org.apache.catalina.core.ApplicationFilterChain.internalDoFi
>>>>> lter(ApplicationFilterChain.java:241)
>>>>> at org.apache.catalina.core.ApplicationFilterChain.doFilter(App
>>>>> licationFilterChain.java:208)
>>>>> at org.springframework.orm.hibernate5.support.OpenSessionInView
>>>>> Filter.doFilterInternal(OpenSessionInViewFilter.java:151)
>>>>> at org.springframework.web.filter.OncePerRequestFilter.doFilter
>>>>> (OncePerRequestFilter.java:107)
>>>>> at org.apache.catalina.core.ApplicationFilterChain.internalDoFi
>>>>> lter(ApplicationFilterChain.java:241)
>>>>> at org.apache.catalina.core.ApplicationFilterChain.doFilter(App
>>>>> licationFilterChain.java:208)
>>>>> at org.springframework.web.filter.CharacterEncodingFilter.doFil
>>>>> terInternal(CharacterEncodingFilter.java:121)
>>>>> at org.springframework.web.filter.OncePerRequestFilter.doFilter
>>>>> (OncePerRequestFilter.java:107)
>>>>> at org.apache.catalina.core.ApplicationFilterChain.internalDoFi
>>>>> lter(ApplicationFilterChain.java:241)
>>>>> at org.apache.catalina.core.ApplicationFilterChain.doFilter(App
>>>>> licationFilterChain.java:208)
>>>>> at org.apache.catalina.core.StandardWrapperValve.invoke(Standar
>>>>> dWrapperValve.java:220)
>>>>> at org.apache.catalina.core.StandardContextValve.invoke(Standar
>>>>> dContextValve.java:122)
>>>>> at org.apache.catalina.authenticator.AuthenticatorBase.invoke(A
>>>>> uthenticatorBase.java:505)
>>>>> at org.apache.catalina.core.StandardHostValve.invoke(StandardHo
>>>>> stValve.java:169)
>>>>> at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorRepo
>>>>> rtValve.java:103)
>>>>> at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogVa
>>>>> lve.java:956)
>>>>> at org.apache.catalina.valves.RemoteIpValve.invoke(RemoteIpValv
>>>>> e.java:683)
>>>>> at org.apache.catalina.core.StandardEngineValve.invoke(Standard
>>>>> EngineValve.java:116)
>>>>> at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAd
>>>>> apter.java:436)
>>>>> at org.apache.coyote.http11.AbstractHttp11Processor.process(Abs
>>>>> tractHttp11Processor.java:1078)
>>>>> at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler
>>>>> .process(AbstractProtocol.java:625)
>>>>> at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun
>>>>> (NioEndpoint.java:1757)
>>>>> at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.run(N
>>>>> ioEndpoint.java:1716)
>>>>> at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPool
>>>>> Executor.java:1142)
>>>>> at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoo
>>>>> lExecutor.java:617)
>>>>> at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.r
>>>>> un(TaskThread.java:61)
>>>>> at java.lang.Thread.run(Thread.java:745)
>>>>>
>>>>> Any ideas? Should we stick with /api/metaData for now? I ask mostly
>>>>> because this method takes more than 360 seconds currently with preheat off
>>>>> and 2200+ seconds with it on.
>>>>>
>>>>>
>>>>> *Timothy Harding*
>>>>> Sr. Systems Analyst, BAO Systems
>>>>> +1 202-536-1541 | tharding@xxxxxxxxxxxxxx | http://www.baosystems.com
>>>>> | Skype: hardingt@xxxxxxxxx | 2900 K Street, Suite 404, Washington
>>>>> D.C. 20007
>>>>>
>>>>> _______________________________________________
>>>>> Mailing list: https://launchpad.net/~dhis2-devs
>>>>> Post to : dhis2-devs@xxxxxxxxxxxxxxxxxxx
>>>>> Unsubscribe : https://launchpad.net/~dhis2-devs
>>>>> More help : https://help.launchpad.net/ListHelp
>>>>>
>>>>>
>>>>
>>>
>>
>
Follow ups
References