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

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

Closed
ghost opened this Issue Sep 24, 2016 · 6 comments

Comments

Projects
None yet
4 participants
@ghost

ghost commented Sep 24, 2016

There are still people trying to run ownCloud on windows like seen e.g. at #26207, #24649 (comment) or https://central.owncloud.org/t/blank-page-on-local-xampp-nothing-to-display-no-login-page-no-any-other-contant/2231

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

and

``
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

This comment has been minimized.

Show comment
Hide comment
@ghost

ghost Sep 24, 2016

The code from #14540 seems to be still there: https://github.com/owncloud/core/blob/v9.1.1/lib/private/legacy/util.php#L651

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

ghost commented Sep 24, 2016

The code from #14540 seems to be still there: https://github.com/owncloud/core/blob/v9.1.1/lib/private/legacy/util.php#L651

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

This comment has been minimized.

Show comment
Hide comment
@andypmw

andypmw Oct 5, 2016

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:
https://owncloud.com/minimum-product-requirements/
It stated requirement: Server OS requires PHP 5.4 or greater (5.6 recommended)

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

References:

andypmw commented Oct 5, 2016

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:
https://owncloud.com/minimum-product-requirements/
It stated requirement: Server OS requires PHP 5.4 or greater (5.6 recommended)

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

References:

@ghost ghost referenced this issue Oct 8, 2016

Merged

Remove checks whether OC is running on Windows #26304

4 of 10 tasks complete
@ghost

This comment has been minimized.

Show comment
Hide comment
@ghost

ghost Oct 8, 2016

@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 commented Oct 8, 2016

@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 ghost referenced this issue Oct 8, 2016

Merged

Fail earlier on Windows. #26316

4 of 9 tasks complete
@ghost

This comment has been minimized.

Show comment
Hide comment
@ghost

ghost Oct 8, 2016

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

ghost commented Oct 8, 2016

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

@PVince81

This comment has been minimized.

Show comment
Hide comment
@PVince81

PVince81 Oct 10, 2016

Member

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.

Member

PVince81 commented Oct 10, 2016

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

This comment has been minimized.

Show comment
Hide comment
@ghost

ghost Oct 12, 2016

#26316 was merged so closing.

ghost commented Oct 12, 2016

#26316 was merged so closing.

@ghost ghost closed this Oct 12, 2016

@DeepDiver1975 DeepDiver1975 modified the milestones: 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