nextcloud / server

☁️ Nextcloud server, a safe home for all your data
https://nextcloud.com
GNU Affero General Public License v3.0
27.46k stars 4.08k forks source link

`count()`: Argument #1 ($value) must be of type Countable|array, bool given in /lib/private/Http/Client/DnsPinMiddleware.php:68 #28005

Closed moviuro closed 3 years ago

moviuro commented 3 years ago

How to use GitHub

Steps to reproduce

  1. Install Nextcloud package
  2. Relaunch php-fpm
  3. Run su -m www -c "php ./occ upgrade"

Expected behaviour

Upgrade completes with no issue

Actual behaviour

# su -m www -c 'sh -c "cd /usr/local/www/nextcloud && php ./occ upgrade"'
PHP Warning:  Missing arginfo for Imagick::__tostring() in Unknown on line 0
PHP Warning:  Missing arginfo for Imagick::getimagehistogram() in Unknown on line 0
Nextcloud or one of the apps require upgrade - only a limited number of commands are available
You may use your browser or the occ upgrade command to do the upgrade
Setting log level to debug
Updating database schema
Updated database
Checking for update of app accessibility in appstore
An unhandled exception has been thrown:
TypeError: count(): Argument #1 ($value) must be of type Countable|array, bool given in /usr/local/www/nextcloud/lib/private/Http/Client/DnsPinMiddleware.php:68
Stack trace:
#0 /usr/local/www/nextcloud/lib/private/Http/Client/DnsPinMiddleware.php(68): count(false)
#1 /usr/local/www/nextcloud/lib/private/Http/Client/DnsPinMiddleware.php(113): OC\Http\Client\DnsPinMiddleware->dnsResolve('apps.nextcloud....', 0)
#2 /usr/local/www/nextcloud/3rdparty/guzzlehttp/guzzle/src/PrepareBodyMiddleware.php(35): OC\Http\Client\DnsPinMiddleware->OC\Http\Client\{closure}(Object(GuzzleHttp\Psr7\Request), Array)
#3 /usr/local/www/nextcloud/3rdparty/guzzlehttp/guzzle/src/Middleware.php(31): GuzzleHttp\PrepareBodyMiddleware->__invoke(Object(GuzzleHttp\Psr7\Request), Array)
#4 /usr/local/www/nextcloud/3rdparty/guzzlehttp/guzzle/src/RedirectMiddleware.php(71): GuzzleHttp\Middleware::GuzzleHttp\{closure}(Object(GuzzleHttp\Psr7\Request), Array)
#5 /usr/local/www/nextcloud/3rdparty/guzzlehttp/guzzle/src/Middleware.php(63): GuzzleHttp\RedirectMiddleware->__invoke(Object(GuzzleHttp\Psr7\Request), Array)
#6 /usr/local/www/nextcloud/3rdparty/guzzlehttp/guzzle/src/HandlerStack.php(75): GuzzleHttp\Middleware::GuzzleHttp\{closure}(Object(GuzzleHttp\Psr7\Request), Array)
#7 /usr/local/www/nextcloud/3rdparty/guzzlehttp/guzzle/src/Client.php(331): GuzzleHttp\HandlerStack->__invoke(Object(GuzzleHttp\Psr7\Request), Array)
#8 /usr/local/www/nextcloud/3rdparty/guzzlehttp/guzzle/src/Client.php(168): GuzzleHttp\Client->transfer(Object(GuzzleHttp\Psr7\Request), Array)
#9 /usr/local/www/nextcloud/3rdparty/guzzlehttp/guzzle/src/Client.php(187): GuzzleHttp\Client->requestAsync('get', Object(GuzzleHttp\Psr7\Uri), Array)
#10 /usr/local/www/nextcloud/lib/private/Http/Client/Client.php(223): GuzzleHttp\Client->request('get', 'https://apps.ne...', Array)
#11 /usr/local/www/nextcloud/lib/private/App/AppStore/Fetcher/Fetcher.php(108): OC\Http\Client\Client->get('https://apps.ne...', Array)
#12 /usr/local/www/nextcloud/lib/private/App/AppStore/Fetcher/AppFetcher.php(79): OC\App\AppStore\Fetcher\Fetcher->fetch('', '')
#13 /usr/local/www/nextcloud/lib/private/App/AppStore/Fetcher/Fetcher.php(180): OC\App\AppStore\Fetcher\AppFetcher->fetch('', '', false)
#14 /usr/local/www/nextcloud/lib/private/Installer.php(434): OC\App\AppStore\Fetcher\Fetcher->get(false)
#15 /usr/local/www/nextcloud/lib/private/Updater.php(420): OC\Installer->isUpdateAvailable('accessibility')
#16 /usr/local/www/nextcloud/lib/private/Updater.php(268): OC\Updater->upgradeAppStoreApps(Array)
#17 /usr/local/www/nextcloud/lib/private/Updater.php(130): OC\Updater->doUpgrade('22.0.0.11', '21.0.2.1')
#18 /usr/local/www/nextcloud/core/Command/Upgrade.php(241): OC\Updater->upgrade()
#19 /usr/local/www/nextcloud/3rdparty/symfony/console/Command/Command.php(255): OC\Core\Command\Upgrade->execute(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#20 /usr/local/www/nextcloud/3rdparty/symfony/console/Application.php(1009): Symfony\Component\Console\Command\Command->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#21 /usr/local/www/nextcloud/3rdparty/symfony/console/Application.php(273): Symfony\Component\Console\Application->doRunCommand(Object(OC\Core\Command\Upgrade), Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#22 /usr/local/www/nextcloud/3rdparty/symfony/console/Application.php(149): Symfony\Component\Console\Application->doRun(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#23 /usr/local/www/nextcloud/lib/private/Console/Application.php(209): Symfony\Component\Console\Application->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#24 /usr/local/www/nextcloud/console.php(99): OC\Console\Application->run()
#25 /usr/local/www/nextcloud/occ(11): require_once('/usr/local/www/...')
#26 {main}

Server configuration

Operating system: FreeBSD 12.2

Web server: nginx

Database: postgreSQL

PHP version: 8.0.8

Nextcloud version: (see Nextcloud admin page) 21.0.2 -> 22.0.0

Updated from an older Nextcloud/ownCloud or fresh install: Upgrade

Where did you install Nextcloud from: FreeBSD pkg repositories

Signing status: Instance is down

Signing status ``` Login as admin user into your Nextcloud and access http://example.com/index.php/settings/integrity/failed paste the results here. ```

List of activated apps:

App list ``` If you have access to your command line run e.g.: sudo -u www-data php occ app:list from within your Nextcloud installation folder ``` From NC 21, before the upgrade. Enabled: - accessibility: 1.7.0 - activity: 2.14.3 - cloud_federation_api: 1.4.0 - comments: 1.11.0 - contactsinteraction: 1.2.0 - cospend: 1.3.4 - dashboard: 7.1.0 - dav: 1.17.1 - federatedfilesharing: 1.11.0 - federation: 1.11.0 - files: 1.16.0 - files_pdfviewer: 2.1.0 - files_rightclick: 1.0.0 - files_sharing: 1.13.1 - files_trashbin: 1.11.0 - files_versions: 1.14.0 - files_videoplayer: 1.10.0 - firstrunwizard: 2.10.0 - logreader: 2.6.0 - lookup_server_connector: 1.9.0 - music: 1.2.0 - nextcloud_announcements: 1.10.0 - notifications: 2.9.0 - oauth2: 1.9.0 - password_policy: 1.11.0 - photos: 1.3.0 - previewgenerator: 3.1.1 - privacy: 1.5.0 - provisioning_api: 1.11.0 - recommendations: 1.0.0 - serverinfo: 1.11.0 - settings: 1.3.0 - sharebymail: 1.11.0 - support: 1.4.0 - survey_client: 1.9.0 - systemtags: 1.11.0 - text: 3.2.0 - theming: 1.12.0 - twofactor_backupcodes: 1.10.0 - twofactor_totp: 6.0.0 - updatenotification: 1.11.0 - user_status: 1.1.1 - viewer: 1.5.0 - weather_status: 1.1.0 - workflowengine: 2.3.0 Disabled: - admin_audit - encryption - files_external - ocdownloader - user_ldap

Nextcloud configuration:

Config report ``` If you have access to your command line run e.g.: sudo -u www-data php occ config:list system from within your Nextcloud installation folder or Insert your config.php content here. Make sure to remove all sensitive content such as passwords. (e.g. database password, passwordsalt, secret, smtp password, …) ```

Are you using external storage, if yes which one: No

Are you using encryption: no

Are you using an external user-backend, if yes which one: No

Client configuration

Browser: N/A

Operating system: N/A

Logs

Web server error log

Web server error log ``` Insert your webserver log here ```

Nextcloud log (data/nextcloud.log)

Nextcloud log ``` Insert your Nextcloud log here ```

Browser log

Browser log ``` Insert your browser log here, this could for example include: a) The javascript console log b) The network log c) ... ```
z0ow commented 3 years ago

same issue here 👍

I am using a proxy (configuring the 'proxy' parameter in config.php) because most GitHub pages are banned or slowly connecting. I am facing the app install/upgrade problem as @moviuro reported and always got the identical exception. In my situation, it is hard to identify whether the proxy affects the Http/Client/* modules, but as contrasted with the elder installation (NC21.0.3) does not have any problem working with proxy.

wish a hotfix or solution can solve this problem as soon as possible 🙏

solracsf commented 3 years ago

This seems a duplicate of https://github.com/nextcloud/server/issues/27870 please check as there is already a fix for it.

moviuro commented 3 years ago

@acsfer itt was indeed a duplicate, and the proposed fix did work!