nextcloud / server

☁️ Nextcloud server, a safe home for all your data
https://nextcloud.com
GNU Affero General Public License v3.0
27.24k stars 4.05k forks source link

Lots of Error: file_exists(): open_basedir restriction in effect. in Log #27759

Closed TheColin21 closed 3 years ago

TheColin21 commented 3 years ago

How to use GitHub

Steps to reproduce

  1. Login to Nextcloud
  2. Go to Settings -> Logs
  3. Be annoyed by the messages

Expected behaviour

No open_basedir restriction messages.

Actual behaviour

Error: file_exists(): open_basedir restriction in effect messages for the following paths: /appinfo/routes.php /l10n/en.js /templates/ /img/app.svg (and lots of other SVGs)

Server configuration

Operating system: Ubuntu 20.04

Web server: Apache2 behind Nginx reverse proxy

Database: MariaDB 10.5.11

PHP version: 8.0.7

Nextcloud version: 21.0.3

Updated from an older Nextcloud/ownCloud or fresh install: Updated

Where did you install Nextcloud from: nextcloud.com

Signing status:

Signing status No errors have been found.

List of activated apps:

App list Enabled: - accessibility: 1.7.0 - activity: 2.14.3 - admin_audit: 1.11.0 - apporder: 0.13.0 - breezedark: 21.0.8 - camerarawpreviews: 0.7.11 - checksum: 1.1.2 - cloud_federation_api: 1.4.0 - comments: 1.11.0 - contactsinteraction: 1.2.0 - dashboard: 7.1.0 - dav: 1.17.1 - documentserver_community: 0.1.9 - extract: 1.3.1 - federatedfilesharing: 1.11.0 - federation: 1.11.0 - files: 1.16.0 - files_antivirus: 3.2.1 - files_downloadactivity: 1.10.0 - files_external: 1.12.0 - files_fulltextsearch: 21.0.2 - files_mindmap: 0.0.24 - files_pdfviewer: 2.1.0 - files_rightclick: 1.0.0 - files_sharing: 1.13.1 - files_texteditor: 2.14.0 - files_trackdownloads: 1.10.0 - files_trashbin: 1.11.0 - files_versions: 1.14.0 - files_videoplayer: 1.10.0 - firstrunwizard: 2.10.0 - fulltextsearch: 21.0.1 - fulltextsearch_elasticsearch: 21.0.1 - imageconverter: 1.3.1 - impersonate: 1.8.0 - logreader: 2.6.0 - lookup_server_connector: 1.9.0 - mail: 1.9.5 - maps: 0.1.8 - metadata: 0.13.0 - notifications: 2.9.0 - notify_push: 0.2.1 - oauth2: 1.9.0 - onlyoffice: 7.0.2 - password_policy: 1.11.0 - passwords: 2021.6.20 - photos: 1.3.0 - previewgenerator: 3.1.1 - privacy: 1.5.0 - provisioning_api: 1.11.0 - ransomware_protection: 1.10.1 - recommendations: 1.0.0 - serverinfo: 1.11.0 - settings: 1.3.0 - sharebymail: 1.11.0 - spreed: 11.2.2 - support: 1.4.0 - survey_client: 1.9.0 - systemtags: 1.11.0 - text: 3.2.0 - theming: 1.12.0 - twofactor_backupcodes: 1.10.0 - updatenotification: 1.11.0 - user_ldap: 1.11.0 - user_status: 1.1.1 - viewer: 1.5.0 - weather_status: 1.1.0 - workflowengine: 2.3.0 Disabled: - encryption - nextcloud_announcements

Nextcloud configuration:

Config report { "system": { "instanceid": "***REMOVED SENSITIVE VALUE***", "passwordsalt": "***REMOVED SENSITIVE VALUE***", "secret": "***REMOVED SENSITIVE VALUE***", "trusted_domains": [ "cloud.clnp.eu", "cloud.saef-zf.de" ], "datadirectory": "***REMOVED SENSITIVE VALUE***", "dbtype": "mysql", "version": "21.0.3.1", "overwrite.cli.url": "https:\/\/cloud.clnp.eu", "dbname": "***REMOVED SENSITIVE VALUE***", "dbhost": "***REMOVED SENSITIVE VALUE***", "dbport": "", "dbtableprefix": "oc_", "mysql.utf8mb4": true, "dbuser": "***REMOVED SENSITIVE VALUE***", "dbpassword": "***REMOVED SENSITIVE VALUE***", "installed": true, "mail_smtpmode": "sendmail", "mail_from_address": "***REMOVED SENSITIVE VALUE***", "mail_domain": "***REMOVED SENSITIVE VALUE***", "memcache.local": "\\OC\\Memcache\\APCu", "memcache.distributed": "\\OC\\Memcache\\Redis", "redis": { "host": "***REMOVED SENSITIVE VALUE***", "port": 0 }, "memcache.locking": "\\OC\\Memcache\\Redis", "updater.release.channel": "stable", "loglevel": 0, "maintenance": false, "theme": "", "app_install_overwrite": [ "camerarawpreviews", "files_texteditor", "extract", "documentserver_community" ], "ldapIgnoreNamingRules": false, "ldapProviderFactory": "OCA\\User_LDAP\\LDAPProviderFactory", "default_language": "de", "default_locale": "de", "default_phone_region": "DE", "defaultapp": "files", "trusted_proxies": "***REMOVED SENSITIVE VALUE***" } }

Are you using external storage, if yes which one: Local, Nextcloud

Are you using encryption: no

Are you using an external user-backend, if yes which one: no

Client configuration

Browser: Firefox/Chrome/Edge, does not matter

Operating system: Windows 10, still does not matter

Logs

Web server error log

Web server error log nothing relevant there. Just 200s from log polling

Nextcloud log (data/nextcloud.log)

Nextcloud log Error PHP Error: file_exists(): open_basedir restriction in effect. File(/templates/) is not within the allowed path(s): (/var/www/vhosts/domain.tld/:/tmp/:/proc/meminfo:/proc/cpuinfo:/proc/uptime:/usr/share/dict/words) at /var/www/vhosts/domain.tld/cloud.domain.tld/lib/private/Template/Base.php#68 Gerade eben Error PHP Error: file_exists(): open_basedir restriction in effect. File(/appinfo/routes.php) is not within the allowed path(s): (/var/www/vhosts/domain.tld/:/tmp/:/proc/meminfo:/proc/cpuinfo:/proc/uptime:/usr/share/dict/words) at /var/www/vhosts/domain.tld/cloud.domain.tld/lib/private/Route/Router.php#135 Gerade eben Error PHP Error: file_exists(): open_basedir restriction in effect. File(/appinfo/routes.php) is not within the allowed path(s): (/var/www/vhosts/domain.tld/:/tmp/:/proc/meminfo:/proc/cpuinfo:/proc/uptime:/usr/share/dict/words) at /var/www/vhosts/domain.tld/cloud.domain.tld/lib/private/Route/Router.php#135 Gerade eben Error PHP Error: file_exists(): open_basedir restriction in effect. File(/appinfo/routes.php) is not within the allowed path(s): (/var/www/vhosts/domain.tld/:/tmp/:/proc/meminfo:/proc/cpuinfo:/proc/uptime:/usr/share/dict/words) at /var/www/vhosts/domain.tld/cloud.domain.tld/lib/private/Route/Router.php#135 Gerade eben Error PHP Error: file_exists(): open_basedir restriction in effect. File(/appinfo/routes.php) is not within the allowed path(s): (/var/www/vhosts/domain.tld/:/tmp/:/proc/meminfo:/proc/cpuinfo:/proc/uptime:/usr/share/dict/words) at /var/www/vhosts/domain.tld/cloud.domain.tld/lib/private/Route/Router.php#135 Gerade eben Error PHP Error: file_exists(): open_basedir restriction in effect. File(/templates/) is not within the allowed path(s): (/var/www/vhosts/domain.tld/:/tmp/:/proc/meminfo:/proc/cpuinfo:/proc/uptime:/usr/share/dict/words) at /var/www/vhosts/domain.tld/cloud.domain.tld/lib/private/Template/Base.php#68 Gerade eben Error PHP Error: file_exists(): open_basedir restriction in effect. File(/appinfo/routes.php) is not within the allowed path(s): (/var/www/vhosts/domain.tld/:/tmp/:/proc/meminfo:/proc/cpuinfo:/proc/uptime:/usr/share/dict/words) at /var/www/vhosts/domain.tld/cloud.domain.tld/lib/private/Route/Router.php#135 Gerade eben Error PHP Error: is_file(): open_basedir restriction in effect. File(/l10n/en.js) is not within the allowed path(s): (/var/www/vhosts/domain.tld/:/tmp/:/proc/meminfo:/proc/cpuinfo:/proc/uptime:/usr/share/dict/words) at /var/www/vhosts/domain.tld/cloud.domain.tld/lib/private/Template/ResourceLocator.php#106 Gerade eben Error PHP Error: file_exists(): open_basedir restriction in effect. File(/templates/) is not within the allowed path(s): (/var/www/vhosts/domain.tld/:/tmp/:/proc/meminfo:/proc/cpuinfo:/proc/uptime:/usr/share/dict/words) at /var/www/vhosts/domain.tld/cloud.domain.tld/lib/private/Template/Base.php#68 Gerade eben Error PHP Error: file_exists(): open_basedir restriction in effect. File(/templates/) is not within the allowed path(s): (/var/www/vhosts/domain.tld/:/tmp/:/proc/meminfo:/proc/cpuinfo:/proc/uptime:/usr/share/dict/words) at /var/www/vhosts/domain.tld/cloud.domain.tld/lib/private/Template/Base.php#68 Gerade eben Error PHP Error: file_exists(): open_basedir restriction in effect. File(/img/app.svg) is not within the allowed path(s): (/var/www/vhosts/domain.tld/:/tmp/:/proc/meminfo:/proc/cpuinfo:/proc/uptime:/usr/share/dict/words) at /var/www/vhosts/domain.tld/cloud.domain.tld/lib/private/Template/IconsCacher.php#132 vor 2 Minuten Error PHP Error: file_exists(): open_basedir restriction in effect. File(/img/circles.svg) is not within the allowed path(s): (/var/www/vhosts/domain.tld/:/tmp/:/proc/meminfo:/proc/cpuinfo:/proc/uptime:/usr/share/dict/words) at /var/www/vhosts/domain.tld/cloud.domain.tld/lib/private/Template/IconsCacher.php#132 vor 2 Minuten Error PHP Error: file_exists(): open_basedir restriction in effect. File(/img/column.svg) is not within the allowed path(s): (/var/www/vhosts/domain.tld/:/tmp/:/proc/meminfo:/proc/cpuinfo:/proc/uptime:/usr/share/dict/words) at /var/www/vhosts/domain.tld/cloud.domain.tld/lib/private/Template/IconsCacher.php#132 vor 2 Minuten Error PHP Error: file_exists(): open_basedir restriction in effect. File(/img/options.svg) is not within the allowed path(s): (/var/www/vhosts/domain.tld/:/tmp/:/proc/meminfo:/proc/cpuinfo:/proc/uptime:/usr/share/dict/words) at /var/www/vhosts/domain.tld/cloud.domain.tld/lib/private/Template/IconsCacher.php#132 vor 2 Minuten Error PHP Error: file_exists(): open_basedir restriction in effect. File(/img/filteradd.svg) is not within the allowed path(s): (/var/www/vhosts/domain.tld/:/tmp/:/proc/meminfo:/proc/cpuinfo:/proc/uptime:/usr/share/dict/words) at /var/www/vhosts/domain.tld/cloud.domain.tld/lib/private/Template/IconsCacher.php#132 vor 2 Minuten Error PHP Error: file_exists(): open_basedir restriction in effect. File(/img/emoji.svg) is not within the allowed path(s): (/var/www/vhosts/domain.tld/:/tmp/:/proc/meminfo:/proc/cpuinfo:/proc/uptime:/usr/share/dict/words) at /var/www/vhosts/domain.tld/cloud.domain.tld/lib/private/Template/IconsCacher.php#132 vor 2 Minuten Error PHP Error: file_exists(): open_basedir restriction in effect. File(/img/reply.svg) is not within the allowed path(s): (/var/www/vhosts/domain.tld/:/tmp/:/proc/meminfo:/proc/cpuinfo:/proc/uptime:/usr/share/dict/words) at /var/www/vhosts/domain.tld/cloud.domain.tld/lib/private/Template/IconsCacher.php#132 vor 2 Minuten Error PHP Error: file_exists(): open_basedir restriction in effect. File(/img/drag-handle.svg) is not within the allowed path(s): (/var/www/vhosts/domain.tld/:/tmp/:/proc/meminfo:/proc/cpuinfo:/proc/uptime:/usr/share/dict/words) at /var/www/vhosts/domain.tld/cloud.domain.tld/lib/private/Template/IconsCacher.php#132 vor 2 Minuten Error PHP Error: file_exists(): open_basedir restriction in effect. File(/img/answer-long.svg) is not within the allowed path(s): (/var/www/vhosts/domain.tld/:/tmp/:/proc/meminfo:/proc/cpuinfo:/proc/uptime:/usr/share/dict/words) at /var/www/vhosts/domain.tld/cloud.domain.tld/lib/private/Template/IconsCacher.php#132 vor 2 Minuten Error PHP Error: file_exists(): open_basedir restriction in effect. File(/img/answer-short.svg) is not within the allowed path(s): (/var/www/vhosts/domain.tld/:/tmp/:/proc/meminfo:/proc/cpuinfo:/proc/uptime:/usr/share/dict/words) at /var/www/vhosts/domain.tld/cloud.domain.tld/lib/private/Template/IconsCacher.php#132 vor 2 Minuten Error PHP Error: file_exists(): open_basedir restriction in effect. File(/img/answer-dropdown.svg) is not within the allowed path(s): (/var/www/vhosts/domain.tld/:/tmp/:/proc/meminfo:/proc/cpuinfo:/proc/uptime:/usr/share/dict/words) at /var/www/vhosts/domain.tld/cloud.domain.tld/lib/private/Template/IconsCacher.php#132 vor 2 Minuten Error PHP Error: file_exists(): open_basedir restriction in effect. File(/img/answer-multiple.svg) is not within the allowed path(s): (/var/www/vhosts/domain.tld/:/tmp/:/proc/meminfo:/proc/cpuinfo:/proc/uptime:/usr/share/dict/words) at /var/www/vhosts/domain.tld/cloud.domain.tld/lib/private/Template/IconsCacher.php#132 vor 2 Minuten Error PHP Error: file_exists(): open_basedir restriction in effect. File(/img/answer-checkbox.svg) is not within the allowed path(s): (/var/www/vhosts/domain.tld/:/tmp/:/proc/meminfo:/proc/cpuinfo:/proc/uptime:/usr/share/dict/words) at /var/www/vhosts/domain.tld/cloud.domain.tld/lib/private/Template/IconsCacher.php#132 vor 2 Minuten Error PHP Error: file_exists(): open_basedir restriction in effect. File(/img/forms.svg) is not within the allowed path(s): (/var/www/vhosts/domain.tld/:/tmp/:/proc/meminfo:/proc/cpuinfo:/proc/uptime:/usr/share/dict/words) at /var/www/vhosts/domain.tld/cloud.domain.tld/lib/private/Template/IconsCacher.php#132 vor 2 Minuten Error PHP Error: file_exists(): open_basedir restriction in effect. File(/img/rename.svg) is not within the allowed path(s): (/var/www/vhosts/domain.tld/:/tmp/:/proc/meminfo:/proc/cpuinfo:/proc/uptime:/usr/share/dict/words) at /var/www/vhosts/domain.tld/cloud.domain.tld/lib/private/Template/IconsCacher.php#132 vor 2 Minuten Error PHP Error: file_exists(): open_basedir restriction in effect. File(/img/icon-manual.svg) is not within the allowed path(s): (/var/www/vhosts/domain.tld/:/tmp/:/proc/meminfo:/proc/cpuinfo:/proc/uptime:/usr/share/dict/words) at /var/www/vhosts/domain.tld/cloud.domain.tld/lib/private/Template/IconsCacher.php#132 vor 2 Minuten Error PHP Error: file_exists(): open_basedir restriction in effect. File(/img/icon-list-up.svg) is not within the allowed path(s): (/var/www/vhosts/domain.tld/:/tmp/:/proc/meminfo:/proc/cpuinfo:/proc/uptime:/usr/share/dict/words) at /var/www/vhosts/domain.tld/cloud.domain.tld/lib/private/Template/IconsCacher.php#132 vor 2 Minuten Error PHP Error: file_exists(): open_basedir restriction in effect. File(/img/icon-list-down.svg) is not within the allowed path(s): (/var/www/vhosts/domain.tld/:/tmp/:/proc/meminfo:/proc/cpuinfo:/proc/uptime:/usr/share/dict/words) at /var/www/vhosts/domain.tld/cloud.domain.tld/lib/private/Template/IconsCacher.php#132 vor 2 Minuten Error PHP Error: file_exists(): open_basedir restriction in effect. File(/img/icon-subtasks-hidden.svg) is not within the allowed path(s): (/var/www/vhosts/domain.tld/:/tmp/:/proc/meminfo:/proc/cpuinfo:/proc/uptime:/usr/share/dict/words) at /var/www/vhosts/domain.tld/cloud.domain.tld/lib/private/Template/IconsCacher.php#132 vor 2 Minuten Error PHP Error: file_exists(): open_basedir restriction in effect. File(/img/icon-subtasks-visible.svg) is not within the allowed path(s): (/var/www/vhosts/domain.tld/:/tmp/:/proc/meminfo:/proc/cpuinfo:/proc/uptime:/usr/share/dict/words) at /var/www/vhosts/domain.tld/cloud.domain.tld/lib/private/Template/IconsCacher.php#132 vor 2 Minuten Error PHP Error: file_exists(): open_basedir restriction in effect. File(/img/icon-alphabetically.svg) is not within the allowed path(s): (/var/www/vhosts/domain.tld/:/tmp/:/proc/meminfo:/proc/cpuinfo:/proc/uptime:/usr/share/dict/words) at /var/www/vhosts/domain.tld/cloud.domain.tld/lib/private/Template/IconsCacher.php#132 vor 2 Minuten Error PHP Error: file_exists(): open_basedir restriction in effect. File(/img/icon-task-star.svg) is not within the allowed path(s): (/var/www/vhosts/domain.tld/:/tmp/:/proc/meminfo:/proc/cpuinfo:/proc/uptime:/usr/share/dict/words) at /var/www/vhosts/domain.tld/cloud.domain.tld/lib/private/Template/IconsCacher.php#132 vor 2 Minuten Error PHP Error: file_exists(): open_basedir restriction in effect. File(/img/icon-list.svg) is not within the allowed path(s): (/var/www/vhosts/domain.tld/:/tmp/:/proc/meminfo:/proc/cpuinfo:/proc/uptime:/usr/share/dict/words) at /var/www/vhosts/domain.tld/cloud.domain.tld/lib/private/Template/IconsCacher.php#132 vor 2 Minuten Error PHP Error: file_exists(): open_basedir restriction in effect. File(/img/icon-due.svg) is not within the allowed path(s): (/var/www/vhosts/domain.tld/:/tmp/:/proc/meminfo:/proc/cpuinfo:/proc/uptime:/usr/share/dict/words) at /var/www/vhosts/domain.tld/cloud.domain.tld/lib/private/Template/IconsCacher.php#132 vor 2 Minuten Error PHP Error: file_exists(): open_basedir restriction in effect. File(/img/icon-start.svg) is not within the allowed path(s): (/var/www/vhosts/domain.tld/:/tmp/:/proc/meminfo:/proc/cpuinfo:/proc/uptime:/usr/share/dict/words) at /var/www/vhosts/domain.tld/cloud.domain.tld/lib/private/Template/IconsCacher.php#132 vor 2 Minuten Error PHP Error: file_exists(): open_basedir restriction in effect. File(/img/color-picker.svg) is not within the allowed path(s): (/var/www/vhosts/domain.tld/:/tmp/:/proc/meminfo:/proc/cpuinfo:/proc/uptime:/usr/share/dict/words) at /var/www/vhosts/domain.tld/cloud.domain.tld/lib/private/Template/IconsCacher.php#132 vor 2 Minuten Error PHP Error: file_exists(): open_basedir restriction in effect. File(/img/timezone.svg) is not within the allowed path(s): (/var/www/vhosts/domain.tld/:/tmp/:/proc/meminfo:/proc/cpuinfo:/proc/uptime:/usr/share/dict/words) at /var/www/vhosts/domain.tld/cloud.domain.tld/lib/private/Template/IconsCacher.php#132 vor 2 Minuten Error PHP Error: file_exists(): open_basedir restriction in effect. File(/img/repeat.svg) is not within the allowed path(s): (/var/www/vhosts/domain.tld/:/tmp/:/proc/meminfo:/proc/cpuinfo:/proc/uptime:/usr/share/dict/words) at /var/www/vhosts/domain.tld/cloud.domain.tld/lib/private/Template/IconsCacher.php#132 vor 2 Minuten Error PHP Error: file_exists(): open_basedir restriction in effect. File(/img/reminder.svg) is not within the allowed path(s): (/var/www/vhosts/domain.tld/:/tmp/:/proc/meminfo:/proc/cpuinfo:/proc/uptime:/usr/share/dict/words) at /var/www/vhosts/domain.tld/cloud.domain.tld/lib/private/Template/IconsCacher.php#132 vor 2 Minuten Error PHP Error: file_exists(): open_basedir restriction in effect. File(/img/briefcase.svg) is not within the allowed path(s): (/var/www/vhosts/domain.tld/:/tmp/:/proc/meminfo:/proc/cpuinfo:/proc/uptime:/usr/share/dict/words) at /var/www/vhosts/domain.tld/cloud.domain.tld/lib/private/Template/IconsCacher.php#132 vor 2 Minuten Error PHP Error: file_exists(): open_basedir restriction in effect. File(/img/eye.svg) is not within the allowed path(s): (/var/www/vhosts/domain.tld/:/tmp/:/proc/meminfo:/proc/cpuinfo:/proc/uptime:/usr/share/dict/words) at /var/www/vhosts/domain.tld/cloud.domain.tld/lib/private/Template/IconsCacher.php#132 vor 2 Minuten Error PHP Error: file_exists(): open_basedir restriction in effect. File(/img/new-calendar-with-task-list.svg) is not within the allowed path(s): (/var/www/vhosts/domain.tld/:/tmp/:/proc/meminfo:/proc/cpuinfo:/proc/uptime:/usr/share/dict/words) at /var/www/vhosts/domain.tld/cloud.domain.tld/lib/private/Template/IconsCacher.php#132 vor 2 Minuten Error PHP Error: file_exists(): open_basedir restriction in effect. File(/img/new-calendar.svg) is not within the allowed path(s): (/var/www/vhosts/domain.tld/:/tmp/:/proc/meminfo:/proc/cpuinfo:/proc/uptime:/usr/share/dict/words) at /var/www/vhosts/domain.tld/cloud.domain.tld/lib/private/Template/IconsCacher.php#132 vor 2 Minuten Error PHP Error: file_exists(): open_basedir restriction in effect. File(/img/embed.svg) is not within the allowed path(s): (/var/www/vhosts/domain.tld/:/tmp/:/proc/meminfo:/proc/cpuinfo:/proc/uptime:/usr/share/dict/words) at /var/www/vhosts/domain.tld/cloud.domain.tld/lib/private/Template/IconsCacher.php#132 vor 2 Minuten Error PHP Error: file_exists(): open_basedir restriction in effect. File(/img/view-list.svg) is not within the allowed path(s): (/var/www/vhosts/domain.tld/:/tmp/:/proc/meminfo:/proc/cpuinfo:/proc/uptime:/usr/share/dict/words) at /var/www/vhosts/domain.tld/cloud.domain.tld/lib/private/Template/IconsCacher.php#132 vor 2 Minuten Error PHP Error: file_exists(): open_basedir restriction in effect. File(/img/view-week.svg) is not within the allowed path(s): (/var/www/vhosts/domain.tld/:/tmp/:/proc/meminfo:/proc/cpuinfo:/proc/uptime:/usr/share/dict/words) at /var/www/vhosts/domain.tld/cloud.domain.tld/lib/private/Template/IconsCacher.php#132 vor 2 Minuten Error PHP Error: file_exists(): open_basedir restriction in effect. File(/img/view-day.svg) is not within the allowed path(s): (/var/www/vhosts/domain.tld/:/tmp/:/proc/meminfo:/proc/cpuinfo:/proc/uptime:/usr/share/dict/words) at /var/www/vhosts/domain.tld/cloud.domain.tld/lib/private/Template/IconsCacher.php#132 vor 2 Minuten Error PHP Error: file_exists(): open_basedir restriction in effect. File(/img/view-module.svg) is not within the allowed path(s): (/var/www/vhosts/domain.tld/:/tmp/:/proc/meminfo:/proc/cpuinfo:/proc/uptime:/usr/share/dict/words) at /var/www/vhosts/domain.tld/cloud.domain.tld/lib/private/Template/IconsCacher.php#132 vor 2 Minuten Error PHP Error: file_exists(): open_basedir restriction in effect. File(/img/rightarrow.svg) is not within the allowed path(s): (/var/www/vhosts/domain.tld/:/tmp/:/proc/meminfo:/proc/cpuinfo:/proc/uptime:/usr/share/dict/words) at /var/www/vhosts/domain.tld/cloud.domain.tld/lib/private/Template/IconsCacher.php#132 vor 2 Minuten Error PHP Error: file_exists(): open_basedir restriction in effect. File(/img/leftarrow.svg) is not within the allowed path(s): (/var/www/vhosts/domain.tld/:/tmp/:/proc/meminfo:/proc/cpuinfo:/proc/uptime:/usr/share/dict/words) at /var/www/vhosts/domain.tld/cloud.domain.tld/lib/private/Template/IconsCacher.php#132

Pretty much all there paths are inside the nextcloud folder. As you can see, this folder is part of the allowed paths

cgzones commented 3 years ago

I think the common feature is the usage of OC_App::getAppPath, which seems to not return a correct prefix path.

Tealk commented 3 years ago

The problem also exists with Nextcloud version 22

marchellodev commented 3 years ago

Doing the chmod 775 and changing the folder owner to www fixed this problem for me

benurb commented 3 years ago

The problem seems to be related to the core being treated as an app. https://github.com/nextcloud/server/blob/master/lib/private/legacy/OC_App.php#L531 getAppPath is called with $appId core, which calls findAppInDirectories. This call returns false, because core is no app. It's located in the root folder, not in the apps folder. I don't know what's a correct fix. I symlinked core into apps, which removes a few of the mentioned error messages, but leaves:

Error | PHP | Error: file_exists(): open_basedir restriction in effect. File(/img/app.svg) is not within the allowed path(s): (/var/www/html:/dev/urandom:/proc/meminfo:/tmp:/external) at /var/www/html/lib/private/Template/IconsCacher.php#131
Error | PHP | Error: file_exists(): open_basedir restriction in effect. File(/img/app-dark.svg) is not within the allowed path(s): (/var/www/html:/dev/urandom:/proc/meminfo:/tmp:/external) at /var/www/html/lib/private/Template/IconsCacher.php#131

Probably it's not a good idea to link core into apps, but maybe the result is still of any use to the devs.

Hinyka commented 3 years ago

I solved it by modifying the getAppPath function. https://github.com/nextcloud/server/blob/master/lib/private/legacy/OC_App.php#L539

-return false; +return OC::$SERVERROOT;

No errors in the log now.

Tealk commented 3 years ago

Have tried the fix as well so the following is still in my log Error: is_readable(): open_basedir restriction in effect. File(/usr/share/dict/words) is not within the allowed path(s)

fragxz commented 3 years ago

I solved it by modifying the getAppPath function. https://github.com/nextcloud/server/blob/master/lib/private/legacy/OC_App.php#L539

-return false; +return OC::$SERVERROOT;

No errors in the log now.

I tried that and was happy first, but then I wanted to authenticate my desktop client and it didn't work anymore. Also I couldn't logout anymore. As I reverted this change, it all worked again. Just a heads up.

Hinyka commented 3 years ago

This is a more sensitive fix. You can test it. It works for me without any errors. https://github.com/owncloud/core/commit/976da3a8fd589b7fe0bafaf67c88ee7fdab6a7f8

Workaround /templates/ https://github.com/nextcloud/server/blob/74e7934f04d967b610f2abf51efe16bbbfcc7f3f/lib/private/Template/Base.php#L65-L71

-       if (file_exists($app_dir.'/templates/')) {
+       if ($app_dir !== false && file_exists($app_dir.'/templates/')) {

Workaround /appinfo/routes.php https://github.com/nextcloud/server/blob/74e7934f04d967b610f2abf51efe16bbbfcc7f3f/lib/private/Route/Router.php#L130-L137

-           $file = \OC_App::getAppPath($app) . '/appinfo/routes.php';
-           if ($file !== false && file_exists($file)) {
+           $appPath = \OC_App::getAppPath($app);
+           $file = $appPath . '/appinfo/routes.php';
+           if ($appPath !== false && file_exists($file)) {

Workaround /l10n/en.js @Tealk https://github.com/nextcloud/server/issues/27759#issuecomment-884751070, @schwabelbauch https://github.com/nextcloud/server/issues/27759#issuecomment-884756141 Error can be reproduced only on browser with en_US language (on login page). This workaround fixes this error. https://github.com/nextcloud/server/blob/0447b53bda9fe95ea0cbed765aa332584605d652/lib/private/Template/ResourceLocator.php#L102-L108

-       if (is_file($root.'/'.$file)) {
+       if ($root !== false && is_file($root.'/'.$file)) {

Workaround /img/app.svg (and lots of other SVGs) https://github.com/nextcloud/server/blob/0447b53bda9fe95ea0cbed765aa332584605d652/lib/private/Template/IconsCacher.php#L170-L176

-               $location = \OC_App::getAppPath($app) . '/img/' . $cleanUrl . '.svg';
+               $appPath = \OC_App::getAppPath($app);
+               if ($appPath !== false) {
+                   $location = $appPath . '/img/' . $cleanUrl . '.svg';
+               }
Tealk commented 3 years ago

with only these changes i still get the error: open_basedir restriction in effect. File(/l10n/en.js) is not within the allowed path(s)

or are the changes that were specified above also required @Hinyka ?

schwabelbauch commented 3 years ago

The changes from https://github.com/nextcloud/server/issues/27759#issuecomment-884633434 fixed the errors with file_exists(). The other errors are is_file() like\ is_file(): open_basedir restriction in effect. File(/l10n/en.js) is not within the allowed path(s)

patschi commented 3 years ago

@nextcloud/server Due to the amount of reports and upvotes, I think it would make sense getting more attention for this issue?

@Hinyka's workaround looks good. The function OC_App::getAppPath() seems to return false when it doesn't find a valid app path: https://github.com/nextcloud/server/blob/0447b53bda9fe95ea0cbed765aa332584605d652/lib/private/legacy/OC_App.php#L531-L540

Hence it won't travel down the code paths responsible for the large amount of errors users are experiencing.

To add: But not sure if it would make sense, from an architecture standpoint, to rather use getAppPath() from the AppManager instead? https://github.com/nextcloud/server/blob/0447b53bda9fe95ea0cbed765aa332584605d652/lib/private/App/AppManager.php#L412-L425

Hinyka commented 3 years ago

I have made another corrections. All errors described should now be covered.

timreeves commented 3 years ago

I'm seeing exactly all these log messages too.

I'm actually quite shocked, and irritated. The issue was reported 28 days ago, and the problem and the fix looks pretty clear. So how come it's not been fixed already in the latest production version?

I have cron run a script which monitors the size of log files every night, looking for runaway logs indicating software problems. So now I'm getting a notification email every morning, and the log is growing infinitely.

Until now my strategy was to make sure that the Nextcloud log is empty. Looks like now I'll have to add an own entry for it in logrotate.d, which I find a real drag. I do like NC, I really do, and I'm really thankful in general - and hope that this will soon be fixed! Otherwise, it feels like I'm being penalised for upgrading - not something we want...

versussoft commented 3 years ago

Same problem with Debian 9, PHP 7.4.22 , MariaDB 10.1.48, Nextcloud 19.0.13 The only thing I have updated in the last few days is PHP, why wasn't this error occurring before? Perhaps this bug fixed in 7.4.21? https://bugs.php.net/bug.php?id=76359

AirGOLDBERG commented 3 years ago

Same Problem: Error: file_exists(): open_basedir restriction in effect. File(/templates/) is not within the allowed path(s): Ubuntu 18.4 + Plesk Nextcloud 21.0.4 Maria DB 10.3 PHP 7.4.22 Also i cannot run the "System Page"

benjaminsabatini commented 3 years ago

Is the fix above going to be implemented, or should I go ahead and start editing php files on my own?

Or maybe there is a grand plan in the works that includes a fix?

szaimen commented 3 years ago

See https://github.com/nextcloud/server/pull/28263

timreeves commented 3 years ago

Yeah but that's talking about a milestone for NC 23 - I'm running NC 21. I have no confidence to upgrade until the version I have is running error-free. So what about NC 21 and 22 - will there be backports of the fix? I'm waiting until error-free to upgrade my clients, I always upgrade my own installation first.

benjaminsabatini commented 3 years ago

The drive to keep on a release schedule has overruled stability and usability. Seems like an extremely unsafe model to follow.

szaimen commented 3 years ago

The PR will be backported when it is merged

JB1985 commented 3 years ago

This workaround is not working with Nextcloud 21.

When can we expect the backports? I can't use my Nextcloud right now. I don't see my folders in the file app.

It is very urgent!

Hinyka commented 3 years ago

This workaround is not working with Nextcloud 21.

When can we expect the backports? I can't use my Nextcloud right now. I don't see my folders in the file app.

It is very urgent!

I tried this workaround on a fresh installation of nextcloud 21.0.4 with PHP 7.4.23(open_basedir enabled) and everything is fine and without errors.

What's in the nextcloud log?

tomasodehnal commented 3 years ago

@Hinyka Thanks for the fix. I have the same setup as you described and I can confirm that after applying all four changes from https://github.com/nextcloud/server/issues/27759#issuecomment-884633434 I no more see any is_file() and file_exists() errors.

niklasdahlheimer commented 3 years ago

The changes from https://github.com/nextcloud/server/issues/27759#issuecomment-884633434 fixed it for me too in NC 20.0.12. Thanks! Maybe this finds a way into an update release?

Bables55 commented 3 years ago

I've been getting the same problem since 22.0. Currently it is 22.1.1.

Error: file_exists(): open_basedir restriction in effect. File(/templates/) is not within the allowed path(s): (/MY-NEXTCLOUD-DIR:/tmp/:/dev/urandom:/proc/meminfo) at /MY-NEXTCLOUD-DIR/lib/private/Template/Base.php#68

I am getting a fairly large amount of the above error output every few seconds.

deajan commented 3 years ago

@Hinyka Can confirm that patch https://github.com/nextcloud/server/pull/28263 resolves the issue for me on 21.0.4

Bables55 commented 3 years ago

I'm on NC22.2.0 and nothing has changed or the momentum of the outbreak has slightly increased.

TheColin21 commented 3 years ago

I also hoped 22.2.0 would fix the issue but I can confirm it did not change anything about it....other than maybe(!) Making it worse

JB1985 commented 3 years ago

I just don't understand why bugs like this just haven't been fixed for months. Incredible ...

deajan commented 3 years ago

@JB1985 Don't forget we're beta testers for their enterprise product which I'm sure is patched. Over the years, I found shitloads of bugs of which some have been around for a year or more.

As far as I do understand the whole enterprise strategy pushing stable seekers into it, I disapprove the will fix maybe someday for the free thing. The public image of these bugs doesn't make me want to buy, but seek an alternative.

caos30 commented 3 years ago

I'm using NC 22.2 and this problem continue happening. I began to solve the first error message in log regarding file_exists() just like the solution proposed above (checking that $app_dir != ''), but then other new PHP errors arised on LOG... so... i decided to look for here in Github what about this. And i'm annoyed after read all these above comments... 4 major versions of NC with the same annoying simple error not being fixed yet :-(

The main problem is not to "avoid to get these file_exists() error messages on the LOG file". The problem probably is quite worst: those functions are not returning the correct paths to the apps who request it !!! so, i cannot imagine how many errors are happening on my Nextcloud instance !?

Sincerely, i cannot understand that an error like this exists since more than a year. I means... it sincerely give me not trust on this software. I was very happy with the version 17 (the first one i used) but with each upgrade i'm experiencing more bugs instead of less !? and it continue to be a headache to export/import content (tasks, notes, etc..) from one server to the next server. Sincerely, i think that i'm loosing the interest to continue using this software. I understand that it's opensource and so i can demand nothing, but guys... this at least fix errors on LOGS !

patschi commented 3 years ago

The issue was fixed in PR https://github.com/nextcloud/server/pull/28263, backported to NC21 and NC22. According to the roadmap they are supposed to be released on November 11, 2021.

If you don't want to wait until the release ships, you can manually patch the changes in your Nextcloud instance (file integrity checks might fail then due to manual changes):

cd /var/www/nextcloud/
wget https://github.com/nextcloud/server/pull/28263.patch
patch -p1 < 28263.patch
rm 28263.patch
caos30 commented 3 years ago

Thanks @patschi ... these are excellent news. I can wait for 15 days :-)

Bables55 commented 3 years ago

Thanks @patschi , However, in my case, the following is still being output continuously. Do you have a grasp of these?

file_exists(): open_basedir restriction in effect. File(/MY-NEXTCLOUD/data/USERNAME/files/USERNAME/FILENAME) is not within the allowed path(s): (/MY-NEXTCLOUD:/tmp/:/dev/urandom:/proc/meminfo) at /MY-NEXTCLOUD/lib/private/Files/Storage/Local.php#239
file_exists(): open_basedir restriction in effect. File(/FOLDERNAME) is not within the allowed path(s): (/MY-NEXTCLOUD:/tmp/:/dev/urandom:/proc/meminfo) at /MY-NEXTCLOUD/3rdparty/sabre/dav/lib/DAV/FS/Directory.php#78
csantv commented 3 years ago

Hello, after applying the changes other messages started to appear on the log (or maybe they were there all along but the other spam prevented me from noticing them):

[PHP] Error: is_readable(): open_basedir restriction in effect. File(//.aws/config) is not within the allowed path(s): at /usr/share/webapps/nextcloud/3rdparty/aws/aws-sdk-php/src/Retry/ConfigurationProvider.php#158

GET /index.php/apps/notes/api/v1/notes?pruneBefore=1635053840

Seems like this is coming from the notes application.

stefan123t commented 2 years ago

I did not want to wait until mid November for the backports to NC 22 / 21 to become available. @Hinyka thanks for your patch, I applied it manually on 22.1.1 and it made the errors go away for me too. I assume the automated patch instructions from @patschi would work as well, drawing in the code from the same source (i.e. your pull request).

Being able to filter out all errors coming from the PHP app in the Settings > Logging dialog would have been an equally valid workaround / feature to solve the problem of so many errors on the user side.

BTW: I sanitized and cleaned up my existing nextcloud logs using the following shell command to remove the superfluos loglines: sed -i '/is_file\|file_exists/d' /var/www/nextcloud-data/nextcloud.log*

Bables55 commented 2 years ago

I have updated to NC22.2.2, but still continue to get the following error output.

file_exists(): open_basedir restriction in effect. File(/MY-NEXTCLOUD/data/USERNAME/files/USERNAME/FILENAME) is not within the allowed path(s): (/MY-NEXTCLOUD:/tmp/:/dev/urandom:/proc/meminfo) at /MY-NEXTCLOUD/lib/private/Files/Storage/Local.php#239
file_exists(): open_basedir restriction in effect. File(/FOLDERNAME) is not within the allowed path(s): (/MY-NEXTCLOUD:/tmp/:/dev/urandom:/proc/meminfo) at /MY-NEXTCLOUD/3rdparty/sabre/dav/lib/DAV/FS/Directory.php#78
mklewitz commented 2 years ago

Still happens with 22.2.5 when the server is configured to restrict writes outside the data directory. After granting the webserver user write access to files in the web root, the errors are gone.

Bables55 commented 2 years ago

Error: file_exists(): open_basedir restriction in effect. File(/DIRECTORY_NAME) is not within the allowed path(s): (/var/www/NEXTCLOUD:/tmp/:/dev/urandom:/proc/meminfo) at /var/www/NEXTCLOUD/3rdparty/sabre/dav/lib/DAV/FS/Directory.php#78

It still continues to occur in NC 23.0.3. Large numbers are being generated. Is this problem a long way from being solved like the Sagrada Familia church?

mikaku commented 2 years ago

@Bables55

Is this problem a long way from being solved like the Sagrada Familia church?

Heh, yeah, I see the joke :smile:. But just to make it clear:

As state in the Wikipedia:

Construction on Sagrada FamĂ­lia is not supported by any government or official church sources. Private patrons funded the initial stages. Money from tickets purchased by tourists is now used to pay for the work, and private donations are accepted through the Friends of the Sagrada FamĂ­lia.

That's the main reason why this Temple is taking so long to finish.

Besides this, since the version 22 I no longer see those error messages.

Siggi0904 commented 1 year ago

Hi, these problem occurs in Nextcloud 26.0.x to.

Please change it.

camouflage81 commented 1 year ago

Hello to all, since I'm not sure if I have the same or a similar problem and I don't want to make an unnecessary topic, I'll just post it in this thread. The issue occurs after upgrading from 25.0.6 to 26.0.1 and results in log file overflow.

[PHP] Fehler: is_file(): open_basedir restriction in effect. File(/proc/cpuinfo) is not within the allowed path(s): (/var/www/vhosts/xxx.xx.net/xxx.de/:/tmp/:/var/lib/php/sessions:/var/www/vhosts/xxx.xxx.xxx.net/tmp) at /var/www/vhosts/xxx.xxx.xxx.net/xxx.de/nextcloud/lib/private/Preview/Generator.php#351

GET /nextcloud/index.php/core/preview?fileId=148541&x=250&y=250 from xxx.xxx.xxx.xxx by Thomas at 2023-04-24T17:56:42+00:00

Should I open a new issue for this with all the info needed?

Thanks Thomas

timreeves commented 1 year ago

@camouflage81 You need to add /proc/cpuinfo to open_basedir values for NC 26, see here: https://help.nextcloud.com/t/open-basedir-restriction-after-update-to-26/158850/6

Or just comment out open_basedir. See here: https://www.php.net/manual/en/ini.core.php#ini.open-basedir

Your question has helped me as I did not know this myself - thanks!

willemb2 commented 1 year ago

(...) Should I open a new issue for this with all the info needed?

Thanks Thomas

This one is marked as Closed, is about about different .php and directories, so I created a new one: https://github.com/nextcloud/server/issues/37921