Upgrade 8.4.6 to 9.11.2: issue with deleted attachments


#1

Hello,

I tryy to upgrade my xwiki but migration wizard is not launched and I have this error:

....
org.hibernate.HibernateException: Failed to move deleted attachments metadata to the database
	org.xwiki.store.filesystem.internal.migration.R910100XWIKI14871DataMigration$1.doInHibernate(R910100XWIKI14871DataMigration.java:119)
	org.xwiki.store.filesystem.internal.migration.R910100XWIKI14871DataMigration$1.doInHibernate(R910100XWIKI14871DataMigration.java:112)
	com.xpn.xwiki.store.XWikiHibernateBaseStore.execute(XWikiHibernateBaseStore.java:904)
	com.xpn.xwiki.store.XWikiHibernateBaseStore.executeWrite(XWikiHibernateBaseStore.java:1017)
	org.xwiki.store.filesystem.internal.migration.R910100XWIKI14871DataMigration.hibernateMigrate(R910100XWIKI14871DataMigration.java

I read this post: https://forum.xwiki.org/t/upgrade-9-9-to-9-10-failed-to-load-component-for-type-interface-com-xpn-xwiki-store-attachmentrecyclebinstore-for-hint-file/896/32

and I wonder if I must delete all my /xxxdata_xwiki/storage/xwiki/xxxxx/~this/deleted-attachments subdirectory and ~GLOBAL_DELETED_ATTACHMENT_ID_MAPPINGS.xml file ?

I have theses settings in xwiki.cfg:

xwiki.store.attachment.hint=file
xwiki.store.attachment.recyclebin.content.hint=file
xwiki.store.attachment.recyclebin.hint=file
xwiki.store.attachment.versioning.hint=file

Thxs for any help.

Pascal B

NB: I have this issue too but I don’t think it is the cause of my issue:

14-Mar-2018 11:11:38.226 SEVERE [xwiki-dev.dom.cp2i.i2-startStop-1] org.apache.catalina.startup.ContextConfig.processAnno
tationsJar Unable to process Jar entry [module-info.class] from Jar [jar:file:/home/xwiki-dev/xwiki/WEB-INF/lib/jaxb-api-
2.3.0.jar!/] for annotations
 org.apache.tomcat.util.bcel.classfile.ClassFormatException: Invalid byte tag in constant pool: 19

#2

Which database engine is this ?

The error you pasted seems to be missing the cause. Could you paste the full error.

This one is wrong. This is deprecated pre 9.9 configuration. See https://www.xwiki.org/xwiki/bin/view/Documentation/AdminGuide/Attachments#HFilesystemAttachmentStore.

This is an harmless Tomcat but fixed in more recent versions of Tomcat.


#3

There are both settings in 9.11.x: xwiki.store.attachment.recyclebin.content.hint and xwiki.store.attachment.recyclebin.hint

I disabled “xwiki.store.attachment.recyclebin.hint”, here the stacktrace (I can paste catalina.out if needed).
I use debian jessie + apache-tomcat-8.0.33 + postgresql 9.1.8 and attachment in filesystem
https://pastebin.com/Hh0frQ8N

thxs


#4

You missed the fact that those settings are separated in two sections: Stores with both "hibernate" and "file" support by default. and Stores with only "hibernate" support by default. xwiki.store.attachment.recyclebin.hint exist, what is deprecated is xwiki.store.attachment.recyclebin.hint=file.

note La trace complète de la cause mère de cette erreur est disponible dans les fichiers journaux de Apache Tomcat/8.0.33.

Would be great if you could do that :slight_smile:


#5

To try to debug, I remove ~GLOBAL_DELETED_ATTACHMENT_ID_MAPPINGS.xml file file and restart tomcat.

This time log file going further with:

2018-03-14 15:10:35,453 [XWiki initialization] INFO  .HibernateDataMigrationManager - Starting data migration [R910100XWIKI14871] with version [910100] on database [xwiki] 
2018-03-14 15:10:35,463 [XWiki initialization] INFO  R910100XWIKI14871DataMigration - Migrating filesystem attachment metadatas storded in [/home/data_xwiki/storage] 
2018-03-14 15:10:35,533 [XWiki initialization] INFO  .HibernateDataMigrationManager - Data migration [R910100XWIKI14871] applied successfully, database [xwiki] upgraded to version [910100] 
2018-03-14 15:10:35,534 [XWiki initialization] INFO  .HibernateDataMigrationManager - Starting data migration [R911000XWIKI14889] with version [911000] on database [xwiki] 
2018-03-14 15:10:35,544 [XWiki initialization] INFO  .HibernateDataMigrationManager - Data migration [R911000XWIKI14889] applied successfully, database [xwiki] upgraded to version [911000] 
2018-03-14 15:10:35,545 [XWiki initialization] INFO  .HibernateDataMigrationManager - Starting data migration [R911001XWIKI14895] with version [911001] on database [xwiki] 
2018-03-14 15:10:35,557 [XWiki initialization] INFO  .HibernateDataMigrationManager - Data migration [R911001XWIKI14895] applied successfully, database [xwiki] upgraded to version [911001] 
2018-03-14 15:10:37,775 [XWiki Solr index thread] WARN  onfiguredQueryExecutorProvider - Could not find a QueryExecutor with hint [hibernate] which is the hint for the storage engine, defined in your XWiki configuration under the

xwiki start was freezing at 99% but after a tomcat restart+cleaning work/temp, the distribution wizard displayed.

I’m confuse with your new setting about xwiki.store.attachment.recyclebin.hint=file. (I think I don’t understand very well). Do you mean that attachment recyclebin is in database now?

I must use?

xwiki.store.attachment.hint=file
xwiki.store.attachment.recyclebin.content.hint=file
xwiki.store.attachment.recyclebin.hint=hibernate
xwiki.store.attachment.versioning.hint=file

#6

Do you mean that attachment recyclebin is in database now?

Not exactly, deleted attachment METADATA are now in the database but the CONTENT of the attachment is stored in the filesystem store. That’s why you now use xwiki.store.attachment.recyclebin.content.hint instead of xwiki.store.attachment.recyclebin.hint.

This is exactly the same logic than non deleted attachments.

You don’t need to set xwiki.store.attachment.recyclebin.hint at all. It’s not used anymore in the context of filesystem attachments. It could be used by other stores which is why this property is still there but for local filesystem it was simpler to separate medata from actual content.


#7

Ok, thxs, then I followed your doc: https://www.xwiki.org/xwiki/bin/view/Documentation/AdminGuide/Attachments#HFilesystemAttachmentStore and enabled these for filesystem attachment storage :

#-# [Since 9.0RC1] The default document content recycle bin storage.
xwiki.store.recyclebin.content.hint=file
#-# The attachment storage.
xwiki.store.attachment.hint=file
#-# The attachment versioning storage.
xwiki.store.attachment.versioning.hint=file
#-# [Since 9.9RC1] The default attachment content recycle bin storage. 
xwiki.store.attachment.recyclebin.content.hint=file
#-# 

By the ways, I didn’t managed to reproduce my issue ( even after I restored data and database), distribution wizard is displayed. Then I can not give you a full log file. sorry

Ty for your help