groupoffice icon indicating copy to clipboard operation
groupoffice copied to clipboard

getDataFolder seems to be not always available

Open lonesomewalker opened this issue 1 year ago • 6 comments

Recent new installation, and from time to time i get:

ErrorException in /var/customers/webs/office/web/go/core/fs/Folder.php at line 349: is_dir():
open_basedir restriction in effect. File(/home/groupoffice/cache/disk) is not within the allowed path(s)

The thing is, i have installed GO for some years now, and this never happened in the past.

Traced it down to: go/core/cache/Disk.php

	public function __construct() {
		$this->folder = go()->getDataFolder()->getFolder('cache/disk');
		$this->folder->create();
	}

But i see in the config, that:

$config = array (
  'file_storage_path' => '/var/customers/webs/office/daten/',

And this is perfectly fine in open_basedir included, also writing possible.

Do i miss some config?

Thx

lonesomewalker avatar Sep 02 '24 11:09 lonesomewalker

This is related to hosting configuration. If you use Plesk/cPanel you can change open_basedir configuration under PHP Settings area. Also you can try gotest.php script to check if your configuration is correct.

michalcharvat avatar Sep 02 '24 11:09 michalcharvat

I do the hosting myself. I know how to split the data directory from web directory and never had issues in the past with the same config :-)

So, where does /home/groupoffice come from? Hardcoded?

https://github.com/Intermesh/groupoffice/blob/07636fc1d4f38193d021086cca8cb0eaf5898ba0/www/go/base/Config.php#L651

Sorry, this is not funny :-/

As i can see, this was done when migrating 6.2: https://github.com/Intermesh/groupoffice/blame/07636fc1d4f38193d021086cca8cb0eaf5898ba0/www/go/base/Config.php#L651

So, how is it possible, that this never was an issue for me, but now is occuring in the logs?

lonesomewalker avatar Sep 02 '24 12:09 lonesomewalker

It is not hardcoded, it is default value for the case when the file_storage_path configuration option is not defined. Verify your configuration. Put var_dump/var_export... to the line 1356 to see if everything is set correctly.

michalcharvat avatar Sep 02 '24 13:09 michalcharvat

Agree to that. But how can this be that this value does not come from config.php?

lonesomewalker avatar Sep 02 '24 13:09 lonesomewalker

You say you get it from time to time. What are you doing at that time? Could you enable debug and send us a stack trace?

mschering avatar Sep 05 '24 08:09 mschering

Will try, but the thing is, it is not me who produces it :D

lonesomewalker avatar Sep 05 '24 15:09 lonesomewalker