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

AutoloadNotAllowedException #3569

Closed
RincewindWizzard opened this issue Feb 21, 2017 · 10 comments
Closed

AutoloadNotAllowedException #3569

RincewindWizzard opened this issue Feb 21, 2017 · 10 comments

Comments

@RincewindWizzard
Copy link

RincewindWizzard commented Feb 21, 2017

Steps to reproduce

Install a new nextcloud v11.0.1.2 with nginx and mysql as backend.
Use a data folder on an extern harddrive.

Expected behaviour

Normal running system.

Actual behaviour

Can not access any folder in Webbrowser.
Error Log from Nginx:

2017/02/21 20:59:55 [error] 7493#7493: *4748 FastCGI sent in stderr: "PHP message: PHP Fatal error:  Uncaught OCP\AutoloadNotAllowedException: Autoload path not allowed: /var/www/nextcloud_11/lib/private/legacy/response.php in /var/www/nextcloud_11/lib/autoloader.php:141
Stack trace:
#0 /var/www/nextcloud_11/lib/autoloader.php(167): OC\Autoloader->isValidPath('/var/www/nextcl...')
#1 [internal function]: OC\Autoloader->load('OC_Response')
#2 /var/www/nextcloud/remote.php(72): spl_autoload_call('OC_Response')
#3 /var/www/nextcloud/remote.php(168): handleException(Object(OCP\AutoloadNotAllowedException))
#4 {main}
  thrown in /var/www/nextcloud_11/lib/autoloader.php on line 141" while reading response header from upstream, client: 42.42.42.42, server: cloud.magierdinge.de, request: "PUT /remote.php/webdav/foo/auswahl/_1020015.JPG-chunking-3156893443-2-0 HTTP/1.1", upstream: "fastcgi://unix:/run/php/php7.0-fpm.sock:", host: "cloud.example.org"

Server configuration

Operating system:
Ubuntu 16.04.1 LTS
Linux foo 3.10.96-113 #1 SMP PREEMPT Wed Jul 6 22:19:28 UTC 2016 armv7l armv7l armv7l GNU/Linux

Web server: nginx

Database: mysql

PHP version:
PHP 7.0.13-0ubuntu0.16.04.1 (cli) ( NTS )
Copyright (c) 1997-2016 The PHP Group
Zend Engine v3.0.0, Copyright (c) 1998-2016 Zend Technologies
with Zend OPcache v7.0.13-0ubuntu0.16.04.1, Copyright (c) 1999-2016, by Zend Technologies

Nextcloud version: 11.0.1.2

Updated from an older Nextcloud/ownCloud or fresh install:
Error occurs on both.

Where did you install Nextcloud from: zip file from nextcloud homepage.

Hotfix:
If you replace

throw new AutoloadNotAllowedException($fullPath);

in lib/autoloader.php:141
with:
return true; //throw new AutoloadNotAllowedException($fullPath);

You can use nextcloud with no apparent problems.

@nickvergessen
Copy link
Member

Can you please before the modified line add:
error_log(json_encode(debug_backtrace()));

@RincewindWizzard
Copy link
Author

I tried to reproduce this today, but the error does not occur anymore.
I will message you, when this happens again.

@nickvergessen
Copy link
Member

Thanks, feel free to reopen the issue, when it happens again.

@ferdiga
Copy link

ferdiga commented Dec 5, 2017

I had the same problem,
after
return true; //throw new AutoloadNotAllowedException($fullPath);
I could access the admin pages
I uninstalled both office apps (which were not installed complete due to missing resources here) and now it works again

@kifeo
Copy link

kifeo commented Jan 24, 2018

I had the same issue, the return true fix did work.
This happened right before the update 12.0.5 arrived. I don't know if this is a hint.
The error_log(json_encode(debug_backtrace())); added line did not do anything, where should I find the generated output ?

Edit : the upgrade to 12.0.5 resolved the issue.

@zlaxy
Copy link

zlaxy commented Apr 30, 2018

nextcloud-13.0.2-r0 from AlpineLinux repository. Same issue.
Web server: nginx
Database: mysql
Hotfix from @RincewindWizzard fixed problem.

@sergiomb2
Copy link

sergiomb2 commented May 14, 2018

'version' => '13.0.2.1',

same issue, after
return true; //throw new AutoloadNotAllowedException($fullPath);
I could access the admin pages

after in https://x/index.php/settings/apps?category=files I removed Onlyoffice app and
could put back throw new AutoloadNotAllowedException($fullPath); and all works now ...

@ferdiga
Copy link

ferdiga commented Aug 29, 2018

NC 13.0.2
AutoloadNotAllowedException
Error should be displayed - not only logged -
it's a difference of administering NC or having access to the log files (which are nor really customer friendly to read )
I just had not only to disable but to remove disabled Bookmarks and OnlyOffice to access settings.
it would be great if this could be done interactively
in case of error - "Do you want to disable/remove [app-name] ..."

@mconway
Copy link

mconway commented Sep 23, 2018

@ferdiga Thank you for this! I didn't have OnlyOffice but removing Bookmarks fixed the admin page for me. V13.0.6

@heyunxu
Copy link

heyunxu commented Feb 24, 2019

出现这个问题的解决方案是因为:autoloader.php中的protected function isValidPath(string $fullPath)方法对于路径的判断,在windows中用\作为路径,但是循环中获取的路径是/,因此,出现错误。

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

No branches or pull requests

8 participants