Description
In the logs of xwiki.org I could see:
2016-03-11 10:33:08,036 [XWiki Solr resolve thread] WARN o.x.s.s.i.DefaultSolrIndexer - Failed to apply operation [INDEX] on root reference [design:Mockups.MeetingManager] java.lang.IllegalArgumentException: An Entity Reference name cannot be null or empty at org.xwiki.model.reference.EntityReference.setName(EntityReference.java:186) ~[xwiki-platform-model-7.4.2.jar:na] at org.xwiki.model.reference.EntityReference.<init>(EntityReference.java:154) ~[xwiki-platform-model-7.4.2.jar:na] at org.xwiki.model.reference.AttachmentReference.<init>(AttachmentReference.java:68) ~[xwiki-platform-model-7.4.2.jar:na] at com.xpn.xwiki.doc.XWikiAttachment.getReference(XWikiAttachment.java:156) ~[xwiki-platform-legacy-oldcore-7.4.2.jar:na] at org.xwiki.search.solr.internal.reference.DocumentSolrReferenceResolver.addAttachmentsReferences(DocumentSolrReferenceResolver.java:139) ~[xwiki-platform-search-solr-api-7.4.2.jar:na] at org.xwiki.search.solr.internal.reference.DocumentSolrReferenceResolver.getReferences(DocumentSolrReferenceResolver.java:121) ~[xwiki-platform-search-solr-api-7.4.2.jar:na] at org.xwiki.search.solr.internal.reference.DocumentSolrReferenceResolver.getReferences(DocumentSolrReferenceResolver.java:55) ~[xwiki-platform-search-solr-api-7.4.2.jar:na] at org.xwiki.search.solr.internal.reference.DefaultSolrReferenceResolver.getReferences(DefaultSolrReferenceResolver.java:163) ~[xwiki-platform-search-solr-api-7.4.2.jar:na] at org.xwiki.search.solr.internal.DefaultSolrIndexer$Resolver.runInternal(DefaultSolrIndexer.java:213) ~[xwiki-platform-search-solr-api-7.4.2.jar:na] at com.xpn.xwiki.util.AbstractXWikiRunnable.run(AbstractXWikiRunnable.java:131) [xwiki-platform-legacy-oldcore-7.4.2.jar:na] at java.lang.Thread.run(Thread.java:744) [na:1.7.0_51]
There are 2 aspects:
- The error message is cryptic. After analysis the issue is that the filename of an attachment located at page "design:Mockups.MeetingManager" is empty. We should check for it and report a better error at https://github.com/xwiki/xwiki-platform/blob/cb7b6dd758258f5ffcea927c85ad994c8591ef2d/xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/doc/XWikiAttachment.java#L156-L156
- We need to decide what we do with empty filenames. We could have a DB migration that sets file names for them such as "unnamed1", "unnamed2", etc.
FTR in this case here's the DB info I got:
+-------------+---------------------+--------------+----------+---------------------+---------------------------+-------------+-------------+--------------+ | XWA_ID | XWA_DOC_ID | XWA_FILENAME | XWA_SIZE | XWA_DATE | XWA_AUTHOR | XWA_VERSION | XWA_COMMENT | XWA_MIMETYPE | +-------------+---------------------+--------------+----------+---------------------+---------------------------+-------------+-------------+--------------+ | -1917803843 | 3513979740967719062 | | 0 | 2009-04-01 11:32:13 | xwiki:XWiki.LaurentLunati | 1.1 | | NULL | +-------------+---------------------+--------------+----------+---------------------+---------------------------+-------------+-------------+--------------+
And the corresponding doc:
+---------------------+------------------------+----------------+-------------------------+--------------+----------------------+-----------------+---------------------+-------------------------+---------------------+---------------------+---------------------+---------------------+---------+---------------------------------------------------------------------------------------------+-------------+------------------+-----------------------------+---------------+--------------+----------------------+-----------------------+-------------+---------------+---------------+------------+ | XWD_ID | XWD_FULLNAME | XWD_NAME | XWD_TITLE | XWD_LANGUAGE | XWD_DEFAULT_LANGUAGE | XWD_TRANSLATION | XWD_DATE | XWD_CONTENT_UPDATE_DATE | XWD_CREATION_DATE | XWD_AUTHOR | XWD_CONTENT_AUTHOR | XWD_CREATOR | XWD_WEB | XWD_CONTENT | XWD_VERSION | XWD_CUSTOM_CLASS | XWD_PARENT | XWD_CLASS_XML | XWD_ELEMENTS | XWD_DEFAULT_TEMPLATE | XWD_VALIDATION_SCRIPT | XWD_COMMENT | XWD_MINOREDIT | XWD_SYNTAX_ID | XWD_HIDDEN | +---------------------+------------------------+----------------+-------------------------+--------------+----------------------+-----------------+---------------------+-------------------------+---------------------+---------------------+---------------------+---------------------+---------+---------------------------------------------------------------------------------------------+-------------+------------------+-----------------------------+---------------+--------------+----------------------+-----------------------+-------------+---------------+---------------+------------+ | 3513979740967719062 | Mockups.MeetingManager | MeetingManager | Meeting Manager Mockups | | en | 0 | 2014-01-13 10:12:57 | 2014-01-13 10:12:57 | 2013-11-13 14:41:42 | xwiki:XWiki.evalica | xwiki:XWiki.evalica | XWiki.LaurentLunati | Mockups | {{mockup reference="meetingmanager.png"/}} {{mockup reference="meetingmanagerstep1.png"/}} | 17.3 | | Proposal.MeetingApplication | | 3 | | | | | xwiki/2.1 | | +---------------------+------------------------+----------------+-------------------------+--------------+----------------------+-----------------+---------------------+-------------------------+---------------------+---------------------+---------------------+---------------------+---------+---------------------------------------------------------------------------------------------+-------------+------------------+-----------------------------+---------------+--------------+----------------------+-----------------------+-------------+---------------+---------------+------------+