Argument must be of type array

Can not open ‘settings/apps’, https://www.damainname.net/index.php/settings/apps

Error logs: in nextcloud.log

{“reqId”:“Yy5qv2yMx7XXl48PSJy_VAAATAE”,“level”:3,“time”:“2022-09-24T02:26:08+00:00”,“remoteAddr”:“...”,“user”:“root”,“app”:“PHP”,“method”:“GET”,“url”:“/index.php/settings/apps”,“message”:“foreach() argument must be of type array|object, null given at /var/www/html/nextcloud/lib/private/App/AppStore/Fetcher/AppFetcher.php#96”,“userAgent”:“Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/105.0.0.0 Safari/537.36”,“version”:“24.0.5.1”,“exception”:{“Exception”:“Error”,“Message”:“foreach() argument must be of type array|object, null given at /var/www/html/nextcloud/lib/private/App/AppStore/Fetcher/AppFetcher.php#96”,“Code”:0,“Trace”:[{“file”:“/var/www/html/nextcloud/lib/private/App/AppStore/Fetcher/AppFetcher.php”,“line”:96,“function”:“onError”,“class”:“OC\Log\ErrorHandler”,“type”:“::”},{“file”:“/var/www/html/nextcloud/lib/private/App/AppStore/Fetcher/Fetcher.php”,“line”:192,“function”:“fetch”,“class”:“OC\App\AppStore\Fetcher\AppFetcher”,“type”:“->”},{“file”:“/var/www/html/nextcloud/lib/private/App/AppStore/Fetcher/AppFetcher.php”,“line”:188,“function”:“get”,“class”:“OC\App\AppStore\Fetcher\Fetcher”,“type”:“->”},{“file”:“/var/www/html/nextcloud/lib/private/Installer.php”,“line”:422,“function”:“get”,“class”:“OC\App\AppStore\Fetcher\AppFetcher”,“type”:“->”},{“file”:“/var/www/html/nextcloud/apps/settings/lib/Controller/AppSettingsController.php”,“line”:151,“function”:“isUpdateAvailable”,“class”:“OC\Installer”,“type”:“->”},{“file”:“/var/www/html/nextcloud/apps/settings/lib/Controller/AppSettingsController.php”,“line”:134,“function”:“getAppsWithUpdates”,“class”:“OCA\Settings\Controller\AppSettingsController”,“type”:“->”},{“file”:“/var/www/html/nextcloud/lib/private/AppFramework/Http/Dispatcher.php”,“line”:225,“function”:“viewApps”,“class”:“OCA\Settings\Controller\AppSettingsController”,“type”:“->”},{“file”:“/var/www/html/nextcloud/lib/private/AppFramework/Http/Dispatcher.php”,“line”:133,“function”:“executeController”,“class”:“OC\AppFramework\Http\Dispatcher”,“type”:“->”},{“file”:“/var/www/html/nextcloud/lib/private/AppFramework/App.php”,“line”:172,“function”:“dispatch”,“class”:“OC\AppFramework\Http\Dispatcher”,“type”:“->”},{“file”:“/var/www/html/nextcloud/lib/private/Route/Router.php”,“line”:298,“function”:“main”,“class”:“OC\AppFramework\App”,“type”:“::”},{“file”:“/var/www/html/nextcloud/lib/base.php”,“line”:1030,“function”:“match”,“class”:“OC\Route\Router”,“type”:“->”},{“file”:“/var/www/html/nextcloud/index.php”,“line”:36,“function”:“handleRequest”,“class”:“OC”,“type”:“::”}],“File”:“/var/www/html/nextcloud/lib/private/Log/ErrorHandler.php”,“Line”:92,“CustomMessage”:“–”}}
{“reqId”:“Yy5qv2yMx7XXl48PSJy_VAAATAE”,“level”:3,“time”:“2022-09-24T02:26:08+00:00”,“remoteAddr”:“...”,“user”:“root”,“app”:“index”,“method”:“GET”,“url”:“/index.php/settings/apps”,“message”:“array_filter(): Argument #1 ($array) must be of type array, null given in file ‘/var/www/html/nextcloud/lib/private/App/AppStore/Fetcher/AppFetcher.php’ line 169”,“userAgent”:“Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/105.0.0.0 Safari/537.36”,“version”:“24.0.5.1”,“exception”:{“Exception”:“Exception”,“Message”:“array_filter(): Argument #1 ($array) must be of type array, null given in file ‘/var/www/html/nextcloud/lib/private/App/AppStore/Fetcher/AppFetcher.php’ line 169”,“Code”:0,“Trace”:[{“file”:“/var/www/html/nextcloud/lib/private/AppFramework/App.php”,“line”:172,“function”:“dispatch”,“class”:“OC\AppFramework\Http\Dispatcher”,“type”:“->”},{“file”:“/var/www/html/nextcloud/lib/private/Route/Router.php”,“line”:298,“function”:“main”,“class”:“OC\AppFramework\App”,“type”:“::”},{“file”:“/var/www/html/nextcloud/lib/base.php”,“line”:1030,“function”:“match”,“class”:“OC\Route\Router”,“type”:“->”},{“file”:“/var/www/html/nextcloud/index.php”,“line”:36,“function”:“handleRequest”,“class”:“OC”,“type”:“::”}],“File”:“/var/www/html/nextcloud/lib/private/AppFramework/Http/Dispatcher.php”,“Line”:165,“Previous”:{“Exception”:“TypeError”,“Message”:“array_filter(): Argument #1 ($array) must be of type array, null given”,“Code”:0,“Trace”:[{“file”:“/var/www/html/nextcloud/lib/private/App/AppStore/Fetcher/AppFetcher.php”,“line”:169,“function”:“array_filter”},{“file”:“/var/www/html/nextcloud/lib/private/App/AppStore/Fetcher/Fetcher.php”,“line”:192,“function”:“fetch”,“class”:“OC\App\AppStore\Fetcher\AppFetcher”,“type”:“->”},{“file”:“/var/www/html/nextcloud/lib/private/App/AppStore/Fetcher/AppFetcher.php”,“line”:188,“function”:“get”,“class”:“OC\App\AppStore\Fetcher\Fetcher”,“type”:“->”},{“file”:“/var/www/html/nextcloud/lib/private/Installer.php”,“line”:422,“function”:“get”,“class”:“OC\App\AppStore\Fetcher\AppFetcher”,“type”:“->”},{“file”:“/var/www/html/nextcloud/apps/settings/lib/Controller/AppSettingsController.php”,“line”:151,“function”:“isUpdateAvailable”,“class”:“OC\Installer”,“type”:“->”},{“file”:“/var/www/html/nextcloud/apps/settings/lib/Controller/AppSettingsController.php”,“line”:134,“function”:“getAppsWithUpdates”,“class”:“OCA\Settings\Controller\AppSettingsController”,“type”:“->”},{“file”:“/var/www/html/nextcloud/lib/private/AppFramework/Http/Dispatcher.php”,“line”:225,“function”:“viewApps”,“class”:“OCA\Settings\Controller\AppSettingsController”,“type”:“->”},{“file”:“/var/www/html/nextcloud/lib/private/AppFramework/Http/Dispatcher.php”,“line”:133,“function”:“executeController”,“class”:“OC\AppFramework\Http\Dispatcher”,“type”:“->”},{“file”:“/var/www/html/nextcloud/lib/private/AppFramework/App.php”,“line”:172,“function”:“dispatch”,“class”:“OC\AppFramework\Http\Dispatcher”,“type”:“->”},{“file”:“/var/www/html/nextcloud/lib/private/Route/Router.php”,“line”:298,“function”:“main”,“class”:“OC\AppFramework\App”,“type”:“::”},{“file”:“/var/www/html/nextcloud/lib/base.php”,“line”:1030,“function”:“match”,“class”:“OC\Route\Router”,“type”:“->”},{“file”:“/var/www/html/nextcloud/index.php”,“line”:36,“function”:“handleRequest”,“class”:“OC”,“type”:“::”}],“File”:“/var/www/html/nextcloud/lib/private/App/AppStore/Fetcher/AppFetcher.php”,“Line”:169},“CustomMessage”:“–”}}

Very Strange, it’s accessible again. The server has not been changed, only the client computer system has been rebooted.

The cause of this issue has been found. That is, the app.json file obtained by my nextcloud instance is incomplete.
I am using a third-party mirror appstore, which using the https://apps.nextcloud.com/api/v1/apps.json as source. Some times, the apps.json is not fullly download to the mirror, and then results to this issue in nextcloud instance.