Nextcloud 29 update issues: ReflectionException

When I upgrade Nextcloud from 28.0.0.4 to 29.0.0, I can’t open the dashboard.
Here is the log ,please help give me some advice, thanks.

{“reqId”:“oIR1l4xtVXxome7MqJnz”,“level”:3,“time”:“2024-05-08T01:44:15+00:00”,“remoteAddr”:“180.168.185.6”,“user”:“admin”,“app”:“index”,“method”:“GET”,“url”:“/index.php/apps/dashboard/”,“message”:“Class "OCA\Files\Controller\AjaxController" does not exist”,“userAgent”:“Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/124.0.0.0 Safari/537.36”,“version”:“29.0.0.19”,“exception”:{“Exception”:“ReflectionException”,“Message”:“Class "OCA\Files\Controller\AjaxController" does not exist”,“Code”:-1,“Trace”:[{“file”:“/www/wwwroot/cloud.yra.xyz/lib/private/Route/Router.php”,“line”:469,“function”:“__construct”,“class”:“ReflectionClass”,“type”:“->”},{“file”:“/www/wwwroot/cloud.yra.xyz/lib/private/Route/Router.php”,“line”:161,“function”:“getAttributeRoutes”,“class”:“OC\Route\Router”,“type”:“->”},{“file”:“/www/wwwroot/cloud.yra.xyz/lib/private/Route/Router.php”,“line”:400,“function”:“loadRoutes”,“class”:“OC\Route\Router”,“type”:“->”},{“file”:“/www/wwwroot/cloud.yra.xyz/lib/private/Route/CachingRouter.php”,“line”:65,“function”:“generate”,“class”:“OC\Route\Router”,“type”:“->”},{“file”:“/www/wwwroot/cloud.yra.xyz/lib/private/URLGenerator.php”,“line”:103,“function”:“generate”,“class”:“OC\Route\CachingRouter”,“type”:“->”},{“file”:“/www/wwwroot/cloud.yra.xyz/lib/private/NavigationManager.php”,“line”:371,“function”:“linkToRoute”,“class”:“OC\URLGenerator”,“type”:“->”},{“file”:“/www/wwwroot/cloud.yra.xyz/lib/private/NavigationManager.php”,“line”:132,“function”:“init”,“class”:“OC\NavigationManager”,“type”:“->”},{“file”:“/www/wwwroot/cloud.yra.xyz/lib/private/TemplateLayout.php”,“line”:110,“function”:“getAll”,“class”:“OC\NavigationManager”,“type”:“->”},{“file”:“/www/wwwroot/cloud.yra.xyz/lib/private/legacy/OC_Template.php”,“line”:145,“function”:“__construct”,“class”:“OC\TemplateLayout”,“type”:“->”},{“file”:“/www/wwwroot/cloud.yra.xyz/lib/public/AppFramework/Http/TemplateResponse.php”,“line”:211,“function”:“fetchPage”,“class”:“OC_Template”,“type”:“->”},{“file”:“/www/wwwroot/cloud.yra.xyz/lib/private/AppFramework/Http/Dispatcher.php”,“line”:183,“function”:“render”,“class”:“OCP\AppFramework\Http\TemplateResponse”,“type”:“->”},{“file”:“/www/wwwroot/cloud.yra.xyz/lib/private/AppFramework/App.php”,“line”:184,“function”:“dispatch”,“class”:“OC\AppFramework\Http\Dispatcher”,“type”:“->”},{“file”:“/www/wwwroot/cloud.yra.xyz/lib/private/Route/Router.php”,“line”:338,“function”:“main”,“class”:“OC\AppFramework\App”,“type”:“::”},{“file”:“/www/wwwroot/cloud.yra.xyz/lib/base.php”,“line”:1050,“function”:“match”,“class”:“OC\Route\Router”,“type”:“->”},{“file”:“/www/wwwroot/cloud.yra.xyz/index.php”,“line”:49,“function”:“handleRequest”,“class”:“OC”,“type”:“::”}],“File”:“/www/wwwroot/cloud.yra.xyz/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”}}

According to the Nextcloud documentation, you should not skip any point releases before upgrading to the next major release.

  • If I can read your issue, you upgraded from version 28.0.0.4 directly to version 29.0.0.
  • You should have upgraded from version 28.0.0.4 to the next point release ,version 28.0.1, followed by upgrading to version 28.0.2, then v 28.0.3,… until version 28.0.5. Then you are able to update to version 29.0.0
  • If you meant your release was v28.0.4 in stead of 28.0.0.4, then stil you needed to upgrade to v 28.0.5 first before upgrading to v 29.0.0

Reference: How to upgrade — Nextcloud latest Administration Manual latest documentation

Nextcloud must be upgraded step by step:

    Before you can upgrade to the next major release, Nextcloud upgrades to the latest point release.

    Then run the upgrade again to upgrade to the next major release’s latest point release.

    You cannot skip major releases. Please re-run the upgrade until you have reached the highest available (or applicable) release.

    Example: 18.0.5 -> 18.0.11 -> 19.0.5 -> 20.0.2

Thank you so much, I should not skip the point release directly to the major release V29.0.0.

FYI: my updates happen everytime via cli
sudo -u www-data php updater/updater.phar -vvv

There was a time window in which an update 28.0.4 was offered directly to 29.0.

The update 28.0.4 to 28.0.5 only appeared a day (or some hours) later.
I think nextcloud has (had) a problem with the deployment here.

1 Like

Whatever update path the Updater offers is fine.

The main point in the manual is about making sure you’re not on an ancient maintenance release of the prior major before you jump to a new major.

New maintenance releases published around the same time as a new major release aren’t a problem. And they generally contain the same bug fixes anyway.

How did you deploy the updated code? And did you restart your web (or FPM) server/service after doing so? This may merely be a PHP caching matter.

YES,Just replace the file and run the occ command to upgrade. Then restart the PHP service.

Hi, this is a duplicate of ReflectionException Class does not exist and will be fixed by fix(Router): Stop loading routes of disabled apps by provokateurin · Pull Request #44797 · nextcloud/server · GitHub

All I should do is just replace this code in the file?

due to the link mentioned above we’re gonna close this one in favour for the other, the above mentioned one