Show warning that windows is unsupported instead of throwing an exception #26208

ghost opened this Issue Sep 24, 2016 · 6 comments


None yet

3 participants

ghost commented Sep 24, 2016 edited

There are still people trying to run ownCloud on windows like seen e.g. at #26207, #24649 (comment) or

IIRC in older versions a warning was shown that windows isn't supported. Current oC versions are just bailing out with an internal server error / white page and an autoload exception in the logfiles.

To avoid repeating reported issues it could make sense to show such a warning again instead of throwing an internal server error.

Edit exception examples:

{"reqId":"JfnIJsPx3KCJNNLcbn7y","remoteAddr":"::1","app":"index","message":"Exception: {\"Exception\":\"OCP\\\\AutoloadNotAllowedException\",\"Message\":\"Autoload path not allowed: C:\\\\xampp\\\\htdocs\\\\owncloud\\\\lib\\\\private\\\\legacy\\\\util.php\",\"Code\":0,\"Trace\":\"#0 C:\\\\xampp\\\\htdocs\\\\owncloud\\\\lib\\\\autoloader.php(157): OC\\\\Autoloader->isValidPath('C:\\\\\\\\xampp\\\\\\\\htdocs...')\\n#1 [internal function]: OC\\\\Autoloader->load('OC_Util')\\n#2 C:\\\\xampp\\\\htdocs\\\\owncloud\\\\lib\\\\base.php(557): spl_autoload_call('OC_Util')\\n#3 C:\\\\xampp\\\\htdocs\\\\owncloud\\\\lib\\\\base.php(973): OC::init()\\n#4 C:\\\\xampp\\\\htdocs\\\\owncloud\\\\index.php(37): require('C:\\\\\\\\xampp\\\\\\\\htdocs...')\\n#5 {main}\",\"File\":\"C:\\\\xampp\\\\htdocs\\\\owncloud\\\\lib\\\\autoloader.php\",\"Line\":133}","level":3,"time":"2016-09-23T20:52:25+00:00","method":"GET","url":"\/owncloud\/","user":"--"} [Fri Sep 23 23:52:25.940459 2016] [:error] [pid 8032:tid 1880] [client ::1:51765] PHP Fatal error: Uncaught exception 'OCP\AutoloadNotAllowedException' with message 'Autoload path not allowed: C:\xampp\htdocs\owncloud\lib\private\legacy\response.php' in C:\xampp\htdocs\owncloud\lib\autoloader.php:133\nStack trace:\n#0 C:\xampp\htdocs\owncloud\lib\autoloader.php(157): OC\Autoloader->isValidPath('C:\\xampp\\htdocs...')\n#1 [internal function]: OC\Autoloader->load('OC_Response')\n#2 C:\xampp\htdocs\owncloud\index.php(54): spl_autoload_call('OC_Response')\n#3 {main}\n thrown in C:\xampp\htdocs\owncloud\lib\autoloader.php on line 133


Fatal error: Uncaught Error: Class 'OCP\AutoloadNotAllowedException' not found in C:- Portable\xampp-portable\xampp\htdocs\owncloud\lib\autoloader.php:152 Stack trace:
#0 C:- Portable\xampp-portable\xampp\htdocs\owncloud\lib\autoloader.php(172): OC\Autoloader->isValidPath('C:- Portable\x...')
#1 [internal function]: OC\Autoloader->load('OCP\AutoloadNot...')
#2 C:- Portable\xampp-portable\xampp\htdocs\owncloud\lib\autoloader.php(152): spl_autoload_call('OCP\AutoloadNot...')
#3 C:- Portable\xampp-portable\xampp\htdocs\owncloud\lib\autoloader.php(172): OC\Autoloader->isValidPath('C:- Portable\x...')
#4 [internal function]: OC\Autoloader->load('OC\Config')
#5 C:- Portable\xampp-portable\xampp\htdocs\owncloud\lib\base.php(133): spl_autoload_call('OC\Config')
#6 C:- Portable\xampp-portable\xampp\htdocs\owncloud\lib\base.php(506): OC::initPaths()
#7 C:- Portable\xampp-portable\xampp\htdocs\owncloud\lib\base.php(1112): OC::init()
#8 C:- Portable\xampp-portable\xampp\htdocs\owncloud\index.php(37): require_once('C in C:- Portable\xampp-portable\xampp\htdocs\owncloud\lib\autoloader.php on line 152


ghost commented Sep 24, 2016

The code from #14540 seems to be still there:

It seems oC is not able to get there to warn the user

@PVince81 PVince81 added this to the backlog milestone Sep 27, 2016
andypmw commented Oct 5, 2016 edited

Hi @RealRancor ,
i think the problem is the PHP's short array syntax.

as you pointed line 651, it use PHP'S short array syntax introduced at PHP 5.4:
$errors[] = ['error' => 'error_123', 'hint' => 'It is an error'];

When I read the code at line 644 and line 667, it use old PHP array syntax:
$errors[] = array('error' => 'error_123', 'hint' => 'It is an error');

So the older version than PHP 5.4 will face this problem.

I have check the util.php file at master branch, all array() syntax has been converted to new array syntax.

And I have check the minimum requirement to run ownCloud at this page:
It stated requirement: Server OS requires PHP 5.4 or greater (5.6 recommended)

So... I think it safe to close this issue?


@ghost Unknown referenced this issue Oct 8, 2016

Remove checks whether OC is running on Windows #26304

4 of 10 tasks complete
ghost commented Oct 8, 2016 edited

@andypmw Thanks for the research.

So the older version than PHP 5.4 will face this problem.

Doesn't look like this. The users in #26207 had used PHP 5.5 where the user in #24649 (comment) even PHP 7.0.x

Have added the exception in the first comment to make it clear where the issue is coming from.

@ghost Unknown referenced this issue Oct 8, 2016

Fail earlier on Windows. #26316

4 of 9 tasks complete
ghost commented Oct 8, 2016

Why we not just fail directly in the index.php like its done for PHP? PR here: #26316


Argh... yeah index.php might be easier.
The trouble with all this is that depending on what PHP version someone is running on Windows, not all source code might load properly.

ghost commented Oct 12, 2016

#26316 was merged so closing.

@ghost ghost closed this Oct 12, 2016
@DeepDiver1975 DeepDiver1975 modified the milestone: 9.2, backlog Oct 12, 2016
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment