-
Bug
-
Resolution: Fixed
-
High
-
3.3, 3.4
If an instance includes pages with invalid page titles the search index rebuild fails and reports completion even though not all the elements have been indexed.
Symptoms
- Blog posts not showing up
- contentbylabel macro does not return full list of labeled pages
Example log output:
2010-12-16 10:46:34,500 DEBUG [Indexer: 1] [confluence.search.lucene.DefaultObjectQueueWorker] indexCollection Progress: 25130 of 76924 total objects. 2010-12-16 10:46:35,516 ERROR [http-80-6] [atlassian.core.util.DateUtils] getText java.util.MissingResourceException: Can't find resource for bundle com.atlassian.confluence.util.i18n.CombinedResourceBundle, key core.dateutils.minutes -- referer: http://example.com/admin/search-indexes.action | url: /json/reindextaskprogress.action | userName: klaus.tester | action: reindextaskprogress 2010-12-16 10:46:55,188 DEBUG [confluence-interactive-reindexing-thread] [confluence.search.lucene.ConfluenceSearcherInitialisation] initialise Warming up searcher.. 2010-12-16 10:46:55,235 DEBUG [confluence-interactive-reindexing-thread] [confluence.search.lucene.MultiThreadedIndexRebuilder] indexEntities Index rebuild complete.
Progress shows 25130 of 76924 total objects but the index rebuild completes (unsuccessfully) a few seconds later.
Tomcat error logs show the following exception:
Exception in thread "Indexer: 1" org.springframework.orm.hibernate.HibernateSystemException: Exception occurred inside setter of com.atlassian.confluence.pages.AbstractPage.title; nested exception is net.sf.hibernate.PropertyAccessException: Exception occurred inside setter of com.atlassian.confluence.pages.AbstractPage.title Caused by: net.sf.hibernate.PropertyAccessException: Exception occurred inside setter of com.atlassian.confluence.pages.AbstractPage.title at net.sf.hibernate.property.BasicPropertyAccessor$BasicSetter.set(BasicPropertyAccessor.java:49) at net.sf.hibernate.persister.AbstractEntityPersister.setPropertyValues(AbstractEntityPersister.java:229) at net.sf.hibernate.impl.SessionImpl.initializeEntity(SessionImpl.java:2222) at net.sf.hibernate.loader.Loader.initializeEntitiesAndCollections(Loader.java:319) at net.sf.hibernate.loader.Loader.doQuery(Loader.java:309) at net.sf.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:138) at net.sf.hibernate.loader.Loader.loadEntity(Loader.java:941) at net.sf.hibernate.loader.Loader.loadEntity(Loader.java:961) at net.sf.hibernate.loader.EntityLoader.load(EntityLoader.java:59) at net.sf.hibernate.loader.EntityLoader.load(EntityLoader.java:51) at net.sf.hibernate.persister.EntityPersister.load(EntityPersister.java:413) at net.sf.hibernate.impl.SessionImpl.doLoad(SessionImpl.java:2129) at net.sf.hibernate.impl.SessionImpl.doLoadByClass(SessionImpl.java:1999) at net.sf.hibernate.impl.SessionImpl.internalLoad(SessionImpl.java:1961) at net.sf.hibernate.type.ManyToOneType.resolveIdentifier(ManyToOneType.java:69) at net.sf.hibernate.type.EntityType.resolveIdentifier(EntityType.java:208) at net.sf.hibernate.impl.SessionImpl.initializeEntity(SessionImpl.java:2217) at net.sf.hibernate.loader.Loader.initializeEntitiesAndCollections(Loader.java:319) at net.sf.hibernate.loader.Loader.doQuery(Loader.java:309) at net.sf.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:138) at net.sf.hibernate.loader.Loader.doList(Loader.java:1063) at net.sf.hibernate.loader.Loader.list(Loader.java:1054) at net.sf.hibernate.hql.QueryTranslator.list(QueryTranslator.java:854) at net.sf.hibernate.impl.SessionImpl.find(SessionImpl.java:1552) at net.sf.hibernate.impl.SessionImpl.find(SessionImpl.java:1529) at net.sf.hibernate.impl.SessionImpl.find(SessionImpl.java:1521) at sun.reflect.GeneratedMethodAccessor361.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at org.springframework.orm.hibernate.HibernateTemplate$CloseSuppressingInvocationHandler.invoke(HibernateTemplate.java:1123) at $Proxy84.find(Unknown Source) at com.atlassian.confluence.core.persistence.hibernate.HibernateAnyTypeDao$3.doInHibernate(HibernateAnyTypeDao.java:100) at org.springframework.orm.hibernate.HibernateTemplate.execute(HibernateTemplate.java:370) at org.springframework.orm.hibernate.HibernateTemplate.executeFind(HibernateTemplate.java:341) at com.atlassian.confluence.core.persistence.hibernate.HibernateAnyTypeDao.findByIdsAndClassName(HibernateAnyTypeDao.java:95) at com.atlassian.confluence.search.lucene.ObjectQueue.popObjectsOnce(ObjectQueue.java:84) at com.atlassian.confluence.search.lucene.ObjectQueue.pop(ObjectQueue.java:46) at com.atlassian.confluence.search.lucene.DefaultObjectQueueWorker$1.doInTransactionWithoutResult(DefaultObjectQueueWorker.java:58) at org.springframework.transaction.support.TransactionCallbackWithoutResult.doInTransaction(TransactionCallbackWithoutResult.java:33) at org.springframework.transaction.support.TransactionTemplate.execute(TransactionTemplate.java:127) at com.atlassian.confluence.search.lucene.DefaultObjectQueueWorker.run(DefaultObjectQueueWorker.java:51) at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908) at java.lang.Thread.run(Thread.java:619) Caused by: java.lang.reflect.InvocationTargetException at sun.reflect.GeneratedMethodAccessor226.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at net.sf.hibernate.property.BasicPropertyAccessor$BasicSetter.set(BasicPropertyAccessor.java:38) ... 43 more Caused by: com.atlassian.core.exception.InfrastructureException: Invalid page title: ... at com.atlassian.confluence.pages.AbstractPage.setTitle(AbstractPage.java:59) ... 47 more
How to reproduce
This error can be reproduced by:
- Changing the title of a page to be invalid (e.g. by adding a leading $)
- Rebuilding the index using just a single reindex thread (not strictly necessary but makes following the log output easier)
UPDATE content SET title = '$ Invalid title' WHERE contentid = CONTENTID;
This will make the content with the contentid CONTENTID unusable. Do not do this in a production environment!
Use the environment variable/system property -Dindex.queue.thread.count=1 to set the number of reindex threads to 1.