There are 8 updates, 1 comment.
 
 
XWiki Platform / cid:jira-generated-image-avatar-1dd4d3f0-b7fe-4887-8317-144d1978fc90 XWIKI-23412 Closed

The repositoryId of an indexed extension can end up being null

 
View issue   ยท   Add comment
 

8 updates

 
cid:jira-generated-image-avatar-3301ea0d-1c21-42da-b3c2-67f95a2c33dc Changes by Thomas Mortagne on 09/Oct/26 11:37
 
Fix Version: 17.10.14
Fix Version: 18.9.0-rc-1
Fix Version: 18.4.7
Documentation in Release Notes: N/A
Documentation: N/A
Resolution: Fixed
Tests: Unit
Status: In Progress Closed
 
 

1 comment

 
cid:jira-generated-image-avatar-3301ea0d-1c21-42da-b3c2-67f95a2c33dc Thomas Mortagne on 09/Oct/26 11:36
 
Found Claude found the cause: when an extension which is not in the extension index is installed/upgraded/uninstalled (for example an extension coming from a non searchable repository like Maven Central, or an extension which is not part of what a searchable repository returned), {{ExtensionInstallListener}} calls {{ExtensionIndexStore#updateInstalled}}, which sends a Solr atomic update. Solr creates the document when an atomic update targets a document which does not exist, so the index ends up with a document containing only the installed/compatible namespaces fields: no extension id, version, repository, etc.

Such a document is then also picked by the indexing job (which lists indexed extensions from the document ids) and can receive compatible namespaces through {{ExtensionIndexStore#updateCompatible}}. As soon as it matches a search, it breaks the whole result. For example, the empty "Compatible only" search in the Extensions administration fails with:

{noformat}
java.lang.NullPointerException: key
at org.xwiki.collection.SoftCache.put(SoftCache.java:93)
at org.xwiki.extension.internal.ExtensionFactory.getVersion(ExtensionFactory.java:339)
at org.xwiki.extension.index.internal.ExtensionIndexStore.getExtensionId(ExtensionIndexStore.java:714)
at org.xwiki.extension.index.internal.ExtensionIndexStore.toSolrExtension(ExtensionIndexStore.java:723)
at org.xwiki.extension.index.internal.ExtensionIndexStore.search(ExtensionIndexStore.java:806)
at org.xwiki.extension.index.internal.DefaultExtensionIndex.search(DefaultExtensionIndex.java:99)
{noformat}

The null repositoryId reported in XWIKI-23358 is another symptom of the same incomplete documents.