Upgrade 9.9 to 9.10 - Failed to load component for type [interface com.xpn.xwiki.store.AttachmentRecycleBinStore] for hint [file]

I just upgraded from 9.9 to 9.10 and now my wiki fails to initialize:

Can’t find descriptor for the component with type [interface com.xpn.xwiki.store.AttachmentRecycleBinContentStore] and hint [default]
class java.lang.RuntimeException: Failed to load component for type [interface com.xpn.xwiki.store.AttachmentRecycleBinStore] for hint [file]
at com.xpn.xwiki.web.Utils.getComponent(Utils.java:755)
at com.xpn.xwiki.web.Utils.getComponent(Utils.java:716)
at com.xpn.xwiki.XWiki.initXWiki(XWiki.java:1171)
at com.xpn.xwiki.XWiki.initXWiki(XWiki.java:1099)
at com.xpn.xwiki.XWiki.(XWiki.java:1072)
at com.xpn.xwiki.internal.XWikiInitializerJob.runInternal(XWikiInitializerJob.java:117)
at org.xwiki.job.AbstractJob.runInContext(AbstractJob.java:206)
at org.xwiki.job.AbstractJob.run(AbstractJob.java:189)
at java.lang.Thread.run(Unknown Source)
Caused by: class org.xwiki.component.manager.ComponentLookupException: Failed to lookup component [org.xwiki.store.legacy.store.internal.FilesystemAttachmentRecycleBinStore] identified by type [interface com.xpn.xwiki.store.AttachmentRecycleBinStore] and hint [file]
at org.xwiki.component.embed.EmbeddableComponentManager.getInstance(EmbeddableComponentManager.java:199)
at org.xwiki.component.embed.EmbeddableComponentManager.getInstance(EmbeddableComponentManager.java:205)
at org.xwiki.component.internal.multi.DelegateComponentManager.getInstance(DelegateComponentManager.java:83)
at org.xwiki.component.internal.multi.DelegateComponentManager.getInstance(DelegateComponentManager.java:83)
at org.xwiki.component.internal.multi.DelegateComponentManager.getInstance(DelegateComponentManager.java:83)
at org.xwiki.component.internal.multi.DelegateComponentManager.getInstance(DelegateComponentManager.java:83)
at org.xwiki.component.internal.multi.DelegateComponentManager.getInstance(DelegateComponentManager.java:83)
at com.xpn.xwiki.web.Utils.getComponent(Utils.java:753)
at com.xpn.xwiki.web.Utils.getComponent(Utils.java:716)
at com.xpn.xwiki.XWiki.initXWiki(XWiki.java:1171)
at com.xpn.xwiki.XWiki.initXWiki(XWiki.java:1099)
at com.xpn.xwiki.XWiki.(XWiki.java:1072)
at com.xpn.xwiki.internal.XWikiInitializerJob.runInternal(XWikiInitializerJob.java:117)
at org.xwiki.job.AbstractJob.runInContext(AbstractJob.java:206)
at org.xwiki.job.AbstractJob.run(AbstractJob.java:189)
at java.lang.Thread.run(Unknown Source)
Caused by: class org.xwiki.component.manager.ComponentLookupException: Can’t find descriptor for the component with type [interface com.xpn.xwiki.store.AttachmentRecycleBinContentStore] and hint [default]
at org.xwiki.component.embed.EmbeddableComponentManager.getInstance(EmbeddableComponentManager.java:207)
at org.xwiki.component.embed.EmbeddableComponentManager.getDependencyInstance(EmbeddableComponentManager.java:401)
at org.xwiki.component.embed.EmbeddableComponentManager.createInstance(EmbeddableComponentManager.java:350)
at org.xwiki.component.embed.EmbeddableComponentManager.getComponentInstance(EmbeddableComponentManager.java:446)
at org.xwiki.component.embed.EmbeddableComponentManager.getInstance(EmbeddableComponentManager.java:196)
at org.xwiki.component.embed.EmbeddableComponentManager.getInstance(EmbeddableComponentManager.java:205)
at org.xwiki.component.internal.multi.DelegateComponentManager.getInstance(DelegateComponentManager.java:83)
at org.xwiki.component.internal.multi.DelegateComponentManager.getInstance(DelegateComponentManager.java:83)
at org.xwiki.component.internal.multi.DelegateComponentManager.getInstance(DelegateComponentManager.java:83)
at org.xwiki.component.internal.multi.DelegateComponentManager.getInstance(DelegateComponentManager.java:83)
at org.xwiki.component.internal.multi.DelegateComponentManager.getInstance(DelegateComponentManager.java:83)
at com.xpn.xwiki.web.Utils.getComponent(Utils.java:753)
at com.xpn.xwiki.web.Utils.getComponent(Utils.java:716)
at com.xpn.xwiki.XWiki.initXWiki(XWiki.java:1171)
at com.xpn.xwiki.XWiki.initXWiki(XWiki.java:1099)
at com.xpn.xwiki.XWiki.(XWiki.java:1072)
at com.xpn.xwiki.internal.XWikiInitializerJob.runInternal(XWikiInitializerJob.java:117)
at org.xwiki.job.AbstractJob.runInContext(AbstractJob.java:206)
at org.xwiki.job.AbstractJob.run(AbstractJob.java:189)
at java.lang.Thread.run(Unknown Source)

BTW, @vmassol, this is the type of issue I brought up in our hangout a couple of months ago. There is no clear path for regular upgrades. I have a process that I’ve now done almost the exact same way probably 100 times. For the last 20-30 upgrades, no issues, but suddenly I get a failure and I’m thinking it’s because of this:

Miscellaneous
•Filesystem attachment improvements: A few of the long standing issues in the filesystem attachments storage have been fixed:
◦Deleted attachments are now available on the “Deleted Attachments” tab of the Page Index
◦The attachment porter script is not needed anymore (XWiki supports mixed attachment storage which means database attachment will stay in the database and keep working after changing the default store)
◦Various other bugfixes

But I’m left guessing how to change the settings so that I continue to have documents and attachments stored the way they were before (documents = does that mean pages?):

  • Documents = hibernate
  • Attachments = file

But what about recyclebin and versioning, where should those go? I don’t believe in keeping binary files in a database (blame Zend Con 2007).

You skipped one item in http://www.xwiki.org/xwiki/bin/view/ReleaseNotes/Data/XWiki/9.10/#HIssuesspecifictoXWiki9.10 actually (you are still using xwiki.store.attachment.recyclebin.hint = file).

Note that there was supposed to be a retro compatibility for it but it was not tested enough it seems…

1 Like

Thanks @tmortagne, yep, I missed that note completely. I made the change, so that this is my relevant xwiki.cfg file:
#---------------------------------------
# Storage
#

#-# Role hints that differentiate implementations of the various storage components. To add a new implementation for
#-# one of the storages, implement the appropriate interface and declare it in a components.xml file (using a role-hint
#-# other than 'default') and put its hint here.
#
#-# Stores with both "hibernate" and "file" support by default.
#-# 
#-# [Since 9.0RC1] The default document content recycle bin storage. Default is hibernate.
#-# This property is only taken into account when deleting a document and has no effect on already deleted documents.
# xwiki.store.recyclebin.content.hint=hibernate
#-# The attachment storage. [Since 3.4M1] default is hibernate.
xwiki.store.attachment.hint=file
#-# The attachment versioning storage. Use 'void' to disable attachment versioning. [Since 3.4M1] default is hibernate.
xwiki.store.attachment.versioning.hint=file
#-# [Since 9.9RC1] The default attachment content recycle bin storage. Default is hibernate.
#-# This property is only taken into account when deleting an attachment and has no effect on already deleted documents.
xwiki.store.attachment.recyclebin.content.hint=file
#-# 
#-# Stores with only "hibernate" support by default
#-# 
#-# The main (documents) storage. [Since 3.4M1] default is hibernate.
# xwiki.store.main.hint=hibernate
#-# The document versioning storage. [Since 3.4M1] default is hibernate.
# xwiki.store.versioning.hint=hibernate
#-# The document recycle bin storage. [Since 3.4M1] default is hibernate.
# xwiki.store.recyclebin.hint=hibernate
#-# The attachment recycle bin storage. [Since 3.4M1] default is hibernate.
# *****************DO NOT USE THIS SETTING (K.D.)***************
# xwiki.store.attachment.recyclebin.hint=hibernate
#-# [Since 3.4M1] The Migration manager.
# xwiki.store.migration.manager.hint=hibernate

#-# Whether the document recycle bin feature is activated or not
# xwiki.recyclebin=1
#-# Whether the attachment recycle bin feature is activated or not
# storage.attachment.recyclebin=1
#-# Whether the document versioning feature is activated or not
# xwiki.store.versioning=1
#-# Whether the attachment versioning feature is activated or not
# xwiki.store.attachment.versioning=1
#-# Whether the attachments should also be rolled back when a document is reverted.
# xwiki.store.rollbackattachmentwithdocuments=1

However, it’s now failing with a different error (not sure which one to post, there are many, but I think this is the right one):

Root Cause

org.hibernate.HibernateException: Failed to move deleted attachments metadata to the database
org.xwiki.store.filesystem.internal.migration.R910010XWIKI9065DataMigration$1.doInHibernate(R910010XWIKI9065DataMigration.java:117)
org.xwiki.store.filesystem.internal.migration.R910010XWIKI9065DataMigration$1.doInHibernate(R910010XWIKI9065DataMigration.java:110)
com.xpn.xwiki.store.XWikiHibernateBaseStore.execute(XWikiHibernateBaseStore.java:904)
com.xpn.xwiki.store.XWikiHibernateBaseStore.executeWrite(XWikiHibernateBaseStore.java:1017)
org.xwiki.store.filesystem.internal.migration.R910010XWIKI9065DataMigration.hibernateMigrate(R910010XWIKI9065DataMigration.java:109)
com.xpn.xwiki.store.migration.hibernate.AbstractHibernateDataMigration.migrate(AbstractHibernateDataMigration.java:112)
com.xpn.xwiki.store.migration.AbstractDataMigrationManager.startMigrations(AbstractDataMigrationManager.java:848)
com.xpn.xwiki.store.migration.AbstractDataMigrationManager.migrateDatabase(AbstractDataMigrationManager.java:743)
com.xpn.xwiki.store.migration.AbstractDataMigrationManager.startMigrations(AbstractDataMigrationManager.java:664)
com.xpn.xwiki.store.migration.hibernate.HibernateDataMigrationManager.startMigrations(HibernateDataMigrationManager.java:346)
com.xpn.xwiki.store.migration.AbstractDataMigrationManager.startMigrationsOnlyOnce(AbstractDataMigrationManager.java:644)
com.xpn.xwiki.store.migration.AbstractDataMigrationManager.tryToProcceedToMigration(AbstractDataMigrationManager.java:621)
com.xpn.xwiki.store.migration.AbstractDataMigrationManager.checkDatabase(AbstractDataMigrationManager.java:538)
com.xpn.xwiki.internal.store.hibernate.HibernateStore.setWiki(HibernateStore.java:339)
com.xpn.xwiki.internal.store.hibernate.HibernateStore.setWiki(HibernateStore.java:302)
com.xpn.xwiki.internal.store.hibernate.HibernateStore.beginTransaction(HibernateStore.java:472)
com.xpn.xwiki.store.XWikiHibernateBaseStore.beginTransaction(XWikiHibernateBaseStore.java:669)
com.xpn.xwiki.store.XWikiHibernateStore.loadXWikiDoc(XWikiHibernateStore.java:880)
com.xpn.xwiki.store.XWikiCacheStore.loadXWikiDoc(XWikiCacheStore.java:280)
com.xpn.xwiki.XWiki.getDocument(XWiki.java:1842)
com.xpn.xwiki.XWiki.getDocument(XWiki.java:1902)
com.xpn.xwiki.XWiki.initializeMandatoryDocument(XWiki.java:1272)
com.xpn.xwiki.XWiki.initializeMandatoryDocuments(XWiki.java:1246)
com.xpn.xwiki.XWiki.initXWiki(XWiki.java:1185)
com.xpn.xwiki.XWiki.initXWiki(XWiki.java:1099)
com.xpn.xwiki.XWiki.(XWiki.java:1072)
com.xpn.xwiki.internal.XWikiInitializerJob.runInternal(XWikiInitializerJob.java:117)
org.xwiki.job.AbstractJob.runInContext(AbstractJob.java:206)
org.xwiki.job.AbstractJob.run(AbstractJob.java:189)
java.lang.Thread.run(Unknown Source)

This does not not looks like the root cause, there should at least be one more caused by. All this error say is that the migrator thrown an exception (and then you should see in exception in the next “caused by”).

These errors always confuse the heck out of me. There are actually 10 “Root Cause” errors. The one I posted is the last one. I’m not sure what you mean by “and then you should see in exception”, as every one of these has an exception, like the one I posted:

org.hibernate.HibernateException:

I’m not a Java (I’m a PHP developer) and so maybe I’m not understanding what you mean by exception. I’m attaching the whole thing:

HTTP Status 500 – Internal Server Error.txt (34.9 KB)

This is actually only partial (because too big it seems):

Note The full stack trace of the root cause is available in the server logs.

Yea, I was just looking at localhost.2017-11-22.log and found this additional “Caused by”:

22-Nov-2017 08:23:15.718 SEVERE [https://wiki.pridedallas.com:8443/xwiki/bin/view/Main/] org.apache.catalina.core.StandardWrapperValve.invoke Servlet.service() for servlet [action] in context with path [/xwiki] threw exception [com.xpn.xwiki.XWikiException: Error number 11007 in 0: Failed to extract Entity Resource Reference from URL [https://wiki.pridedallas.com:8443/xwiki/bin/view/Main/]] with root cause
java.lang.NullPointerException
at org.xwiki.store.filesystem.internal.migration.R910010XWIKI9065DataMigration.getEntityReference(R910010XWIKI9065DataMigration.java:212)
at org.xwiki.store.filesystem.internal.migration.R910010XWIKI9065DataMigration.getEntityReference(R910010XWIKI9065DataMigration.java:215)
at org.xwiki.store.filesystem.internal.migration.R910010XWIKI9065DataMigration.getEntityReference(R910010XWIKI9065DataMigration.java:215)
at org.xwiki.store.filesystem.internal.migration.R910010XWIKI9065DataMigration.getEntityReference(R910010XWIKI9065DataMigration.java:215)
at org.xwiki.store.filesystem.internal.migration.R910010XWIKI9065DataMigration.getEntityReference(R910010XWIKI9065DataMigration.java:215)
at org.xwiki.store.filesystem.internal.migration.R910010XWIKI9065DataMigration.getEntityReference(R910010XWIKI9065DataMigration.java:215)
at org.xwiki.store.filesystem.internal.migration.R910010XWIKI9065DataMigration.getEntityReference(R910010XWIKI9065DataMigration.java:215)
at org.xwiki.store.filesystem.internal.migration.R910010XWIKI9065DataMigration.getEntityReference(R910010XWIKI9065DataMigration.java:215)
at org.xwiki.store.filesystem.internal.migration.R910010XWIKI9065DataMigration.getEntityReference(R910010XWIKI9065DataMigration.java:215)
at org.xwiki.store.filesystem.internal.migration.R910010XWIKI9065DataMigration.getEntityReference(R910010XWIKI9065DataMigration.java:215)
at org.xwiki.store.filesystem.internal.migration.R910010XWIKI9065DataMigration.getDocumentReference(R910010XWIKI9065DataMigration.java:201)
at org.xwiki.store.filesystem.internal.migration.R910010XWIKI9065DataMigration.storeDeletedAttachment(R910010XWIKI9065DataMigration.java:177)
at org.xwiki.store.filesystem.internal.migration.R910010XWIKI9065DataMigration.migrateMetadatas(R910010XWIKI9065DataMigration.java:167)
at org.xwiki.store.filesystem.internal.migration.R910010XWIKI9065DataMigration.access$000(R910010XWIKI9065DataMigration.java:77)
at org.xwiki.store.filesystem.internal.migration.R910010XWIKI9065DataMigration$1.doInHibernate(R910010XWIKI9065DataMigration.java:115)
at org.xwiki.store.filesystem.internal.migration.R910010XWIKI9065DataMigration$1.doInHibernate(R910010XWIKI9065DataMigration.java:110)
at com.xpn.xwiki.store.XWikiHibernateBaseStore.execute(XWikiHibernateBaseStore.java:904)
at com.xpn.xwiki.store.XWikiHibernateBaseStore.executeWrite(XWikiHibernateBaseStore.java:1017)
at org.xwiki.store.filesystem.internal.migration.R910010XWIKI9065DataMigration.hibernateMigrate(R910010XWIKI9065DataMigration.java:109)
at com.xpn.xwiki.store.migration.hibernate.AbstractHibernateDataMigration.migrate(AbstractHibernateDataMigration.java:112)
at com.xpn.xwiki.store.migration.AbstractDataMigrationManager.startMigrations(AbstractDataMigrationManager.java:848)
at com.xpn.xwiki.store.migration.AbstractDataMigrationManager.migrateDatabase(AbstractDataMigrationManager.java:743)
at com.xpn.xwiki.store.migration.AbstractDataMigrationManager.startMigrations(AbstractDataMigrationManager.java:664)
at com.xpn.xwiki.store.migration.hibernate.HibernateDataMigrationManager.startMigrations(HibernateDataMigrationManager.java:346)
at com.xpn.xwiki.store.migration.AbstractDataMigrationManager.startMigrationsOnlyOnce(AbstractDataMigrationManager.java:644)
at com.xpn.xwiki.store.migration.AbstractDataMigrationManager.tryToProcceedToMigration(AbstractDataMigrationManager.java:621)
at com.xpn.xwiki.store.migration.AbstractDataMigrationManager.checkDatabase(AbstractDataMigrationManager.java:538)
at com.xpn.xwiki.internal.store.hibernate.HibernateStore.setWiki(HibernateStore.java:339)
at com.xpn.xwiki.internal.store.hibernate.HibernateStore.setWiki(HibernateStore.java:302)
at com.xpn.xwiki.internal.store.hibernate.HibernateStore.beginTransaction(HibernateStore.java:472)
at com.xpn.xwiki.store.XWikiHibernateBaseStore.beginTransaction(XWikiHibernateBaseStore.java:669)
at com.xpn.xwiki.store.XWikiHibernateStore.loadXWikiDoc(XWikiHibernateStore.java:880)
at com.xpn.xwiki.store.XWikiCacheStore.loadXWikiDoc(XWikiCacheStore.java:280)
at com.xpn.xwiki.XWiki.getDocument(XWiki.java:1842)
at com.xpn.xwiki.XWiki.getDocument(XWiki.java:1902)
at com.xpn.xwiki.XWiki.initializeMandatoryDocument(XWiki.java:1272)
at com.xpn.xwiki.XWiki.initializeMandatoryDocuments(XWiki.java:1246)
at com.xpn.xwiki.XWiki.initXWiki(XWiki.java:1185)
at com.xpn.xwiki.XWiki.initXWiki(XWiki.java:1099)
at com.xpn.xwiki.XWiki.(XWiki.java:1072)
at com.xpn.xwiki.internal.XWikiInitializerJob.runInternal(XWikiInitializerJob.java:117)
at org.xwiki.job.AbstractJob.runInContext(AbstractJob.java:206)
at org.xwiki.job.AbstractJob.run(AbstractJob.java:189)
at java.lang.Thread.run(Unknown Source)

Thanks !

Let’s see what mistake I made now…

Looks like I will need your help to test a few things since I don’t understand how it’s possible to get this error right now.

Would be great if you could download the last JAR on Repository - Sonatype Nexus Repository (i.e. at least 9.10.1-20171122.163958-2), replace the one you have current in WEB-INF/lib with and restart the wiki to restart the migration.

You should get some more info log which will help me understand what happen exactly.

So like this one?

xwiki-platform-store-filesystem-oldcore-9.10.1-20171120.212448-1.jar

Remove this one?

xwiki-platform-store-filesystem-oldcore-9.10.jar

Do I need to rename the snapshot JAR file?

I just deleted and put the new file in place without renaming it. I don’t see any difference in the errors.

Tried renaming it to xwiki-platform-store-filesystem-oldcore-9.10.jar, no difference.

Actually this is the first one, not the last one (see the number at the end).

No need to rename anything, just remove xwiki-platform-store-filesystem-oldcore-9.10.jar.

Ok, trying with xwiki-platform-store-filesystem-oldcore-9.10.1-20171122.164241-3.jar.

All of the errors look the same as before. Do you want me to upload any of the Tomcat logs for you to look at?

You should have info log before the error.

Where would that log info be? In the tomcat8-stdout.2017-11-23.log file or somewhere else?

Wait, maybe I found it and if this the case, it’s hilarious (to me anyway):

2017-11-24 09:11:44,492 [XWiki initialization] INFO  .R910010XWIKI9065DataMigration - Storing attachment metadata [C:\opt\tomcat7\data\storage\xwiki\Main\Employee+Terminate+Procedure\~this\deleted-attachments\Contact+Supervisor.docx-1488383629338] in the database 
2017-11-24 09:11:44,492 [XWiki initialization] ERROR .HibernateDataMigrationManager - Failed to migrate database [xwiki]... 
com.xpn.xwiki.store.migration.DataMigrationException: Data migration R910010XWIKI9065 failed

I already reported that we were unable to rollback a particular page back in March (http://lists.xwiki.org/pipermail/users/2017-March/034778.html), which appeared to be due to an attachment issue.

We were never able to fix it, so we just deleted that page and created a new one.

Yep, I moved deleted-attachments out of that of the C:\opt\tomcat7\data\storage\xwiki\Main\Employee+Terminate+Procedure~this folder and XWiki loads. :slight_smile:

We don’t need those, but I saved that folder in case it’s helpful for testing.