Few problems related to Attachments, files stored on filesystems



  • I started over, deleted the database, filesystem files, web apps/xwiki.
  • Using a database to store attachments.
  • Deleted Pages tab in Page Index is not erroring out.
  • I haven’t tested attachments yet.

I deployed a basic wiki deployment and changed the attachment store to reside on the filesystem as I do expect some large file uploads. I had a few issues till I saw I needed to run the attachment porter which worked.

Here are some issues and I’m concerned about how to clean up this mess.

  • I create a test page, upload a few attachments which they show up in the filesystem which is great.
  • I delete one attachment or all of them from that page and the files are not removed from the filesystem.
  • I delete the versions of the pages, delete the deleted attachments from the page index in case they’re in the recycle bin. Files are still not deleted from the filesystem.
  • I delete the page itself via the wiki and and the files are still not deleted but the page is now gone from the wiki.
  • Delete the folder from the filesystem but I’m not sure if that will leave metadata/stale records between the filesystem and database. Is there a way to clean up this, a script or something? How can I do this manually?
  • If I goto the “Deleted Pages” tab to remove from the recycle bin thinking this might be the final stage to delete from the filesystem I get this script error which shows up in a red box - “Failed to execute the [velocity] macro. Cause: [null]. Click on this message for details.” So nothing gets listed and I’m not sure how to fix it and this happened since the first time I clicked the tab.

My concern is the filesystem might not be stable and easily correctable if problems arise. Can I move the filesystem files back into the database? How can you reference a file to a database metadata entry to ensure your data is valid? I don’t want to run this wiki in production and something happens and now I got stale files which might lead to even more problems and a large amount of space eaten up which I can’t fix.

Maybe its best to keep the files in the database going forward?

I don’t reproduce that on 9.9. The folder of the attachment is still there but empty, maybe this fooled you ?

That is likely what happened, I remember the color being blue but the name of the entry would be of a file name, example being the folder name matched the attachment filename which threw me off at a quick glance. I just checked and folders are blue and files are white.

I did delete everything and started over with a fresh configuration using the database method to store attachments. I will wait till 9.10 before I migrate over to a filesystem again and run some tests as there is a bug fix for attachments in that release.

I do recall after a reboot, what I thought was files for that test page did disappear all of them except one so I’m not sure what is going on there. Is there a cleanup process to delete stale entries? I really don’t like seeing folders sticking around after the attachment and recycle bin have been removed.

Yes during initialization the filesystem store delete empty folders.

I agree, we’ll need to optimize it a bit at some point.