A lot of entries of the following error message being logged in the Confluence log file:
2009-08-05 05:57:53,778 ERROR [TP-Processor125] [confluence.pages.thumbnail.DefaultThumbnailManager] getThumbnailsFolder Containing folders /sbclocal/confluence-data/xldn1324pap/confluence-2.10.2-home/thumbnails/147733919 for the attachment FXLM TB.jpeg could not be created
The thumbnail folders referenced in the error messages do exist on the server and contain the thumbnails.
As per Don's comment:
The code producing the error message is like this:
File thumbnailsFolder = new File(getThumbnailPath() + attachment.getContent().getId());
if (!thumbnailsFolder.exists())
{
boolean result = thumbnailsFolder.mkdirs();
if (!result)
log.error("Containing folders " + thumbnailsFolder.getAbsolutePath() + " for the attachment " + attachment.getFileName() + " could not be created");
}
I've noticed that in at least some cases of the error message there are multiple occurrences, for different files, in the same page. Note that the folder for the attachment is the folder for the page the attachment is on not necessarily the page being viewed.
My theory is that there's a race condition happening here and hence a spurious error message. I'll comment the code appropriately.
File thumbnailsFolder = new File(getThumbnailPath() + attachment.getContent().getId());
if (!thumbnailsFolder.exists())
{
boolean result = thumbnailsFolder.mkdirs();
if (!result)
log.error("Containing folders " + thumbnailsFolder.getAbsolutePath() + " for the attachment " + attachment.getFileName() + " could not be created");
}
The spurious error message could be dropped by modifying the code to :
File thumbnailsFolder = new File(getThumbnailPath() + attachment.getContent().getId());
if (!thumbnailsFolder.exists())
{
boolean result = thumbnailsFolder.mkdirs();
if (!result && !thumbnailsFolder.exists())
log.error("Containing folders " + thumbnailsFolder.getAbsolutePath() + " for the attachment " + attachment.getFileName() + " could not be created");
}
Or it could just be dropped. Note that this error would not be given if the confluence user had no filesystem permission. A SecurityException would be thrown instead.