Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

getDataFolder seems to be not always available #1179

Open
lonesomewalker opened this issue Sep 2, 2024 · 6 comments
Open

getDataFolder seems to be not always available #1179

lonesomewalker opened this issue Sep 2, 2024 · 6 comments

Comments

@lonesomewalker
Copy link

lonesomewalker commented Sep 2, 2024

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

@michalcharvat
Copy link
Contributor

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.

@lonesomewalker
Copy link
Author

lonesomewalker commented Sep 2, 2024

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?

var $file_storage_path = '/home/groupoffice/';

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?

@michalcharvat
Copy link
Contributor

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.

@lonesomewalker
Copy link
Author

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

@mschering
Copy link
Member

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?

@lonesomewalker
Copy link
Author

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants