# ReflectionException Class does not exist

**URL:** <https://help.nextcloud.com/t/reflectionexception-class-does-not-exist/190862>\
**Category:** ℹ️ Support\
**Tags:** nc29\
**Created:** [May 7, 2024, 1:40pm UTC](https://help.nextcloud.com/t/reflectionexception-class-does-not-exist/190862 "2024-05-07T13:40:59Z")\
**Posts on this page:** 14\
**Page:** 1

<div class="post-metadata">

**Author:** ![roster-patrol0](https://help.nextcloud.com/letter_avatar/roster-patrol0/32/5_5575768a8748004e209b776fc1b2916d.png) [@roster-patrol0](https://help.nextcloud.com/u/roster-patrol0)\
**Post date:** [May 7, 2024, 1:40pm UTC](https://help.nextcloud.com/t/reflectionexception-class-does-not-exist/190862/1 "2024-05-07T13:40:59Z")

</div>

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**

---

<div class="post-metadata">

**Author:** ![jtr](https://help.nextcloud.com/letter_avatar/jtr/32/5_5575768a8748004e209b776fc1b2916d.png) [@jtr](https://help.nextcloud.com/u/jtr)\
**Post date:** [May 7, 2024, 2:32pm UTC](https://help.nextcloud.com/t/reflectionexception-class-does-not-exist/190862/2 "2024-05-07T14:32:10Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![roster-patrol0](https://help.nextcloud.com/letter_avatar/roster-patrol0/32/5_5575768a8748004e209b776fc1b2916d.png) [@roster-patrol0](https://help.nextcloud.com/u/roster-patrol0)\
**Post date:** [May 7, 2024, 2:46pm UTC](https://help.nextcloud.com/t/reflectionexception-class-does-not-exist/190862/3 "2024-05-07T14:46:05Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![provokateurin](https://help.nextcloud.com/letter_avatar/provokateurin/32/5_5575768a8748004e209b776fc1b2916d.png) [@provokateurin](https://help.nextcloud.com/u/provokateurin)\
**Post date:** [May 8, 2024, 5:35am UTC](https://help.nextcloud.com/t/reflectionexception-class-does-not-exist/190862/4 "2024-05-08T05:35:34Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![roster-patrol0](https://help.nextcloud.com/letter_avatar/roster-patrol0/32/5_5575768a8748004e209b776fc1b2916d.png) [@roster-patrol0](https://help.nextcloud.com/u/roster-patrol0)\
**Post date:** [May 8, 2024, 5:44pm UTC](https://help.nextcloud.com/t/reflectionexception-class-does-not-exist/190862/5 "2024-05-08T17:44:37Z")

</div>

Sure!

I omitted the user and url installation, OK?

```auto
[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

```

```auto
{"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"}

```

---

<div class="post-metadata">

**Author:** ![roster-patrol0](https://help.nextcloud.com/letter_avatar/roster-patrol0/32/5_5575768a8748004e209b776fc1b2916d.png) [@roster-patrol0](https://help.nextcloud.com/u/roster-patrol0)\
**Post date:** [May 8, 2024, 5:45pm UTC](https://help.nextcloud.com/t/reflectionexception-class-does-not-exist/190862/6 "2024-05-08T17:45:55Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![provokateurin](https://help.nextcloud.com/letter_avatar/provokateurin/32/5_5575768a8748004e209b776fc1b2916d.png) [@provokateurin](https://help.nextcloud.com/u/provokateurin)\
**Post date:** [May 9, 2024, 5:42am UTC](https://help.nextcloud.com/t/reflectionexception-class-does-not-exist/190862/7 "2024-05-09T05:42:40Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![roster-patrol0](https://help.nextcloud.com/letter_avatar/roster-patrol0/32/5_5575768a8748004e209b776fc1b2916d.png) [@roster-patrol0](https://help.nextcloud.com/u/roster-patrol0)\
**Post date:** [May 9, 2024, 12:32pm UTC](https://help.nextcloud.com/t/reflectionexception-class-does-not-exist/190862/8 "2024-05-09T12:32:31Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![provokateurin](https://help.nextcloud.com/letter_avatar/provokateurin/32/5_5575768a8748004e209b776fc1b2916d.png) [@provokateurin](https://help.nextcloud.com/u/provokateurin)\
**Post date:** [May 10, 2024, 5:14am UTC](https://help.nextcloud.com/t/reflectionexception-class-does-not-exist/190862/9 "2024-05-10T05:14:00Z")

</div>

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](https://github.com/nextcloud/server/pull/44797).

---

<div class="post-metadata">

**Author:** ![roster-patrol0](https://help.nextcloud.com/letter_avatar/roster-patrol0/32/5_5575768a8748004e209b776fc1b2916d.png) [@roster-patrol0](https://help.nextcloud.com/u/roster-patrol0)\
**Post date:** [May 10, 2024, 12:39pm UTC](https://help.nextcloud.com/t/reflectionexception-class-does-not-exist/190862/10 "2024-05-10T12:39:48Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Alberto24](https://help.nextcloud.com/letter_avatar/alberto24/32/5_5575768a8748004e209b776fc1b2916d.png) [@Alberto24](https://help.nextcloud.com/u/Alberto24)\
**Post date:** [May 12, 2024, 10:46am UTC](https://help.nextcloud.com/t/reflectionexception-class-does-not-exist/190862/11 "2024-05-12T10:46:57Z")

</div>

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**
>
> ```auto
> {"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

---

<div class="post-metadata">

**Author:** ![system](https://help.nextcloud.com/user_avatar/help.nextcloud.com/system/32/29333_2.png) [@system](https://help.nextcloud.com/u/system)\
**Post date:** [May 20, 2024, 10:47am UTC](https://help.nextcloud.com/t/reflectionexception-class-does-not-exist/190862/12 "2024-05-20T10:47:03Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![provokateurin](https://help.nextcloud.com/letter_avatar/provokateurin/32/5_5575768a8748004e209b776fc1b2916d.png) [@provokateurin](https://help.nextcloud.com/u/provokateurin)\
**Post date:** [June 3, 2024, 7:50am UTC](https://help.nextcloud.com/t/reflectionexception-class-does-not-exist/190862/13 "2024-06-03T07:50:56Z")

</div>

This rather looks like your autoloaders in the dev setup are wrong or something else. The files app can’t even be disabled so it can’t be the same problem. Another thing might be opcache, so please restart apache/php-fpm

---

<div class="post-metadata">

**Author:** ![provokateurin](https://help.nextcloud.com/letter_avatar/provokateurin/32/5_5575768a8748004e209b776fc1b2916d.png) [@provokateurin](https://help.nextcloud.com/u/provokateurin)\
**Post date:** [June 10, 2024, 7:05pm UTC](https://help.nextcloud.com/t/reflectionexception-class-does-not-exist/190862/14 "2024-06-10T19:05:50Z")

</div>

Another user reported problems as well and it was due to having old files that are not even part of Nextcloud anymore. If you encounter this issue please check the last modified date of the class/file that is mentioned in the error message. It will likely be much older than any of the other files.
