1

Earlier today I installed Tuleap like instructed on CentOS 6.7. Most of it works, but when I try to add a document with the DocumentManager, I get the following error: Error while creating initial version.

I looked into the log files of httpd [Sun Jan 03 16:45:36 2016] [error] [client 192.168.99.6] PHP Warning: mkdir():$Permission denied in /usr/share/tuleap/plugins/docman/include/Docman_FileStorage.class.php on line 112, referer: (domain)/plugins/docman/?group_id=101$

I now know that it is a permission problem, but I do not know where these files are being stored and how to get the permissions right. Does anyone can give me a direction on where to look?

Thank you in advance!

Kjell
  • 432
  • 4
  • 11

1 Answers1

0

Solved.

When closely observed inside the httpd error log, it stated that it wanted to put the file in the root directory. Of course this isn't permitted. Therefore, it was needed to change the filepath that is created automatically by Domcman.

I found the Docman_FileStorage.class.php file that is causing the automatic path creation inside /usr/share/tuleap/plugins/docman/include and edited the getPath function/variable $path to /var/lib/tuleap/docman, so it would have the correct path.

For the complete edited function, see below:

    */
function _getPath($name, $group_id, $item_id, $version_number) {
    $name = preg_replace('`[^a-z0-9_-]`i', '_', $name);
    $name = preg_replace('`_{2,}`', '_', $name);
    $hash1 = $item_id % 10;
    $hash2 = ( ($item_id - $hash1) / 10) % 10;

    $path_elements = array($this->root, $this->_getGroupName($group_id), $hash2, $hash1, $item_id, $version_number);
    $path = '/var/lib/tuleap/docman';
    foreach($path_elements as $elem) {
        $path .= $elem .'/';
        if (!is_dir($path)) {
            mkdir($path, 0700);
        }
    }

    $path .= $name;
    return $path;
}
Kjell
  • 432
  • 4
  • 11
  • As Tuleap developer I wouldn't advise that you continue with such a modification as it works on other servers by default. Moreover, the root path is already pre-set on `$path_elements` line. I would check, in docman plugin configuration, the value of "docman_root" insteadl – Manuel VACELET Jan 04 '16 at 12:32
  • I will take a look at it. Thanks for the advise! – Kjell Jan 04 '16 at 17:28