Open_Basedir PHP Errors NC 21.0.03 Fresh Installl

I am on Debian 10.5 using ISPConfig 3 and NC 21.0.03 (fresh install). I have the following php errors on my logging page regarding open_basedir restrictions.

#1

Error: file_exists(): open_basedir restriction in effect. File(/appinfo/routes.php) is not within the allowed path(s): (/var/www/clients/clientXX/webXX/web:/var/www/clients/clientXX/webXX/private:/var/www/clients/clientXX/webXX/tmp:/var/www/exmaple.com/web:/srv/www/exmaple.com/web:/usr/share/php5:/usr/share/php:/tmp:/usr/share/phpmyadmin:/etc/phpmyadmin:/var/lib/phpmyadmin:/dev/random:/dev/urandom:/var/www/clients/clientXX/webXX/web/lib/private/Route/) at /var/www/clients/clientXX/webXX/web/lib/private/Route/Router.php#135

0. <<closure>>OC\Log\ErrorHandler::onError()
1. /var/www/clients/clientXX/webXX/web/lib/private/Route/Router.php - line 135: file_exists()
2. /var/www/clients/clientXX/webXX/web/lib/private/Route/Router.php - line 259: OC\Route\Router->loadRoutes()
3. /var/www/clients/clientXX/webXX/web/lib/private/Route/Router.php - line 294: OC\Route\Router->findMatchingRoute()
4. /var/www/clients/clientXX/webXX/web/lib/base.php - line 993: OC\Route\Router->match()
5. /var/www/clients/clientXX/webXX/web/index.php - line 37: OC::handleRequest()

#2

Error: is_file(): open_basedir restriction in effect. File(/l10n/en.js) is not within the allowed path(s): (/var/www/clients/clientXX/webXX/web:/var/www/clients/clientXX/webXX/private:/var/www/clients/clientXX/webXX/tmp:/var/www/exmaple.com/web:/srv/www/exmaple.com/web:/usr/share/php5:/usr/share/php:/tmp:/usr/share/phpmyadmin:/etc/phpmyadmin:/var/lib/phpmyadmin:/dev/random:/dev/urandom:/var/www/clients/clientXX/webXX/web/lib/private/Route/) at /var/www/clients/clientXX/webXX/web/lib/private/Template/ResourceLocator.php#106

0. <<closure>>OC\Log\ErrorHandler::onError()
1. /var/www/clients/clientXX/webXX/web/lib/private/Template/ResourceLocator.php - line 106: is_file()
2. /var/www/clients/clientXX/webXX/web/lib/private/Template/JSResourceLocator.php - line 91: OC\Template\ResourceLocator->appendIfExist()
3. /var/www/clients/clientXX/webXX/web/lib/private/Template/ResourceLocator.php - line 79: OC\Template\JSResourceLocator->doFind()
4. /var/www/clients/clientXX/webXX/web/lib/private/TemplateLayout.php - line 365: OC\Template\ResourceLocator->find()
5. /var/www/clients/clientXX/webXX/web/lib/private/TemplateLayout.php - line 193: OC\TemplateLayout::findJavascriptFiles()
6. /var/www/clients/clientXX/webXX/web/lib/private/legacy/OC_Template.php - line 183: OC\TemplateLayout->__construct()
7. /var/www/clients/clientXX/webXX/web/lib/public/AppFramework/Http/TemplateResponse.php - line 210: OC_Template->fetchPage()
8. /var/www/clients/clientXX/webXX/web/lib/private/AppFramework/Http/Dispatcher.php - line 172: OCP\AppFramework\Http\TemplateResponse->render()
9. /var/www/clients/clientXX/webXX/web/lib/private/AppFramework/App.php - line 157: OC\AppFramework\Http\Dispatcher->dispatch()
10. /var/www/clients/clientXX/webXX/web/lib/private/Route/Router.php - line 302: OC\AppFramework\App::main()
11. /var/www/clients/clientXX/webXX/web/lib/base.php - line 993: OC\Route\Router->match()
12. /var/www/clients/clientXX/webXX/web/index.php - line 37: OC::handleRequest()

#3

Error: file_exists(): open_basedir restriction in effect. File(/templates/) is not within the allowed path(s): (/var/www/clients/clientXX/webXX/web:/var/www/clients/clientXX/webXX/private:/var/www/clients/clientXX/webXX/tmp:/var/www/exmaple.com/web:/srv/www/exmaple.com/web:/usr/share/php5:/usr/share/php:/tmp:/usr/share/phpmyadmin:/etc/phpmyadmin:/var/lib/phpmyadmin:/dev/random:/dev/urandom:/var/www/clients/clientXX/webXX/web/lib/private/Route/) at /var/www/clients/clientXX/webXX/web/lib/private/Template/Base.php#68

0. <<closure>>OC\Log\ErrorHandler::onError()
1. /var/www/clients/clientXX/webXX/web/lib/private/Template/Base.php - line 68: file_exists()
2. /var/www/clients/clientXX/webXX/web/lib/private/legacy/OC_Template.php - line 147: OC\Template\Base->getAppTemplateDirs()
3. /var/www/clients/clientXX/webXX/web/lib/private/legacy/OC_Template.php - line 89: OC_Template->findTemplate()
4. /var/www/clients/clientXX/webXX/web/lib/private/TemplateLayout.php - line 92: OC_Template->__construct()
5. /var/www/clients/clientXX/webXX/web/lib/private/legacy/OC_Template.php - line 183: OC\TemplateLayout->__construct()
6. /var/www/clients/clientXX/webXX/web/lib/public/AppFramework/Http/TemplateResponse.php - line 210: OC_Template->fetchPage()
7. /var/www/clients/clientXX/webXX/web/lib/private/AppFramework/Http/Dispatcher.php - line 172: OCP\AppFramework\Http\TemplateResponse->render()
8. /var/www/clients/clientXX/webXX/web/lib/private/AppFramework/App.php - line 157: OC\AppFramework\Http\Dispatcher->dispatch()
9. /var/www/clients/clientXX/webXX/web/lib/private/Route/Router.php - line 302: OC\AppFramework\App::main()
10. /var/www/clients/clientXX/webXX/web/lib/base.php - line 993: OC\Route\Router->match()
11. /var/www/clients/clientXX/webXX/web/index.php - line 37: OC::handleRequest()

However, when I check my ISPConfig Domains → Websites → options I have:

/var/www/clients/clientXX/webXX/web:/var/www/clients/clientXX/webXX/private:/var/www/clients/clientXX/webXX/tmp:/var/www/exmaple.com/web:/srv/www/exmaple.com/web:/usr/share/php5:/usr/share/php:/tmp:/usr/share/phpmyadmin:/etc/phpmyadmin:/var/lib/phpmyadmin:/dev/random:/dev/urandom

It should also be noted that when I run:

php --define apc.enable_cli=1 occ maintenance:repair

I get the following error (also php-related, I am not sure if these are two separate issues):

{"reqId":"MrLW4frKP8WKnCPpdG0b","level":0,"time":"2021-07-20T00:59:35+00:00","remoteAddr":"","user":"--","app":"user_ispconfig","method":"","url":"--","message":"/appinfo/app.php is deprecated, use \\OCP\\AppFramework\\Bootstrap\\IBootstrap on the application class instead.","userAgent":"--","version":"21.0.3.1"}
{"reqId":"MrLW4frKP8WKnCPpdG0b","level":0,"time":"2021-07-20T00:59:35+00:00","remoteAddr":"","user":"--","app":"appointments","method":"","url":"--","message":"/appinfo/app.php is deprecated, use \\OCP\\AppFramework\\Bootstrap\\IBootstrap on the application class instead.","userAgent":"--","version":"21.0.3.1"}
{"reqId":"MrLW4frKP8WKnCPpdG0b","level":0,"time":"2021-07-20T00:59:35+00:00","remoteAddr":"","user":"--","app":"apporder","method":"","url":"--","message":"/appinfo/app.php is deprecated, use \\OCP\\AppFramework\\Bootstrap\\IBootstrap on the application class instead.","userAgent":"--","version":"21.0.3.1"}
{"reqId":"MrLW4frKP8WKnCPpdG0b","level":0,"time":"2021-07-20T00:59:35+00:00","remoteAddr":"","user":"--","app":"audioplayer_editor","method":"","url":"--","message":"/appinfo/app.php is deprecated, use \\OCP\\AppFramework\\Bootstrap\\IBootstrap on the application class instead.","userAgent":"--","version":"21.0.3.1"}
{"reqId":"MrLW4frKP8WKnCPpdG0b","level":0,"time":"2021-07-20T00:59:35+00:00","remoteAddr":"","user":"--","app":"audioplayer_sonos","method":"","url":"--","message":"/appinfo/app.php is deprecated, use \\OCP\\AppFramework\\Bootstrap\\IBootstrap on the application class instead.","userAgent":"--","version":"21.0.3.1"}
{"reqId":"MrLW4frKP8WKnCPpdG0b","level":0,"time":"2021-07-20T00:59:35+00:00","remoteAddr":"","user":"--","app":"camerarawpreviews","method":"","url":"--","message":"/appinfo/app.php is deprecated, use \\OCP\\AppFramework\\Bootstrap\\IBootstrap on the application class instead.","userAgent":"--","version":"21.0.3.1"}
{"reqId":"MrLW4frKP8WKnCPpdG0b","level":0,"time":"2021-07-20T00:59:35+00:00","remoteAddr":"","user":"--","app":"serverDI","method":"","url":"--","message":"The requested alias \"PreviewManager\" is deprecated. Please request \"OCP\\IPreview\" directly. This alias will be removed in a future Nextcloud version.","userAgent":"--","version":"21.0.3.1"}
{"reqId":"MrLW4frKP8WKnCPpdG0b","level":0,"time":"2021-07-20T00:59:35+00:00","remoteAddr":"","user":"--","app":"contacts","method":"","url":"--","message":"/appinfo/app.php is deprecated, use \\OCP\\AppFramework\\Bootstrap\\IBootstrap on the application class instead.","userAgent":"--","version":"21.0.3.1"}
{"reqId":"MrLW4frKP8WKnCPpdG0b","level":0,"time":"2021-07-20T00:59:35+00:00","remoteAddr":"","user":"--","app":"files_antivirus","method":"","url":"--","message":"/appinfo/app.php is deprecated, use \\OCP\\AppFramework\\Bootstrap\\IBootstrap on the application class instead.","userAgent":"--","version":"21.0.3.1"}
{"reqId":"MrLW4frKP8WKnCPpdG0b","level":0,"time":"2021-07-20T00:59:36+00:00","remoteAddr":"","user":"--","app":"drawio","method":"","url":"--","message":"/appinfo/app.php is deprecated, use \\OCP\\AppFramework\\Bootstrap\\IBootstrap on the application class instead.","userAgent":"--","version":"21.0.3.1"}
{"reqId":"MrLW4frKP8WKnCPpdG0b","level":0,"time":"2021-07-20T00:59:36+00:00","remoteAddr":"","user":"--","app":"encryption","method":"","url":"--","message":"/appinfo/app.php is deprecated, use \\OCP\\AppFramework\\Bootstrap\\IBootstrap on the application class instead.","userAgent":"--","version":"21.0.3.1"}
{"reqId":"MrLW4frKP8WKnCPpdG0b","level":0,"time":"2021-07-20T00:59:36+00:00","remoteAddr":"","user":"--","app":"extract","method":"","url":"--","message":"/appinfo/app.php is deprecated, use \\OCP\\AppFramework\\Bootstrap\\IBootstrap on the application class instead.","userAgent":"--","version":"21.0.3.1"}
{"reqId":"MrLW4frKP8WKnCPpdG0b","level":0,"time":"2021-07-20T00:59:36+00:00","remoteAddr":"","user":"--","app":"files_sharing","method":"","url":"--","message":"/appinfo/app.php is deprecated, use \\OCP\\AppFramework\\Bootstrap\\IBootstrap on the application class instead.","userAgent":"--","version":"21.0.3.1"}
{"reqId":"MrLW4frKP8WKnCPpdG0b","level":0,"time":"2021-07-20T00:59:36+00:00","remoteAddr":"","user":"--","app":"keeweb","method":"","url":"--","message":"/appinfo/app.php is deprecated, use \\OCP\\AppFramework\\Bootstrap\\IBootstrap on the application class instead.","userAgent":"--","version":"21.0.3.1"}
{"reqId":"MrLW4frKP8WKnCPpdG0b","level":0,"time":"2021-07-20T00:59:36+00:00","remoteAddr":"","user":"--","app":"maps","method":"","url":"--","message":"/appinfo/app.php is deprecated, use \\OCP\\AppFramework\\Bootstrap\\IBootstrap on the application class instead.","userAgent":"--","version":"21.0.3.1"}
{"reqId":"MrLW4frKP8WKnCPpdG0b","level":2,"time":"2021-07-20T00:59:36+00:00","remoteAddr":"","user":"--","app":"filesystem","method":"","url":"--","message":"Storage wrapper 'sharepermissions' was not registered via the 'OC_Filesystem - preSetup' hook which could cause potential problems.","userAgent":"--","version":"21.0.3.1"}
{"reqId":"MrLW4frKP8WKnCPpdG0b","level":0,"time":"2021-07-20T00:59:36+00:00","remoteAddr":"","user":"--","app":"user_usage_report","method":"","url":"--","message":"/appinfo/app.php is deprecated, use \\OCP\\AppFramework\\Bootstrap\\IBootstrap on the application class instead.","userAgent":"--","version":"21.0.3.1"}
{"reqId":"MrLW4frKP8WKnCPpdG0b","level":0,"time":"2021-07-20T00:59:36+00:00","remoteAddr":"","user":"--","app":"metadata","method":"","url":"--","message":"/appinfo/app.php is deprecated, use \\OCP\\AppFramework\\Bootstrap\\IBootstrap on the application class instead.","userAgent":"--","version":"21.0.3.1"}
{"reqId":"MrLW4frKP8WKnCPpdG0b","level":0,"time":"2021-07-20T00:59:36+00:00","remoteAddr":"","user":"--","app":"ocdownloader","method":"","url":"--","message":"/appinfo/app.php is deprecated, use \\OCP\\AppFramework\\Bootstrap\\IBootstrap on the application class instead.","userAgent":"--","version":"21.0.3.1"}
{"reqId":"MrLW4frKP8WKnCPpdG0b","level":0,"time":"2021-07-20T00:59:36+00:00","remoteAddr":"","user":"--","app":"scanner","method":"","url":"--","message":"/appinfo/app.php is deprecated, use \\OCP\\AppFramework\\Bootstrap\\IBootstrap on the application class instead.","userAgent":"--","version":"21.0.3.1"}
{"reqId":"MrLW4frKP8WKnCPpdG0b","level":0,"time":"2021-07-20T00:59:36+00:00","remoteAddr":"","user":"--","app":"suspicious_login","method":"","url":"--","message":"/appinfo/app.php is deprecated, use \\OCP\\AppFramework\\Bootstrap\\IBootstrap on the application class instead.","userAgent":"--","version":"21.0.3.1"}
{"reqId":"MrLW4frKP8WKnCPpdG0b","level":0,"time":"2021-07-20T00:59:36+00:00","remoteAddr":"","user":"--","app":"transmission","method":"","url":"--","message":"/appinfo/app.php is deprecated, use \\OCP\\AppFramework\\Bootstrap\\IBootstrap on the application class instead.","userAgent":"--","version":"21.0.3.1"}
{"reqId":"MrLW4frKP8WKnCPpdG0b","level":0,"time":"2021-07-20T00:59:36+00:00","remoteAddr":"","user":"--","app":"video_converter","method":"","url":"--","message":"/appinfo/app.php is deprecated, use \\OCP\\AppFramework\\Bootstrap\\IBootstrap on the application class instead.","userAgent":"--","version":"21.0.3.1"}
{"reqId":"MrLW4frKP8WKnCPpdG0b","level":0,"time":"2021-07-20T00:59:36+00:00","remoteAddr":"","user":"--","app":"news","method":"","url":"--","message":"new parser added : FeedIo\\Standard\\Json","userAgent":"--","version":"21.0.3.1"}
{"reqId":"MrLW4frKP8WKnCPpdG0b","level":0,"time":"2021-07-20T00:59:36+00:00","remoteAddr":"","user":"--","app":"news","method":"","url":"--","message":"new parser added : FeedIo\\Standard\\Atom","userAgent":"--","version":"21.0.3.1"}
{"reqId":"MrLW4frKP8WKnCPpdG0b","level":0,"time":"2021-07-20T00:59:36+00:00","remoteAddr":"","user":"--","app":"news","method":"","url":"--","message":"new parser added : FeedIo\\Standard\\Rss","userAgent":"--","version":"21.0.3.1"}
{"reqId":"MrLW4frKP8WKnCPpdG0b","level":0,"time":"2021-07-20T00:59:36+00:00","remoteAddr":"","user":"--","app":"news","method":"","url":"--","message":"new parser added : FeedIo\\Standard\\Rdf","userAgent":"--","version":"21.0.3.1"}
Your data directory is invalid
Ensure there is a file called ".ocdata" in the root of the data directory.

Cannot create "data" directory
This can usually be fixed by giving the webserver write access to the root directory. See https://docs.nextcloud.com/server/21/go.php?to=admin-dir_permissions

Setting locale to en_US.UTF-8/fr_FR.UTF-8/es_ES.UTF-8/de_DE.UTF-8/ru_RU.UTF-8/pt_BR.UTF-8/it_IT.UTF-8/ja_JP.UTF-8/zh_CN.UTF-8 failed
Please install one of these locales on your system and restart your webserver.

An unhandled exception has been thrown:
Exception: Environment not properly prepared. in /web/lib/private/Console/Application.php:168
Stack trace:
#0 /web/console.php(99): OC\Console\Application->loadCommands(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#1 /web/occ(11): require_once('/web/console.ph...')

My .ocdata file -DOES- exist and it is located at:

/var/www/clients/clientX/webX/private/data/.ocdata

And if I add:

/var/www/clients/clientX/webX/private/data/

to my open_basedir via ISPConfig, it destroys my NC install leaving me with this error message:

Your data directory is invalid Ensure there is a file called ".ocdata" in the root of the data directory.

on a blank white page… and even after removing directory from open_basedir, I have the same error. I am literally forced to roll back my entire server to regain NC access.

I am sorry, if these are two separate, but they both seem to invlove open_basedir.

Can you tell me the specific directories that I need to add to my open_basedir in order to get rid of the errors?

Thanks

1 Like

Same here (same logs etc.) tested with 21.0.3 and 22.0.0

Yes same here with 21.0.3

I think in the first quote the path is missing.
Can you configure the nextcloud path
/var/www/clients/clientXX/webXX/web
e.g. in config/config.php ?