====== NextcloudのoccでOCP\HintExceptionが発生した ====== 自鯖のNextcloudを23に更新し、''occ db:add-missing-indices''を実行しようとしたら''OCP\HintException''なる例外が発生した。 $ sudo -u www php /path/to/occ db:add-missing-indices An unhandled exception has been thrown: OCP\HintException: [0]: Memcache \OC\Memcache\APCu not available for local cache (Is the matching PHP module installed and enabled?) occ単発で動かしても同様で、根本的に何かが悪いっぽい。 助けて~ぐーぐるせんせーってことで、ググったら公式にそれっぽい[[https://github.com/nextcloud/server/issues/27781|issue]]が上がっていた。 いわく、''apc.enable_cli=1''を付けて実行する必要があるとのこと。APCuを明示的に有効化する必要がある雰囲気?とりあえず言われたとおりにやってみる。 $ sudo -u www php --define apc.enable_cli=1 /path/to/nextcloud/occ db:add-missing-indices Check indices of the share table. (中略) oc_properties table updated successfully. 無事動いた。 改めてNextcloudのマニュアルを見てみると、[[https://docs.nextcloud.com/server/latest/admin_manual/configuration_server/caching_configuration.html#id1|Memory cachingのAPCuのところ]]にちゃんと書いてあった。 デフォルトではCLIからの実行時はAPCuが無効化されているそうで、明示的に有効化しなきゃならんとのこと。NextcloudのCronジョブにも影響するので、そっちの方も個別に対応するか、''php.ini''に先の''apc.enable_cli=1''を追加しておく必要がある。 なるほどなー、だから管理画面に「長期間バックグラウンドジョブが動いていないようです」メッセージが表示されてたのかー。 ===== 参考サイト ===== * [[https://github.com/nextcloud/server/issues/27781|21.0.3 OC\HintException: Memcache \OC\Memcache\APCu not available · Issue #27781 · nextcloud/server · GitHub]] * [[https://docs.nextcloud.com/server/latest/admin_manual/configuration_server/caching_configuration.html#id1|Memory caching — Nextcloud latest Administration Manual latest documentation]]