File permission issue casuing json error; unoconvd document conversion

Re: File permission issue casuing json error; unoconvd document conversion

by Tony Box -
Number of replies: 0

Hi Matteo,

Thanks for responding. I have not fixed this yet.  Aside from granting root permissions apache, I don't see any way to fix it. It seems there may need to be some changes made to Moodle core re: the document conversion process, and how it saves these temporary files to disk or how it checks that a file exists (in file_storage.php).

Note that this only happens when the unoconvd/openoffice conversion process is offloaded to a separate server. We had to do that due to performance issues when it ran on the webservers themselves. 

As I mentioned in my original post, there is no way to run the document conversion process as a user of your choosing or to have the document conversion process retain the original file permissions. (there actually is documentation in unoconvd for a flag that is supposed to retain the original file permissions but it doesn't seem to work) So, when the document conversion does its thing--saves a file owned by root:root-- and apache/Moodle attempts to overwrite the file using touch(), it can't.

The official Moodle documentation highlights the ability to run the document conversion on a separate server (and I don't see how this wouldn't be necessary for large Moodle sites) so I would expect this to work properly. That documentation was likely written before file_storage.php was modified to use touch(). touch() has inherent permissions issues. It's likely the offloading of the document conversion process used to work but it doesn't any longer.

Thanks,

Tony