File_exists(): open_basedir restriction in effect. after update NC29

Nextcloud version (eg, 20.0.5): Nextcloud Hub 8 (29.0.0)
Operating system and version (eg, Ubuntu 20.04): Linux 5.15.0-89-generic x86_64
Apache or nginx version (eg, Apache 2.4.25): replace me
PHP version (eg, 7.4): Version: 8.2.10

The issue you are facing:

file_exists(): open_basedir restriction in effect. File(/lib/Controller) is not within the allowed path(s): (/home/nayef/.composer:/home/nayef/web/sys.advo-ak.ae/public_html:/home/nayef/web/sys.advo-ak.ae/private:/home/nayef/web/sys.advo-ak.ae/public_shtml:/home/nayef/tmp:/tmp:/var/www/html:/bin:/usr/bin:/usr/local/bin:/usr/share:/opt) at /home/nayef/web/sys.advo-ak.ae/public_html/lib/private/Route/Router.php#459

Is this the first time you’ve seen this error? yes

The output of your Nextcloud log in Admin > Logging:

	
file_exists(): open_basedir restriction in effect. File(/lib/Controller) is not within the allowed path(s): (/home/nayef/.composer:/home/nayef/web/sys.advo-ak.ae/public_html:/home/nayef/web/sys.advo-ak.ae/private:/home/nayef/web/sys.advo-ak.ae/public_shtml:/home/nayef/tmp:/tmp:/var/www/html:/bin:/usr/bin:/usr/local/bin:/usr/share:/opt) at /home/nayef/web/sys.advo-ak.ae/public_html/lib/private/Route/Router.php#459 

what should I do please ?

1 Like

I found it too on my fresh installed NC29 on Debian 12 with PHP 8.3

1 Like

any help ?

you hit the issue in the past already, did the mentioned fix help?

1 Like

yes I tried the past fix help but it didn’t work :frowning:

To be honest, I can’t figure out how to correct the error from the link.

It is about this error message:

file_exists(): open_basedir restriction in effect. File(/lib/Controller) is not within the allowed path(s):

But /lib/Controller is not installed on the machine?

the fix is in lib/private/Template/JSResourcelocator.php

my two Docker instances with NC28 and NC29 already have the fix included :muscle:

1 Like

still I have same error
but it diff from the past one

I have it already:

 
The error still persits:

Optional parameter $knownIds declared before required parameter $partialOnly is implicitly treated as a required parameter at /var/www/clients/client1/web4/web/apps/mail/lib/Service/Sync/SyncService.php#111 

This is completely different error! but I see you commented already on Github… would be great you reference it here as well.

credits: Error in "Mail App " Nextcloud 28.0.5

what about me ?

Hello,
I’m just wondering to locate /lib/Controller , I searched in my server but not found.
to try to solve this error php.

file_exists(): open_basedir restriction in effect. File(/lib/Controller) is not within the allowed path(s): (/home/nayef/.composer:/home/nayef/web/sys.advo-ak.ae/public_html:/home/nayef/web/sys.advo-ak.ae/private:/home/nayef/web/sys.advo-ak.ae/public_shtml:/home/nayef/tmp:/tmp:/var/www/html:/bin:/usr/bin:/usr/local/bin:/usr/share:/opt) at /home/nayef/web/sys.advo-ak.ae/public_html/lib/private/Route/Router.php#459 

most or maybe even all apps ship file named “Controller”:

list of Controller files
# find /var/www/html -name Controller -print
/var/www/html/custom_apps/calendar/lib/Controller
/var/www/html/custom_apps/circles/lib/Controller
/var/www/html/custom_apps/richdocuments/lib/Controller
/var/www/html/custom_apps/bruteforcesettings/lib/Controller
/var/www/html/custom_apps/related_resources/lib/Controller
/var/www/html/custom_apps/twofactor_nextcloud_notification/lib/Controller
/var/www/html/custom_apps/contacts/lib/Controller
/var/www/html/custom_apps/groupfolders/lib/Controller
/var/www/html/custom_apps/spreed/lib/Controller
/var/www/html/custom_apps/spreed/lib/Federation/Proxy/TalkV1/Controller
/var/www/html/custom_apps/user_oidc/lib/Controller
/var/www/html/custom_apps/twofactor_totp/lib/Controller
/var/www/html/custom_apps/mail/lib/Controller
/var/www/html/custom_apps/forms/lib/Controller
/var/www/html/custom_apps/twofactor_webauthn/lib/Controller
/var/www/html/custom_apps/notify_push/lib/Controller
/var/www/html/apps/systemtags/lib/Controller
/var/www/html/apps/files_sharing/lib/Controller
/var/www/html/apps/recommendations/lib/Controller
/var/www/html/apps/privacy/lib/Controller
/var/www/html/apps/dav/lib/Controller
/var/www/html/apps/cloud_federation_api/lib/Controller
/var/www/html/apps/password_policy/lib/Controller
/var/www/html/apps/provisioning_api/lib/Controller
/var/www/html/apps/encryption/lib/Controller
/var/www/html/apps/firstrunwizard/lib/Controller
/var/www/html/apps/weather_status/lib/Controller
/var/www/html/apps/circles/lib/Controller
/var/www/html/apps/files_external/lib/Controller
/var/www/html/apps/activity/lib/Controller
/var/www/html/apps/twofactor_backupcodes/lib/Controller
/var/www/html/apps/bruteforcesettings/lib/Controller
/var/www/html/apps/notifications/lib/Controller
/var/www/html/apps/files_trashbin/lib/Controller
/var/www/html/apps/user_ldap/lib/Controller
/var/www/html/apps/related_resources/lib/Controller
/var/www/html/apps/oauth2/lib/Controller
/var/www/html/apps/text/lib/Controller
/var/www/html/apps/logreader/lib/Controller
/var/www/html/apps/survey_client/lib/Controller
/var/www/html/apps/files_downloadlimit/lib/Controller
/var/www/html/apps/comments/lib/Controller
/var/www/html/apps/theming/lib/Controller
/var/www/html/apps/files_pdfviewer/lib/Controller
/var/www/html/apps/settings/lib/Controller
/var/www/html/apps/updatenotification/lib/Controller
/var/www/html/apps/serverinfo/lib/Controller
/var/www/html/apps/files_reminders/lib/Controller
/var/www/html/apps/federation/lib/Controller
/var/www/html/apps/dashboard/lib/Controller
/var/www/html/apps/workflowengine/lib/Controller
/var/www/html/apps/photos/lib/Controller
/var/www/html/apps/user_status/lib/Controller
/var/www/html/apps/twofactor_totp/lib/Controller
/var/www/html/apps/federatedfilesharing/lib/Controller
/var/www/html/apps/files_versions/lib/Controller
/var/www/html/apps/files/lib/Controller
/var/www/html/apps/support/lib/Controller
/var/www/html/core/Controller

line 459 of /var/www/html/lib/private/Route/Router.php checks the file

452:                    $appControllerPath = __DIR__ . '/../../../core/Controller';
455:                    $appControllerPath = \OC_App::getAppPath($app) . '/lib/Controller';
459:            if (!file_exists($appControllerPath)) {

→ observe leading root!

might result from line

455:                    $appControllerPath = \OC_App::getAppPath($app) . '/lib/Controller';

which seems to have empty $app value and for this reason building wrong path /lib/Controller

2 Likes

so what your advice to solve it ?

1 Like

with systematic troubleshooting - analyze which app cause the problem, look for GH issues and updates if not reported so far create a bug report.

is there any refrence could help me discover the problem without making and damage to the site ?