Wrong Server Path in Repository Instance Creation

Wrong Server Path in Repository Instance Creation

Antonis L. -
回帖数:7

Hi all, I was wondering if anyone could help.

While trying to create my first repository instance, I get this warning below the name field 

"You need to create at least one folder inside the /home/customer/www/moodle.XXemacXXX.gr/omixofqj/repository/ directory so you can select it here."

and no dropdown list is shown. 

The problem is that the whole indicated path is wrong. The site is in a plesk installation, so all vhosts are in 

/var/www/vhosts/ 

and not /home/customer etc.  The /home directory is just empty. tried to recreate the path to see what happens to the error, but no luck.

I created the repository folder in my moodledata directory, and a test subfolder, but the problem remains.

Data root in config.php is correct
$CFG->dataroot  = '/var/www/vhosts/XXemacXXX.gr/moodle.XXemacXXXX.gr/moodledata';

No instance is created.. Any ideas?

回复Antonis L.

Re: Wrong Server Path in Repository Instance Creation

Ken Task -
Particularly helpful Moodlers的头像

Plesk has openbase directory restriction in place.  You migh need to add the path to this repository.

When attempting to setup a file system repository, moodle will not/cannot create a directory in moodledata/repository/ ... must be done via panel or command line.

Once that directory is in place, set up in the Moodle admin will show it ... if openbase directory isn't restricting.

Don't host/use Plesk ... above based upon attempting to assist one time ... some time ago ... and that's what I re-collect ... but, maybe my synapses aren't working! :|

'SoS', Ken


回复Ken Task

Re: Wrong Server Path in Repository Instance Creation

Antonis L. -
Thank you for the reply!
The directory is setup in moodledata/repository/ but it doesn't show up..
I will see about the openbase in Plesk
What strikes me strange is where does moodle find that absolute path it is showing on the error, the /home/customer/www/moodle.XXemacXXX.gr/omixofqj/repository/   which doesn't exist anywhere
回复Antonis L.

Re: Wrong Server Path in Repository Instance Creation

Visvanath Ratnaweera -
Particularly helpful Moodlers的头像 Translators的头像
If your $CFG->dataroot is /var/www/vhosts/XXemacXXX.gr/moodle.XXemacXXXX.gr/moodledata, then the Moodle file system repository will be /var/www/vhosts/XXemacXXX.gr/moodle.XXemacXXXX.gr/moodledata/repository. See https://docs.moodle.org/en/File_system_repository#Creating_folders_for_your_file_system_repositories.

Moodle finds it appending /repository to $CFG->dataroot.
回复Antonis L.

Re: Wrong Server Path in Repository Instance Creation

Howard Miller -
Core developers的头像 Documentation writers的头像 Particularly helpful Moodlers的头像 Peer reviewers的头像 Plugin developers的头像
I even checked the code.... the directory it is checking for (and complaining doesn't exist) is simply created by...

$CFG->dataroot . '/repository/';

Which would imply that $CFG->dataroot is not as stated. Which is odd.

I'm not sure why Ken thinks this is anything to do with open_basedir but I know nothing whatever about Plesk.
回复Howard Miller

Re: Wrong Server Path in Repository Instance Creation

Antonis L. -
Yes I looked at the code as well, seeing the $CFG->dataroot . '/repository/';
the dataroot is as stated
$CFG->dataroot = '/var/www/vhosts/XXemacXXX.gr/moodle.XXemacXXXX.gr/moodledata';
nothing else in moodle has an error, and I guess that many things would have be broken if the dataroot wasn;t correctly defined
I will try to hard code the correct directory to see what happens
回复Antonis L.

Re: Wrong Server Path in Repository Instance Creation

Antonis L. -
Guys sorry for the trouble.. Turns out the hosting was moved to another server and I was looking the wrong FTP..
If you think, you may delete this Thread, as I think doesn't provide any help to others 微笑
Sorry again
回复Howard Miller

Re: Wrong Server Path in Repository Instance Creation

Ken Task -
Particularly helpful Moodlers的头像

Plesk is the most restrictive hosting panel when it comes to location of moodledata.  If one attempts to follow Moodle doc recommendations about location of moodledata,  one will run into issues.

https://support.plesk.com/hc/en-us/articles/360006170513-How-to-add-custom-or-additional-path-to-the-open-basedir-option-for-Plesk-domain-

But, we now know it was wrong server?! 微笑

'SoS', Ken