Redpill-Linpro / alfresco-listmanager

Component used to manage custom list of values used in metadata forms.
13 stars 6 forks source link

Lists disappear after upgrading from 4.1.4 to 4.1.7 #1

Closed Ashex closed 6 years ago

Ashex commented 10 years ago

This is a continuation of the issue reported at the master repo: https://github.com/acando/alfresco-listmanager/issues/11

I ran the query in the javascript console with Solr and came back with these results:

null (cm:thumbnail): workspace://version2Store/645e847f-e7ae-40e6-8fbe-e110b88c4b6c
demoIndustry_value (cm:folder): workspace://SpacesStore/3fa1b55f-8784-4b96-bec7-971868f3585e
null (cm:content): workspace://version2Store/57a75e1b-0f32-44d0-8694-1edd406c640f
demoConfidential_value (cm:folder): workspace://SpacesStore/7aa99d20-60ad-4f12-b188-ef090f7f58aa
demoSFTeam_value (cm:folder): workspace://SpacesStore/fd1947bf-391f-4867-9382-45f951f394bf
demoSFversion_value (cm:folder): workspace://SpacesStore/34713897-dee5-4c13-999b-d97045265db3
null (cm:thumbnail): workspace://SpacesStore/1590067c-cc0b-420c-8082-9755a431ff56
scLanguage_value (cm:folder): workspace://SpacesStore/199ddc41-43d6-4f0c-a821-ce5a98f46057
scCategory_value (cm:folder): workspace://SpacesStore/34d7e745-2056-49bf-b911-5bda4e251fd7

Looking up the null items, The first two are versions for a document in a site while the last is a thumbnail for an image in another. I have no idea why these are coming up in the results. If I execute the same query with Lucene I do not get the null items in the results.

Edit For comparison, results from the 4.1.4 Production environment:

null (cm:folder): workspace://SpacesStore/3fa1b55f-8784-4b96-bec7-971868f3585e
null (cm:folder): workspace://SpacesStore/7aa99d20-60ad-4f12-b188-ef090f7f58aa
null (cm:folder): workspace://SpacesStore/fd1947bf-391f-4867-9382-45f951f394bf
null (cm:folder): workspace://SpacesStore/34713897-dee5-4c13-999b-d97045265db3
null (cm:folder): workspace://SpacesStore/199ddc41-43d6-4f0c-a821-ce5a98f46057
null (cm:folder): workspace://SpacesStore/34d7e745-2056-49bf-b911-5bda4e251fd7
billerby commented 10 years ago

Ahh, its fetching results from the version store as well (dont ask my why it get hits in that path though), try to modify the query like this to only search in the workspace store:

var nodes = search.luceneSearch("workspace://SpacesStore","PATH:\"/app:company_home/app:dictionary/cm:Lists/*\"", "@{http://www.acando.com/model/listmanager/1.0}ordinalNumber", true);

for each(var node in nodes) {
    logger.log(node.properties.title + ' (' + node.typeShort + '): ' + node.nodeRef);
}

If this works we need to add the store to all queries and hopefully it will work after that.

Ashex commented 10 years ago

I'm also a bit puzzled why the query hit that path, after defining the store the query returns the same results as 4.1.4 Production.

billerby commented 10 years ago

Argghhh made a small typo that has to be fixed, stay tuned for a new release...

billerby commented 10 years ago

@Ashex1 the typo is fixed on HEAD.

Ashex commented 10 years ago

I've built HEAD and verified that lists appear in the admin gui and with the the list template. Thank you for taking the time to troubleshoot with me, I greatly appreciate it!

Ashex commented 10 years ago

Hate to say this, but it's not resolved :( I had forgotten to switch back from Lucene. Will update this comment with results of troubleshooting momentarily.

Edit: I'm still getting the same results with Solr, it's very suspicious that it's returning results outside the store path so I'm going to rebuild the index.

Ashex commented 10 years ago

Turning up debugging I stumbled upon this:

2014-02-10 11:29:30,484  DEBUG [impl.solr.SolrQueryHTTPClient] [http-8080-9] Sent :/solr/alfresco/alfresco?wt=json&fl=DBID%2Cscore&rows=1000&df=TEXT&start=0&locale=en_US&fq=%7B%21afts%7DAUTHORITY_FILTER_FROM_JSON&fq=%7B%21afts%7DTENANT_FILTER_FROM_JSON
 2014-02-10 11:29:30,484  DEBUG [impl.solr.SolrQueryHTTPClient] [http-8080-9]    with: {"textAttributes":[],"allAttributes":[],"templates":[],"authorities":["GROUP_EVERYONE","ROLE_ADMINISTRATOR","ROLE_AUTHENTICATED","aosman"],"tenants":[""],"query":"PATH:\"/app:company_home/app:dictionary/cm:Lists\"","locales":["en_US"],"defaultNamespace":"http://www.alfresco.org/model/content/1.0","defaultFTSFieldOperator":"OR","defaultFTSOperator":"OR"}
 2014-02-10 11:29:30,484  DEBUG [impl.solr.SolrQueryHTTPClient] [http-8080-9] Got: 0 in 2 ms
 2014-02-10 11:29:30,491  DEBUG [impl.solr.SolrQueryHTTPClient] [http-8080-9] Sent :/solr/alfresco/alfresco?wt=json&fl=DBID%2Cscore&rows=1000&df=TEXT&start=0&locale=en_US&fq=%7B%21afts%7DAUTHORITY_FILTER_FROM_JSON&fq=%7B%21afts%7DTENANT_FILTER_FROM_JSON
 2014-02-10 11:29:30,491  DEBUG [impl.solr.SolrQueryHTTPClient] [http-8080-9]    with: {"textAttributes":[],"allAttributes":[],"templates":[],"authorities":["GROUP_EVERYONE","ROLE_ADMINISTRATOR","ROLE_AUTHENTICATED","aosman"],"tenants":[""],"query":"PATH:\"/app:company_home/app:dictionary\"","locales":["en_US"],"defaultNamespace":"http://www.alfresco.org/model/content/1.0","defaultFTSFieldOperator":"OR","defaultFTSOperator":"OR"}
 2014-02-10 11:29:30,491  DEBUG [impl.solr.SolrQueryHTTPClient] [http-8080-9] Got: 1 in 2 ms
 2014-02-10 11:29:30,560  ERROR [extensions.webscripts.AbstractRuntime] [http-8080-9] Exception from executeScript - redirecting to status template error: 01100021 Wrapped Exception (with status template): 01100452 Failed to execute script 'classpath*:alfresco/templates/webscripts/tree-listmanager/repo-list-manager.get.js': Duplicate child name not allowed: Lists
 org.springframework.extensions.webscripts.WebScriptException: 01100021 Wrapped Exception (with status template): 01100452 Failed to execute script 'classpath*:alfresco/templates/webscripts/tree-listmanager/repo-list-manager.get.js': Duplicate child name not allowed: Lists
    at org.springframework.extensions.webscripts.AbstractWebScript.createStatusException(AbstractWebScript.java:1067)
    at org.springframework.extensions.webscripts.DeclarativeWebScript.execute(DeclarativeWebScript.java:171)
    at org.alfresco.repo.web.scripts.RepositoryContainer$2.execute(RepositoryContainer.java:421)
    at org.alfresco.repo.transaction.RetryingTransactionHelper.doInTransaction(RetryingTransactionHelper.java:449)
    at org.alfresco.repo.web.scripts.RepositoryContainer.transactionedExecute(RepositoryContainer.java:483)
    at org.alfresco.repo.web.scripts.RepositoryContainer.transactionedExecuteAs(RepositoryContainer.java:521)
    at org.alfresco.repo.web.scripts.RepositoryContainer.executeScript(RepositoryContainer.java:333)
    at org.springframework.extensions.webscripts.AbstractRuntime.executeScript(AbstractRuntime.java:378)
    at org.springframework.extensions.webscripts.AbstractRuntime.executeScript(AbstractRuntime.java:209)
    at org.springframework.extensions.webscripts.servlet.WebScriptServlet.service(WebScriptServlet.java:132)
    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 org.alfresco.web.app.servlet.GlobalLocalizationFilter.doFilter(GlobalLocalizationFilter.java:61)
    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.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:470)
    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.ha.session.JvmRouteBinderValve.invoke(JvmRouteBinderValve.java:227)
    at org.apache.catalina.ha.tcp.ReplicationValve.invoke(ReplicationValve.java:347)
    at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:293)
    at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:859)
    at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:602)
    at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:489)
    at java.lang.Thread.run(Thread.java:695)
Caused by: org.alfresco.scripts.ScriptException: 01100452 Failed to execute script 'classpath*:alfresco/templates/webscripts/tree-listmanager/repo-list-manager.get.js': Duplicate child name not allowed: Lists
    at org.alfresco.repo.jscript.RhinoScriptProcessor.execute(RhinoScriptProcessor.java:202)
    at org.alfresco.repo.processor.ScriptServiceImpl.execute(ScriptServiceImpl.java:212)
    at org.alfresco.repo.processor.ScriptServiceImpl.executeScript(ScriptServiceImpl.java:174)
    at org.alfresco.repo.web.scripts.RepositoryScriptProcessor.executeScript(RepositoryScriptProcessor.java:102)
    at org.springframework.extensions.webscripts.AbstractWebScript.executeScript(AbstractWebScript.java:1305)
    at org.springframework.extensions.webscripts.DeclarativeWebScript.execute(DeclarativeWebScript.java:86)
    ... 27 more
Caused by: org.alfresco.service.cmr.repository.DuplicateChildNodeNameException: Duplicate child name not allowed: Lists
    at org.alfresco.repo.domain.node.AbstractNodeDAOImpl$5.execute(AbstractNodeDAOImpl.java:3062)
    at org.alfresco.repo.domain.node.AbstractNodeDAOImpl$5.execute(AbstractNodeDAOImpl.java:3032)
    at org.alfresco.ibatis.RetryingCallbackHelper.doWithRetry(RetryingCallbackHelper.java:101)
    at org.alfresco.repo.domain.node.AbstractNodeDAOImpl.newChildAssocImpl(AbstractNodeDAOImpl.java:3070)
    at org.alfresco.repo.domain.node.AbstractNodeDAOImpl.newNode(AbstractNodeDAOImpl.java:1287)
    at org.alfresco.repo.node.db.DbNodeServiceImpl.createNode(DbNodeServiceImpl.java:368)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:597)
    at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:309)
    at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:183)
    at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:150)
    at org.alfresco.repo.tenant.MultiTNodeServiceInterceptor.invoke(MultiTNodeServiceInterceptor.java:105)
    at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
    at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:202)
    at com.sun.proxy.$Proxy15.createNode(Unknown Source)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:597)
    at org.alfresco.repo.service.StoreRedirectorProxyFactory$RedirectorInvocationHandler.invoke(StoreRedirectorProxyFactory.java:215)
    at com.sun.proxy.$Proxy28.createNode(Unknown Source)
    at org.alfresco.repo.node.MLPropertyInterceptor.invoke(MLPropertyInterceptor.java:279)
    at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
    at org.alfresco.enterprise.repo.sync.SyncPropertyInterceptor.invoke(SyncPropertyInterceptor.java:258)
    at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
    at org.alfresco.repo.node.NodeRefPropertyMethodInterceptor.invoke(NodeRefPropertyMethodInterceptor.java:183)
    at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
    at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:202)
    at com.sun.proxy.$Proxy15.createNode(Unknown Source)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:597)
    at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:309)
    at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:196)
    at com.sun.proxy.$Proxy15.createNode(Unknown Source)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:597)
    at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:309)
    at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:183)
    at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:150)
    at org.alfresco.repo.audit.DisableAuditableBehaviourInterceptor.invoke(DisableAuditableBehaviourInterceptor.java:113)
    at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
    at net.sf.acegisecurity.intercept.method.aopalliance.MethodSecurityInterceptor.invoke(MethodSecurityInterceptor.java:80)
    at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
    at org.alfresco.repo.security.permissions.impl.ExceptionTranslatorMethodInterceptor.invoke(ExceptionTranslatorMethodInterceptor.java:46)
    at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
    at org.alfresco.repo.audit.AuditMethodInterceptor.proceedWithAudit(AuditMethodInterceptor.java:247)
    at org.alfresco.repo.audit.AuditMethodInterceptor.proceed(AuditMethodInterceptor.java:213)
    at org.alfresco.repo.audit.AuditMethodInterceptor.invoke(AuditMethodInterceptor.java:166)
    at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
    at org.alfresco.repo.transaction.RetryingTransactionInterceptor$1.execute(RetryingTransactionInterceptor.java:79)
    at org.alfresco.repo.transaction.RetryingTransactionHelper.doInTransaction(RetryingTransactionHelper.java:449)
    at org.alfresco.repo.transaction.RetryingTransactionInterceptor.invoke(RetryingTransactionInterceptor.java:69)
    at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
    at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:202)
    at com.sun.proxy.$Proxy15.createNode(Unknown Source)
    at org.alfresco.repo.jscript.ScriptNode.createNode(ScriptNode.java:1899)
    at org.alfresco.repo.jscript.ScriptNode.createNode(ScriptNode.java:1859)
    at org.alfresco.repo.jscript.ScriptNode.createNode(ScriptNode.java:1814)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:597)
    at org.mozilla.javascript.MemberBox.invoke(MemberBox.java:155)
    at org.mozilla.javascript.NativeJavaMethod.call(NativeJavaMethod.java:243)
    at org.mozilla.javascript.optimizer.OptRuntime.call2(OptRuntime.java:76)
    at org.mozilla.javascript.gen.c5._c1(file:/opt/alfresco/tomcat01/webapps/alfresco/WEB-INF/classes/alfresco/templates/webscripts/tree-listmanager/repo-list-manager.get.js:10)
    at org.mozilla.javascript.gen.c5.call(file:/opt/alfresco/tomcat01/webapps/alfresco/WEB-INF/classes/alfresco/templates/webscripts/tree-listmanager/repo-list-manager.get.js)
    at org.mozilla.javascript.optimizer.OptRuntime.callName0(OptRuntime.java:108)
    at org.mozilla.javascript.gen.c5._c0(file:/opt/alfresco/tomcat01/webapps/alfresco/WEB-INF/classes/alfresco/templates/webscripts/tree-listmanager/repo-list-manager.get.js:58)
    at org.mozilla.javascript.gen.c5.call(file:/opt/alfresco/tomcat01/webapps/alfresco/WEB-INF/classes/alfresco/templates/webscripts/tree-listmanager/repo-list-manager.get.js)
    at org.mozilla.javascript.ContextFactory.doTopCall(ContextFactory.java:393)
    at org.mozilla.javascript.ScriptRuntime.doTopCall(ScriptRuntime.java:2834)
    at org.mozilla.javascript.gen.c5.call(file:/opt/alfresco/tomcat01/webapps/alfresco/WEB-INF/classes/alfresco/templates/webscripts/tree-listmanager/repo-list-manager.get.js)
    at org.mozilla.javascript.gen.c5.exec(file:/opt/alfresco/tomcat01/webapps/alfresco/WEB-INF/classes/alfresco/templates/webscripts/tree-listmanager/repo-list-manager.get.js)
    at org.alfresco.repo.jscript.RhinoScriptProcessor.executeScriptImpl(RhinoScriptProcessor.java:492)
    at org.alfresco.repo.jscript.RhinoScriptProcessor.execute(RhinoScriptProcessor.java:198)
    ... 32 more
Caused by: org.springframework.dao.DuplicateKeyException:
### Error updating database.  Cause: com.mysql.jdbc.exceptions.jdbc4.MySQLIntegrityConstraintViolationException: Duplicate entry '14-33-136748965-lists' for key 'parent_node_id'
### The error may involve alfresco.node.insert.insert_ChildAssoc-Inline
### The error occurred while setting parameters
### Cause: com.mysql.jdbc.exceptions.jdbc4.MySQLIntegrityConstraintViolationException: Duplicate entry '14-33-136748965-lists' for key 'parent_node_id'
; SQL []; Duplicate entry '14-33-136748965-lists' for key 'parent_node_id'; nested exception is com.mysql.jdbc.exceptions.jdbc4.MySQLIntegrityConstraintViolationException: Duplicate entry '14-33-136748965-lists' for key 'parent_node_id'
    at org.springframework.jdbc.support.SQLErrorCodeSQLExceptionTranslator.doTranslate(SQLErrorCodeSQLExceptionTranslator.java:241)
    at org.springframework.jdbc.support.AbstractFallbackSQLExceptionTranslator.translate(AbstractFallbackSQLExceptionTranslator.java:72)
    at org.mybatis.spring.MyBatisExceptionTranslator.translateExceptionIfPossible(MyBatisExceptionTranslator.java:71)
    at org.mybatis.spring.SqlSessionTemplate$SqlSessionInterceptor.invoke(SqlSessionTemplate.java:346)
    at com.sun.proxy.$Proxy12.insert(Unknown Source)
    at org.mybatis.spring.SqlSessionTemplate.insert(SqlSessionTemplate.java:231)
    at org.alfresco.repo.domain.node.ibatis.NodeDAOImpl.insertChildAssoc(NodeDAOImpl.java:805)
    at org.alfresco.repo.domain.node.AbstractNodeDAOImpl$5.execute(AbstractNodeDAOImpl.java:3038)
    ... 113 more
Caused by: com.mysql.jdbc.exceptions.jdbc4.MySQLIntegrityConstraintViolationException: Duplicate entry '14-33-136748965-lists' for key 'parent_node_id'
    at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
    at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
    at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
    at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
    at com.mysql.jdbc.Util.handleNewInstance(Util.java:411)
    at com.mysql.jdbc.Util.getInstance(Util.java:386)
    at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:1041)
    at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:4237)
    at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:4169)
    at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:2617)
    at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:2778)
    at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2825)
    at com.mysql.jdbc.PreparedStatement.executeInternal(PreparedStatement.java:2156)
    at com.mysql.jdbc.PreparedStatement.execute(PreparedStatement.java:1379)
    at org.apache.commons.dbcp.DelegatingPreparedStatement.execute(DelegatingPreparedStatement.java:172)
    at org.apache.commons.dbcp.DelegatingPreparedStatement.execute(DelegatingPreparedStatement.java:172)
    at org.apache.commons.dbcp.DelegatingPreparedStatement.execute(DelegatingPreparedStatement.java:172)
    at org.apache.ibatis.executor.statement.PreparedStatementHandler.update(PreparedStatementHandler.java:22)
    at org.apache.ibatis.executor.statement.RoutingStatementHandler.update(RoutingStatementHandler.java:51)
    at org.apache.ibatis.executor.SimpleExecutor.doUpdate(SimpleExecutor.java:29)
    at org.apache.ibatis.executor.BaseExecutor.update(BaseExecutor.java:87)
    at org.apache.ibatis.executor.CachingExecutor.update(CachingExecutor.java:46)
    at org.apache.ibatis.session.defaults.DefaultSqlSession.update(DefaultSqlSession.java:118)
    at org.apache.ibatis.session.defaults.DefaultSqlSession.insert(DefaultSqlSession.java:107)
    at sun.reflect.GeneratedMethodAccessor605.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:597)
    at org.mybatis.spring.SqlSessionTemplate$SqlSessionInterceptor.invoke(SqlSessionTemplate.java:338)
    ... 117 more

This explains why the issue persists even if I delete cm:lists from the repository. I'll be rolling back to another snapshot of production, need to determine if this is caused by the upgrade from 4.1.4-4.1.7.3 or listmanager.

Ashex commented 10 years ago

Rebuilt the index, restored to a prod snapshot of 4.1.4 then built listmanager from head and I'm still seeing the error above. This only happens when I'm using solr, under lucene it works as expected. I guess I'll test against 4.2? listmanager is currently blocking me from pushing 4.1.7 to production, so if it works in 4.2 we'll go with that.

billerby commented 10 years ago

Hmm, so the problem now is that with solr, it wont find the root-folder of the listmanager (cm:Lists). Since its not found the script tries to create it with the result of an exception saying that its already present...

The javascript code that is executed below:

startNode = search.luceneSearch('workspace://SpacesStore','PATH:"' + s.listpath + '/cm:' + s.listname +  '"')[0];
        if (startNode == null) {
            var listLocation =  search.luceneSearch('workspace://SpacesStore','PATH:"' + s.listpath +  '"')[0];
            startNode = listLocation.createNode(s.listname, "cm:folder");
            startNode.save();
        }

So if you run the below in the javascript console on a solr-alfresco it will give you no hit?

var listpath= "/app:company_home/app:dictionary";
var listname= "Lists";
var startNode = search.luceneSearch('workspace://SpacesStore','PATH:"' + listpath + '/cm:' + listname +  '"')[0];

logger.log("rootNode: " + startNode.qnamePath);
Ashex commented 10 years ago

I get an error with that:

Cannot read property "qnamePath" from undefined

I'm seeing some weird behavior in my environment, will do some quick tests to confirm the above.

Update: Verified the error is thrown with the script provided. For verification this is the path from the node browser:

/{http://www.alfresco.org/model/application/1.0}company_home/{http://www.alfresco.org/model/application/1.0}dictionary/{http://www.alfresco.org/model/content/1.0}Lists
billerby commented 10 years ago

Hmm strange, if you modify the query a bit?

var startNode = search.luceneSearch('workspace://SpacesStore', '+PATH:"/app:company_home/app:dictionary/*" +@cm\\:name:"Lists"')[0];

Still same error?

Ashex commented 10 years ago

So that was failing, so I decided to try something a little basic. I went to the Data Dictionary and renamed Lists to Lists2 then went back to the admin gui and was able to create an item. After that, I went back and deleted the new Lists folder and renamed Lists2 to Lists. After doing so Solr reindexed the directory and the admin gui and the javascript query worked!

It looks as though Solr was not indexing that path, I'm now going to upgrade to 4.1.7 and see what happens.

billerby commented 10 years ago

Interesting, hopefully this will work now then :+1:

Ashex commented 10 years ago

And back to weird behavior, two items appear in 4.1.7.3 with listmanager built from head. The javascript query returns the following:

rootNode: /ver2:_x0031_3d49b7a-016c-45f6-9a0e-7436f129618f/ver2:version-0

Going to remove extra addons to verify it's not one of those.

billerby commented 10 years ago

And if you change to an xpath search:

var startNode = search.xpathSearch("/app:company_home/app:dictionary/cm:Lists")[0];

Still same strange behaviour?

Ashex commented 10 years ago

So the fix was the same as before, rename the folder and have listmanager create a new one then delete that one and rename the old folder back. Still haven't figured out why Solr is behaving this way.

Ashex commented 10 years ago

I opened a ticket with Alfresco support and it doesn't look like any changes were made to Solr between 4.1.4 and 4.1.7.3 (I've asked them to look if anything was changed with how Solr queries). Just a hunch, but perhaps the custom content model was causing problems? Just looking at how folders are created here it looks like a custom aspect/property are set.