fcorti / Alflytics

The Open Source Business Intelligence solution over the Alfresco platform.
http://fcorti.com
GNU Lesser General Public License v2.1
16 stars 11 forks source link

Get REST in json for audit trail Error #22

Open Dnhatsave opened 5 years ago

Dnhatsave commented 5 years ago

Hi @fcorti ,

At first i would like to congratulate you for the project, it has been very useful.

Recently i've sucessfully install the Alflytics into production enviroment for tests reason, but i have problems while execute the job get+all using the follow script on PDI kitchen:

sudo sh /opt/PENTAHO/data-integration/kitchen.sh -rep=Alflytics_TESTE -user=admin -pass=****-job=Get+all -dir=/public/Alflytics/ETL -logfile=/home/alfrescoadm/alflytics.log -level=Basic -param:alflytics.dbType=mysql -param:alflytics.getData.alfresco.entity.audits=true-param:alflytics.getData.alfresco.entity.processes=true -param:alflytics.getData.alfresco.entity.processes.getItems=true -param:alflytics.getData.alfresco.entity.repository=true -param:alflytics.getData.alfresco.entity.repository.removeDeleted=true -param:alflytics.pentaho.protocol=http -param:alflytics.pentaho.host=****-param:alflytics.pentaho.port=8080 -param:alflytics.pentaho.login=****-param:alflytics.pentaho.password=****

I will share with you some error that I found in the log file jsut bellow:

Unexpected error occurred while launching entry [hasMoreItems?.0] 2019/04/26 15:39:49 - Get REST in json for audit trail - 2019/04/26 15:39:49 - Get REST in json for audit trail - Unexpected error occurred while launching entry [Set targetFile.0] 2019/04/26 15:39:49 - Get REST in json for audit trail - 2019/04/26 15:39:49 - Get REST in json for audit trail - Unexpected error occurred while launching entry [Get REST in json for audit trail.0] 2019/04/26 15:39:49 - Get REST in json for audit trail - 2019/04/26 15:39:49 - Get REST in json for audit trail - Unexpected error occurred while launching entry [hasMoreItems?.0] 2019/04/26 15:39:49 - Get REST in json for audit trail - Unexpected error occurred while launching entry [Get REST in json for audit trail.0]

other wise when i set the param param:alflytics.getData.alfresco.entity.audits=false the job runs perfectly.

I appreciate your help.

fcorti commented 5 years ago

Hi,

I'm afraid it's a matter of permits on the file system. I see you are running the command as sudo and the error is related to the Set target file, that is supposed to write a file on the file system. Please give all the permits to the working folders and try again.

I'm pretty sure this is the problem.

Please let me know how the test goes.

Dnhatsave commented 5 years ago

Hello Francesco,

I've run the command without "sudo" and i see in log file a error releated to directory /tmp/Alflytics/Alfresco... the error was related to a json file that was not being removed. I solved this problem by gave all permissions to this folder with command sudo chmod 777 /tm/Alflytics/Alfresco... -R I do the same thing at this folders /opt/pentaho/data-integration ,/opt/pentaho/pentaho-server and /root/.kettle .

Although I have given the permissions to these folders the problem still prevails. besides these folders there are others that I should give all the permissions?

I'll share the log file for better compression.

Thank you.

alflytics.log

Dnhatsave commented 5 years ago

Hi Francesco,

I've been debugging the problem during the week and noticed a possible incompatibility between alfresco-search-services and Alflytics in some REST requests.

see the following logs:

On the data-integration side:

` Starting entry [Set alfrescoRest variables (4)] 2019/05/06 11:30:47 - Get Alfresco counter - exec(35, 0, Set alfrescoRest variables (4).0) 2019/05/06 11:30:47 - Set alfrescoRest variables (4) - Starting job entry 2019/05/06 11:30:47 - Set alfrescoRest variables (4) - Set variable alfrescoRestMethod to value [POST] 2019/05/06 11:30:47 - Set alfrescoRest variables (4) - Set variable alfrescoRestServiceBody to value [{"query":{"query": "(((TYPE:\"cm:content\") OR (TYPE:\"cm:folder\")) AND NOT (TYPE:\"cm:systemfolder\") AND (@cm:modified:[\"2001-01-01T00:00:00.000Z\" TO MAX]))","language":"afts"},"paging":{"maxItems":1,"skipCount":1000000000}}] 2019/05/06 11:30:47 - Set alfrescoRest variables (4) - Set variable alfrescoRestService to value [http://172.31.4.121:8080/alfresco/api/-default-/public/search/versions/1/search]

ERROR (version 7.1.0.0-12, build 1 from 2017-05-16 17.18.02 by buildguy) : Row nr 1 causing abort : [{"query":{"query": "(((TYPE:\"cm:content\") OR (TYPE:\"cm:folder\")) AND NOT (TYPE:\"cm:systemfolder\") AND (@cm:modified:[\"2001-01-01T00:00:00.000Z\" TO MAX]))","language":"afts"},"paging":{"maxItems":1,"skipCount":1000000000}}], [http://172.31.4.121:8080/alfresco/api/-default-/public/search/versions/1/search], [POST], [{"error":{"errorKey":"framework.exception.ApiDefault","statusCode":500,"briefSummary":"04060031 ","stackTrace":"For security reasons the stack trace is no longer displayed, but the property is kept for previous versions","descriptionURL":"https://api-explorer.alfresco.com","logId":"9778be88-2c9f-455b-ae18-01dc787e817a"}}], [500] 2019/05/06 11:30:56 - Abort.0 - ERROR (version 7.1.0.0-12, build 1 from 2017-05-16 17.18.02 by buildguy) : Rest call failed.`

On the Alfresco side

2019-05-06 11:30:56,881 ERROR [api.search.SearchApiWebscript] [http-nio-8080-exec-26] 9778be88-2c9f-455b-ae18-01dc787e817a : [org.alfresco.repo.search.impl.solr.SolrQueryHTTPClient.executeQuery(SolrQueryHTTPClient.java:571), org.alfresco.repo.search.impl.solr.SolrQueryLanguage.executeQuery(SolrQueryLanguage.java:58), org.alfresco.repo.search.impl.solr.DbOrIndexSwitchingQueryLanguage.executeQuery(DbOrIndexSwitchingQueryLanguage.java:222), org.alfresco.repo.search.impl.solr.SolrSearchService.query(SolrSearchService.java:355), org.alfresco.repo.search.SearcherComponent.query(SearcherComponent.java:84), sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method), sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62), sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43), java.lang.reflect.Method.invoke(Method.java:498), org.alfresco.repo.management.subsystems.SubsystemProxyFactory$1.invoke(SubsystemProxyFactory.java:79), org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172), org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204), com.sun.proxy.$Proxy355.query(Unknown Source), org.alfresco.repo.search.impl.SearchServiceSubSystemDelegator.query(SearchServiceSubSystemDelegator.java:133), sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method), sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62), sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43), java.lang.reflect.Method.invoke(Method.java:498), org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:317), org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:183), org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:150), net.sf.acegisecurity.intercept.method.aopalliance.MethodSecurityInterceptor.invoke(MethodSecurityInterceptor.java:80), org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172), org.alfresco.repo.security.permissions.impl.ExceptionTranslatorMethodInterceptor.invoke(ExceptionTranslatorMethodInterceptor.java:53), org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172), org.alfresco.repo.audit.AuditMethodInterceptor.proceedWithAudit(AuditMethodInterceptor.java:256), org.alfresco.repo.audit.AuditMethodInterceptor.proceed(AuditMethodInterceptor.java:216), org.alfresco.repo.audit.AuditMethodInterceptor.invoke(AuditMethodInterceptor.java:171), org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172), org.springframework.transaction.interceptor.TransactionInterceptor$1.proceedWithInvocation(TransactionInterceptor.java:96), org.springframework.transaction.interceptor.TransactionAspectSupport.invokeWithinTransaction(TransactionAspectSupport.java:260), org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:94), org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172), org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204), com.sun.proxy.$Proxy355.query(Unknown Source), org.alfresco.rest.api.search.SearchApiWebscript.execute(SearchApiWebscript.java:99), org.alfresco.repo.web.scripts.RepositoryContainer$3.execute(RepositoryContainer.java:519), org.alfresco.repo.transaction.RetryingTransactionHelper.doInTransaction(RetryingTransactionHelper.java:464), org.alfresco.repo.web.scripts.RepositoryContainer.transactionedExecute(RepositoryContainer.java:587), org.alfresco.rest.api.PublicApiRepositoryContainer.transactionedExecute(PublicApiRepositoryContainer.java:70), org.alfresco.repo.web.scripts.RepositoryContainer.transactionedExecuteAs(RepositoryContainer.java:656), org.alfresco.repo.web.scripts.RepositoryContainer.executeScriptInternal(RepositoryContainer.java:428), org.alfresco.repo.web.scripts.RepositoryContainer.executeScript(RepositoryContainer.java:308), org.alfresco.rest.api.PublicApiRepositoryContainer.access$001(PublicApiRepositoryContainer.java:51), org.alfresco.rest.api.PublicApiRepositoryContainer$1.doWork(PublicApiRepositoryContainer.java:106), org.alfresco.repo.tenant.TenantUtil.runAsWork(TenantUtil.java:126), org.alfresco.repo.tenant.TenantUtil.runAsTenant(TenantUtil.java:95), org.alfresco.rest.api.PublicApiRepositoryContainer.executeScript(PublicApiRepositoryContainer.java:102), org.springframework.extensions.webscripts.AbstractRuntime.executeScript(AbstractRuntime.java:399), org.springframework.extensions.webscripts.AbstractRuntime.executeScript(AbstractRuntime.java:210), org.alfresco.repo.web.scripts.TenantWebScriptServlet.service(TenantWebScriptServlet.java:82), org.alfresco.rest.api.PublicApiWebScriptServlet.service(PublicApiWebScriptServlet.java:62), javax.servlet.http.HttpServlet.service(HttpServlet.java:742), org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:231), org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166), org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52), org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193), org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166), org.alfresco.repo.web.filter.beans.NullFilter.doFilter(NullFilter.java:75), sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method), sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62), sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43), java.lang.reflect.Method.invoke(Method.java:498), org.alfresco.repo.management.subsystems.ChainingSubsystemProxyFactory$1.invoke(ChainingSubsystemProxyFactory.java:132), org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172), org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204), com.sun.proxy.$Proxy549.doFilter(Unknown Source), org.alfresco.repo.web.filter.beans.BeanProxyFilter.doFilter(BeanProxyFilter.java:89), org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193), org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166), org.alfresco.web.app.servlet.GlobalLocalizationFilter.doFilter(GlobalLocalizationFilter.java:68), org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193), org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166), org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:198), org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:96), org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:493), org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:140), org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:81), org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:650), org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:87), org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:342), org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:800), org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:66), org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:806), org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1498), org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49), java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149), java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624), org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61), java.lang.Thread.run(Thread.java:748)] 2019-05-06 11:31:13,528 ERROR [api.search.SearchApiWebscript] [http-nio-8080-exec-32] 9e56560e-3951-46c1-9133-70b1894d9111 : [org.alfresco.repo.search.impl.solr.SolrQueryHTTPClient.executeQuery(SolrQueryHTTPClient.java:571), org.alfresco.repo.search.impl.solr.SolrQueryLanguage.executeQuery(SolrQueryLanguage.java:58), org.alfresco.repo.search.impl.solr.DbOrIndexSwitchingQueryLanguage.executeQuery(DbOrIndexSwitchingQueryLanguage.java:222), org.alfresco.repo.search.impl.solr.SolrSearchService.query(SolrSearchService.java:355), org.alfresco.repo.search.SearcherComponent.query(SearcherComponent.java:84), sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method), sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62), sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43), java.lang.reflect.Method.invoke(Method.java:498), org.alfresco.repo.management.subsystems.SubsystemProxyFactory$1.invoke(SubsystemProxyFactory.java:79), org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172), org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204), com.sun.proxy.$Proxy355.query(Unknown Source), org.alfresco.repo.search.impl.SearchServiceSubSystemDelegator.query(SearchServiceSubSystemDelegator.java:133), sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method), sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62), sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43), java.lang.reflect.Method.invoke(Method.java:498), org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:317), org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:183), org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:150), net.sf.acegisecurity.intercept.method.aopalliance.MethodSecurityInterceptor.invoke(MethodSecurityInterceptor.java:80), org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172), org.alfresco.repo.security.permissions.impl.ExceptionTranslatorMethodInterceptor.invoke(ExceptionTranslatorMethodInterceptor.java:53), org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172), org.alfresco.repo.audit.AuditMethodInterceptor.proceedWithAudit(AuditMethodInterceptor.java:256), org.alfresco.repo.audit.AuditMethodInterceptor.proceed(AuditMethodInterceptor.java:216), org.alfresco.repo.audit.AuditMethodInterceptor.invoke(AuditMethodInterceptor.java:171), org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172), org.springframework.transaction.interceptor.TransactionInterceptor$1.proceedWithInvocation(TransactionInterceptor.java:96), org.springframework.transaction.interceptor.TransactionAspectSupport.invokeWithinTransaction(TransactionAspectSupport.java:260), org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:94), org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172), org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204), com.sun.proxy.$Proxy355.query(Unknown Source), org.alfresco.rest.api.search.SearchApiWebscript.execute(SearchApiWebscript.java:99), org.alfresco.repo.web.scripts.RepositoryContainer$3.execute(RepositoryContainer.java:519), org.alfresco.repo.transaction.RetryingTransactionHelper.doInTransaction(RetryingTransactionHelper.java:464), org.alfresco.repo.web.scripts.RepositoryContainer.transactionedExecute(RepositoryContainer.java:587), org.alfresco.rest.api.PublicApiRepositoryContainer.transactionedExecute(PublicApiRepositoryContainer.java:70), org.alfresco.repo.web.scripts.RepositoryContainer.transactionedExecuteAs(RepositoryContainer.java:656), org.alfresco.repo.web.scripts.RepositoryContainer.executeScriptInternal(RepositoryContainer.java:428), org.alfresco.repo.web.scripts.RepositoryContainer.executeScript(RepositoryContainer.java:308), org.alfresco.rest.api.PublicApiRepositoryContainer.access$001(PublicApiRepositoryContainer.java:51), org.alfresco.rest.api.PublicApiRepositoryContainer$1.doWork(PublicApiRepositoryContainer.java:106), org.alfresco.repo.tenant.TenantUtil.runAsWork(TenantUtil.java:126), org.alfresco.repo.tenant.TenantUtil.runAsTenant(TenantUtil.java:95), org.alfresco.rest.api.PublicApiRepositoryContainer.executeScript(PublicApiRepositoryContainer.java:102), org.springframework.extensions.webscripts.AbstractRuntime.executeScript(AbstractRuntime.java:399), org.springframework.extensions.webscripts.AbstractRuntime.executeScript(AbstractRuntime.java:210), org.alfresco.repo.web.scripts.TenantWebScriptServlet.service(TenantWebScriptServlet.java:82), org.alfresco.rest.api.PublicApiWebScriptServlet.service(PublicApiWebScriptServlet.java:62), javax.servlet.http.HttpServlet.service(HttpServlet.java:742), org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:231), org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166), org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52), org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193), org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166), org.alfresco.repo.web.filter.beans.NullFilter.doFilter(NullFilter.java:75), sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method), sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62), sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43), java.lang.reflect.Method.invoke(Method.java:498), org.alfresco.repo.management.subsystems.ChainingSubsystemProxyFactory$1.invoke(ChainingSubsystemProxyFactory.java:132), org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172), org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204), com.sun.proxy.$Proxy549.doFilter(Unknown Source), org.alfresco.repo.web.filter.beans.BeanProxyFilter.doFilter(BeanProxyFilter.java:89), org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193), org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166), org.alfresco.web.app.servlet.GlobalLocalizationFilter.doFilter(GlobalLocalizationFilter.java:68), org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193), org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166), org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:198), org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:96), org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:493), org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:140), org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:81), org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:650), org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:87), org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:342), org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:800), org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:66), org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:806), org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1498), org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49), java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149), java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624), org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61), java.lang.Thread.run(Thread.java:748)]

Note that for some reason alfresco-search-services shutdown after that.

Im using Alfresco Search Services 1.1.1 on Alfresco 5.2.1 and Apache Solr 6.3.0