Hi all
We’ve upgraded xwiki from 10.1 to 10.4 recently, and we ran into problems with the attachments. Some details:
- Everything is stored in the DB. Everything. Attachments too.
- A fair number of pages and their attachments are pushed from our system to XWIKI using the REST API
- In order to avoid our DB to get flooded by attachments, I disabled versioning and run a
DELETE
before IPUT
- After the upgrade, the attachments disappeared (only the pushed ones)
Investigating on the issue I figured that there were changes in xwiki.cfg
. My current (non-working) config looks like this:
xwiki.store.recyclebin.content.hint=hibernate
xwiki.store.attachment.hint=hibernate
xwiki.store.attachment.versioning.hint=hibernate ## was set to void before
xwiki.store.attachment.recyclebin.content.hint=hibernate
xwiki.store.attachment.recyclebin.hint=hibernate
storage.attachment.recyclebin=1
xwiki.store.attachment.versioning=0
I noticed a few things:
-
storage.attachment.recyclebin
doesn’t follow the naming conventions - There seem to be two spots to disable versioning:
- Setting the versioning hint to
void
- Setting attachment versioning to
0
- Setting the versioning hint to
Now, what happens is a bit strange. We first noticed that attachments didn’t get uploaded. I checked the logs and saw an error 500 in response to the DELETE
call:
Response: com.xpn.xwiki.XWikiException: Error number 0 in 3: Failed to store
deleted attachment [Attachment xwiki:105 Module Descriptions.LCR.LCR
Views.WebHome@A01240_00423.jpg]
However, the attachment was uploaded correctly. While playing around with the cfg I found that the attachment disappear after I touch web.xml
to bounce the Wiki. They’re gone completely, vanished. When I push the upload again, they reappear and stay there until I bounce the web app the next time.
Simply put: I’d like to keep everything in the DB and turn off versioning for the attachments. What’s wrong with my settings?
Update
I tried to delete one of the disappeared attachments manually, just to see whether the exception comes up, too. It didn’t. I started the automatic upload again and it worked without error message. All subsequent automatic uploads worked now.
It seems that there are attachments which aren’t real attachments, sort of. Here’s a screenshot:
The first one (A01241_00415.jpg) is the one that survives a restart and a re-upload. The others first complain with the 500 error, then appear correctly until I bounce the application.
How do I find attachments which are in such an invalid state?
Thanks a ton in advance!
André