Nextcloudアップデート後にWebが表示されなくなった
現象
- Nextcloudをアップデート後、Webページを表示させると、内部サーバーエラーと表示される。
- スマホアプリは問題なく使用できる。
- ログには次のような記述がある。
12T20:49:16+00:00″,”remoteAddr”:”192.168.1.1″,”user”:false,”app”:”index”,”method”:”GET”,”url”:”/”,”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/133.0.0.0 Safari/537.36″,”version”:”31.0.3.2″,”exception”:{“Exception”:”ReflectionException”,”Message”:”Class \”OCA\\Files\\Controller\\AjaxController\” does not exist”,”Code”:-1,”Trace”:[{“file”:”/home/hogehoge/public_html/lib/private/Route/Router.php”,”line”:462,”function”:”__construct”,”class”:”ReflectionClass”,”type”:”->”},{“file”:”/home/hogehoge/public_html/lib/private/Route/Router.php”,”line”:418,”function”:”getAttributeRoutes”,”class”:”OC\\Route\\Router”,”type”:”->”},{“file”:”/home/hogehoge/public_html/lib/private/Route/Router.php”,”line”:120,”function”:”loadAttributeRoutes”,”class”:”OC\\Route\\Router”,”type”:”->”},{“file”:”/home/hogehoge/public_html/lib/private/Route/Router.php”,”line”:265,”function”:”loadRoutes”,”class”:”OC\\Route\\Router”,”type”:”->”},{“file”:”/home/hogehoge/public_html/lib/private/Route/Router.php”,”line”:299,”function”:”findMatchingRoute”,”class”:”OC\\Route\\Router”,”type”:”->”},{“file”:”/home/hogehoge/public_html/lib/base.php”,”line”:1027,”function”:”match”,”class”:”OC\\Route\\Router”,”type”:”->”},{“file”:”/home/hogehoge/public_html/index.php”,”line”:24,”function”:”handleRequest”,”class”:”OC”,”type”:”::”}],”File”:”/home/hogehoge/public_html/lib/private/Route/Router.php”,”Line”:462,”message”:”Class \”OCA\\Files\\Controller\\AjaxController\” does not exist”,”exception”:{},”CustomMessage”:”Class \”OCA\\Files\\Controller\\AjaxController\” does not exist”}}
結論
- apps/files/lib/Controller/AjaxController.phpを消すorリネームする。
補足
- https://github.com/nextcloud/server/pull/44797 に記載あり。
- https://help.nextcloud.com/t/nextcloud-29-update-issues-reflectionexception/191044 によると、正しいアップデートのお作法は、
次のメジャー リリースにアップグレードする前に、ポイント リリースをスキップしないでください。
- 問題の内容がわかったので、バージョン 28.0.0.4 からバージョン 29.0.0 に直接アップグレードしたようです。
- バージョン28.0.0.4から次のポイントリリースであるバージョン28.0.1にアップグレードし、その後バージョン28.0.2、バージョン28.0.3、…とバージョン28.0.5までアップグレードする必要があります。その後、バージョン29.0.0にアップデートできます。
- リリースが 28.0.0.4 ではなく v28.0.4 であることを意味していた場合でも、v 29.0.0 にアップグレードする前に、まず v 28.0.5 にアップグレードする必要があります。
私も、一足飛びにアップデートしたので、どうもそれが原因だったみたいです。