ReflectionException Class does not exist

I’m getting “ReflectionException
Class "OCA\Dashboard\Controller\DashboardApiController” does not exist, or could not parse URI" error after 29.0.0 update.

Nextcloud version: 29.0.0
Operating system and version: Ubuntu 22.04
Apache version: 2.4.52
PHP version: 8.3.6

Try restarting your web server (or FPM, if using). May be PHP caching if it’s an upgraded instance.

Yes! I just upgraded both Nextcloud and PHP. I did restart FPM. If the problem persists I’ll update the thread, thank you!

Hi, can you post a full stacktrace of the error?

Sure!

I omitted the user and url installation, OK?

[no app in context] Error: Class "OCA\Dashboard\Controller\DashboardApiController" does not exist
	GET /ocs/v2.php/apps/dashboard/api/v1/widgets
	from *** by *** at 8 de mai. de 2024, 14:28:51

{"reqId":"BFEh8ghyACwpvzDZZKOy","level":3,"time":"2024-05-08T17:28:51+00:00","remoteAddr":"189.120.78.124","user":"***","app":"no app in context","method":"GET","url":"/ocs/v2.php/apps/dashboard/api/v1/widgets","message":"Class \"OCA\\Dashboard\\Controller\\DashboardApiController\" does not exist","userAgent":"Mozilla/5.0 (iOS) Nextcloud-iOS/5.2.7","version":"29.0.0.19","exception":{"Exception":"ReflectionException","Message":"Class \"OCA\\Dashboard\\Controller\\DashboardApiController\" does not exist","Code":-1,"Trace":[{"file":"/var/www/***/lib/private/Route/Router.php","line":469,"function":"__construct","class":"ReflectionClass","type":"->"},{"file":"/var/www/***/lib/private/Route/Router.php","line":161,"function":"getAttributeRoutes","class":"OC\\Route\\Router","type":"->"},{"file":"/var/www/***/lib/private/Route/Router.php","line":286,"function":"loadRoutes","class":"OC\\Route\\Router","type":"->"},{"file":"/var/www/***/lib/private/Route/Router.php","line":330,"function":"findMatchingRoute","class":"OC\\Route\\Router","type":"->"},{"file":"/var/www/***/ocs/v1.php","line":66,"function":"match","class":"OC\\Route\\Router","type":"->"},{"file":"/var/www/***/ocs/v2.php","line":23,"args":["/var/www/***/ocs/v1.php"],"function":"require_once"}],"File":"/var/www/***/lib/private/Route/Router.php","Line":469,"message":"Class \"OCA\\Dashboard\\Controller\\DashboardApiController\" does not exist","exception":[],"CustomMessage":"Class \"OCA\\Dashboard\\Controller\\DashboardApiController\" does not exist"},"id":"663bb65676f59"}

I did restart, but the problem persists. Thanks anyway.

Do you have the dashboard app disabled? It was already reported once to me that the problem happens when you have an app installed but disabled.

Yes, I tried and didn’t work. I will downgrade the PHP and try again. Thanks!

Downgrading anything (except for the server version) won’t fix anything. This problem is a bug that should be fixed by fix(Router): Stop loading routes of disabled apps by provokateurin · Pull Request #44797 · nextcloud/server · GitHub.

1 Like

I’m sorry, I didn’t see this thread. Yes, downgrading didn’t help. I’ll try the fix, thank you.

I’m currently checked-out on stable29 and I have this commit (I double-checked in the code to make sure), though I see a bunch of those errors and the files app is unusable.

I’m attaching some logs below:

Logs
{"reqId":"…","level":3,"time":"2024-05-12T12:27:14+02:00","remoteAddr":"…Addr…","user":"…Usr…","app":"index","method":"GET","url":"/index.php/apps/files/","message":"Class \"OCA\\Files\\Controller\\AjaxController\" does not exist","userAgent":"…Agent…","version":"29.0.0.19","exception":{"Exception":"ReflectionException","Message":"Class \"OCA\\Files\\Controller\\AjaxContr
oller\" does not exist","Code":-1,"Trace":[{"file":"/home/webapps/nextcloud/lib/private/Route/Router.php","line":469,"function":"__construct","class":"ReflectionClass","type":"->"},{"file":"/home/webapps/nextcloud/lib/private/Route/Router.php","line":161,"function":"getAttributeRoutes","class":"OC\\Route\\Router","type":"->"},{"file":"/home/webapps/nextcloud/lib/private/Route/Router.php","line":279,"function":"loadRoutes","class":"OC\\Route\\Router","type":"->"},{"file":"/home/webapps/nextcloud/lib/private/Route/Router.php","line":330,"function":"findMatchingRoute","class":"OC\\Route\\Router","type":"->"},{"file":"/home/webapps/nextcloud/lib/base.php","line":1050,"function":"match","class":"OC\\Route\\Router","type":"->"},{"file":"/home/webapps/nextcloud/index.php","line":49,"function":"handleRequest","class":"OC","type":"::"}],"File":"/home/webapps/nextcloud/lib/private/Route/Router.php","Line":469,"message":"Class \"OCA\\Files\\Controller\\AjaxController\" does not exist","exception":{},"CustomMessage":"Class \"OCA\\Files\\Controller\\AjaxController\" does not exist"}}
{"reqId":"…","level":3,"time":"2024-05-12T12:27:15+02:00","remoteAddr":"…Addr…","user":"…Usr…","app":"core","method":"GET","url":"/index.php/apps/files/","message":"Exception thrown: ReflectionExcep
tion","userAgent":"…Agent…","version":"29.0.0.19","exception":{"Exception":"ReflectionException","Message":"Class \"OCA\\Files\\Controller\\AjaxController\" does not exist","Code":-1,"Trace":[{"file":"/home/webapps/nextcloud/lib/private/Route/Router.php","line":469,"function":"__construct","class":"ReflectionClass","type":"->"},{"file":"/home/webapps/nextcloud/lib/private/Route/Router.php","line":161,"function":"getAttributeRoutes","class":"OC\\Route\\Router","type":"->"},{"file":"/home/webapps/nextcloud/lib/private/Route/Router.php","line":279,"function":"loadRoutes","class":"OC\\Route\\Router","type":"->"},{"file":"/home/webapps/nextcloud/lib/private/Route/Router.php","line":330,"function":"findMatchingRoute","class":"OC\\Route\\Router","type":"->"},{"file":"/home/webapps/nextcloud/lib/base.php","line":1050,"function":"match","class":"OC\\Route\\Router","type":"->"},{"file":"/home/webapps/nextcloud/index.php","line":49,"function":"handleRequest","class":"OC","type":"::"}],"File":"/home/webapps/nextcloud/lib/private/Route/Router.php","Line":469,"CustomMessage":"Exception thrown: ReflectionException"}}
{"reqId":"…","level":3,"time":"2024-05-12T12:27:15+02:00","remoteAddr":"…Addr…","user":"…Usr…","app":"core","method":"GET","url":"/index.php/apps/files/","message":"Exception thrown: ReflectionException","userAgent":"…Agent…","version":"29.0.0.19","exception":{"Exception":"ReflectionException","Message":"Class \"OCA\\Files\\Controller\\AjaxController\" does not exist","Code":-1,"Trace":[{"file":"/home/webapps/nextcloud/lib/private/Route/Router.php","line":469,"function":"__construct","class":"ReflectionClass","type":"->"},{"file":"/home/webapps/nextcloud/lib/private/Route/Router.php","line":161,"function":"getAttributeRoutes","class":"OC\\Route\\Router","type":"->"},{"file":"/home/webapps/nextcloud/lib/private/Route/Router.php","line":400,"function":"loadRoutes","class":"OC\\Route\\Router","type":"->"},{"file":"/home/webapps/nextcloud/lib/private/Route/CachingRouter.php","line":65,"function":"generate","class":"OC\\Route\\Router","type":"->"},{"file":"/home/webapps/nextcloud/lib/private/URLGenerator.php","line":103,"function":"generate","class":"OC\\Route\\CachingRouter","type":"->"},{"file":"/home/webapps/nextcloud/lib/private/NavigationManager.php","line":371,"function":"linkToRoute","class":"OC\\URLGenerator","type":"->"},{"file":"/home/webapps/nextcloud/lib/private/NavigationManager.php","line":132,"function":"init","class":"OC\\NavigationManager","type":"->"},{"file":"/home/webapps/nextcloud/apps/theming/lib/ThemingDefaults.php","line":199,"function":"getAll","class":"OC\\NavigationManager","type":"->"},{"file":"/home/webapps/nextcloud/lib/private/legacy/OC_Defaults.php","line":271,"function":"getShortFooter","class":"OCA\\Theming\\ThemingDefaults","type":"->"},{"file":"/home/webapps/nextcloud/lib/public/Defaults.php","line":176,"function":"getLongFooter","class":"OC_Defaults","type":"->"},{"file":"/home/webapps/nextcloud/core/templates/layout.guest.php","line":51,"function":"getLongFooter","class":"OCP\\Defaults","type":"->"},{"file":"/home/webapps/nextcloud/lib/private/Template/Base.php","line":180,"args"
:["/home/webapps/nextcloud/core/templates/layout.guest.php"],"function":"include"},{"file":"/home/webapps/nextcloud/lib/private/Template/Base.php","line":150,"function":"load","class":"OC\\Template\\Base","type":"->"},{"file":"/home/webapps/nextcloud/lib/private/legacy/OC_Template.php","line":142,"function":"fetchPage","class":"OC\\Template\\Base","type":"->"},{"file":"/home/webapps/nextcloud/lib/private/legacy/OC_Template.php","line":173,"function":"fetchPage","class":"OC_Template","type":"->"},{"file":"/home/webapps/nextcloud/lib/private/Template/Base.php","line":132,"function":"fetchPage","class":"OC_Template","type":"->"},{"file":"/home/webapps/nextcloud/lib/private/legacy/OC_Template.php","line":320,"function":"printPage","class":"OC\\Template\\Base","type":"->"},{"file":"/home/webapps/nextcloud/index.php","line":114,"function":"printExceptionErrorPage","class":"OC_Template","type":"::"}],"File":"/home/webapps/nextcloud/lib/private/Route/Router.php","Line":469,"CustomMessage":"Exception thrown: ReflectionException"}}                                      
{"reqId":"…*","level":3,"time":"2024-05-12T12:27:15+02:00","remoteAddr":"…Addr…","user":"…Usr…","app":"index","method":"GET","url":"/index.php/apps/files/preview-service-worker.js","message":"Class \"OCA\\Files\\Controller\\AjaxController\" does not exist","userAgent":"…Agent…","version":"29.0.0.19","exception":{"Exception":"ReflectionException","Message":"Class \"OCA\\Fil
es\\Controller\\AjaxController\" does not exist","Code":-1,"Trace":[{"file":"/home/webapps/nextcloud/lib/private/Route/Router.php","line":469,"function":"__construct","class":"ReflectionClass","type":"->"},{"file":"/home/webapps/nextcloud/lib/private/Route/Router.php","line":161,"function":"getAttributeRoutes","class":"OC\\Route\\Router","type":"->"},{"file":"/home/webapps/nextcloud/lib/private/Route/Router.php","line":279,"function":"loadRoutes","class":"OC\\Route\\Router","type":"->"},{"file":"/home/webapps/nextcloud/lib/private/Route/Router.php","line":330,"function":"findMatchingRoute","class":"OC\\Route\\Router","type":"->"},{"file":"/home/webapps/nextcloud/lib/base.php","line":1050,"function":"match","class":"OC\\Route\\Router","type":"->"},{"file":"/home/webapps/nextcloud/index.php","line":49,"function":"handleRequest","class":"OC","type":"::"}],"File":"/home/webapps/nextcloud/lib/private/Route/Router.php","Line":469,"message":"Class \"OCA\\Files\\Controller\\AjaxController\" does not exist","exception":{},"CustomMessage":"Class \"OCA\\Files\\Controller\\AjaxController\" does not exist"}}
{"reqId":"…*","level":3,"time":"2024-05-12T12:27:15+02:00","remoteAddr":"…Addr…","user":"…Usr…","app":"core","method":"GET","url":"/index.php/apps/files/preview-service-worker.js","message":"Exception thrown: ReflectionException","userAgent":"…Agent…","version":"29.0.0.19","exception":{"Exception":"ReflectionException","Message":"Class \"OCA\\Files\\Controller\\AjaxControl
ler\" does not exist","Code":-1,"Trace":[{"file":"/home/webapps/nextcloud/lib/private/Route/Router.php","line":469,"function":"__construct","class":"ReflectionClass","type":"->"},{"file":"/home/webapps/nextcloud/lib/private/Route/Router.php","line":161,"function":"getAttributeRoutes","class":"OC\\Route\\Router","type":"->"},{"file":"/home/webapps/nextcloud/lib/private/Route/Router.php","line":279,"function":"loadRoutes","class":"OC\\Route\\Router","type":"->"},{"file":"/home/webapps/nextcloud/lib/private/Route/Router.php","line":330,"function":"findMatchingRoute","class":"OC\\Route\\Router","type":"->"},{"file":"/home/webapps/nextcloud/lib/base.php","line":1050,"function":"match","class":"OC\\Route\\Router","type":"->"},{"file":"/home/webapps/nextcloud/index.php","line":49,"function":"handleRequest","class":"OC","type":"::"}],"File":"/home/webapps/nextcloud/lib/private/Route/Router.php","Line":469,"CustomMessage":"Exception thrown: ReflectionException"}}                                               
{"reqId":"…*","level":3,"time":"2024-05-12T12:27:15+02:00","remoteAddr":"…Addr…","user":"…Usr…","app":"core","method":"GET","url":"/index.php/apps/files/preview-service-worker.js","message":"Exception thrown: ReflectionException","userAgent":"…Agent…","version":"29.0.0.19","exception":{"Exception":"ReflectionException","Message":"Class \"OCA\\Files\\Controller\\AjaxController\" does not exist","Code":-1,"Trace":[{"file":"/home/webapps/nextcloud/lib/private/Route/Router.php","line":469,"function":"__construct","class":"ReflectionClass","type":"->"},{"file":"/home/webapps/nextcloud/lib/private/Route/Router.php","line":161,"function":"getAttributeRoutes","class":"OC\\Route\\Router","type":"->"},{"file":"/home/webapps/nextcloud/lib/private/Route/Router.php","line":400,"function":"loadRoutes","class":"OC\\Route\\Router","type":"->"},{"file":"/home/webapps/nextcloud/lib/private/Route/CachingRouter.php","line":65,"function":"generate","class":"OC\\Route\\Router","type":"->"},{"file":"/home/webapps/nextcloud/lib/private/URLGenerator.php","line":103,"function":"generate","class":"OC\\Route\\CachingRouter","type":"->"},{"file":"/home/webapps/nextcloud/lib/private/NavigationManager.php","line":371,"function":"linkToRoute","class":"OC\\URLGenerator","type":"->"},{"file":"/home/webapps/nextcloud/lib/private/NavigationManager.php","line":132,"function":"init","class":"OC\\NavigationManager","type":"->"},{"file":"/home/webapps/nextcloud/apps/theming/lib/ThemingDefaults.php","line":199,"function":"getAll","class":"OC\\NavigationManager","type":"->"},{"file":"/home/webapps/nextcloud/lib/private/legacy/OC_Defaults.php","line":271,"function":"getShortFooter","class":"OCA\\Theming\\ThemingDefaults","type":"->"},{"file":"/home/webapps/nextcloud/lib/public/Defaults.php","line":176,"function":"getLongFooter","class":"OC_Defaults","type":"->"},{"file":"/home/webapps/nextcloud/core/templates/layout.guest.php","line":51,"function":"getLongFooter","class":"OCP\\Defaults","type":"->"},{"file":"/home/webapps/nextcloud/lib/private/Template/Base.php","line":180,"args":["/home/webapps/nextcloud/core/templates/layout.guest.php"],"function":"include"},{"file":"/home/webapps/nextcloud/lib/private/Template/Base.php","line":150,"function":"load","class":"OC\\Template\\Base","type":"->"},{"file":"/home/webapps/nextcloud/lib/private/legacy/OC_Template.php","line":142,"function":"fetchPage","class":"OC\\Template\\Base","type":"->"},{"file":"/home/webapps/nextcloud/lib/private/legacy/OC_Template.php","line":173,"function":"fetchPage","class":"OC_Template","type":"->"},{"file":"/home/webapps/nextcloud/lib/private/Template/Base.php","line":132,"function":"fetchPage","class":"OC_Template","type":"->"},{"file":"/home/webapps/nextcloud/lib/private/legacy/OC_Template.php","line":320,"function":"printPage","class":"OC\\Template\\Base","type":"->"},{"file":"/home/webapps/nextcloud/index.php","line":114,"function":"printExceptionErrorPage","class":"OC_Template","type":"::"}],"File":"/home/webapps/nextcloud/lib/private/Route/Router.php","Line":469,"CustomMessage":"Exception thrown: ReflectionException"}}

CC @provokateurin

This topic was automatically closed 8 days after the last reply. New replies are no longer allowed.