Guzzle in Nextcloud: Disable compression (was: Why do I not see (have the ability to install) apps?)

Support intro

Nextcloud version (eg, 20.0.5): Nextcloud 25.0.2
Operating system and version (eg, Ubuntu 20.04): OpenWrt 22.03
Apache or nginx version (eg, Apache 2.4.25): Caddy 2.6.2
PHP version (eg, 7.4): 8.1 (FPM, ZTS)

The issue you are facing:

I successfuly installed NextCloud on my OpenWrt device - on a FriendlyElec NanoPi R6s, which is a 4+4 core ARM board with integrated graphics; it’s pretty beefy. I installed NextCloud with MariaDB (15.1) and run it behind Caddy + PHP-FPM. It works, really well in fact, with no issues left in the dashboard. However, I can not seem to be able to use the search bar to find any of the apps - like Deck - to install them to my instance. And I would like to know why that is. :slight_smile:

Is this the first time you’ve seen this error? (Y/N): No. Then again, my previous instances used Docker Compose.

Steps to replicate it:

  1. Install NextCloud
  2. Make sure all checks pass in Admin dashboard
  3. Go to Profile Icon → Apps and only observe the preinstalled apps.
  4. Use the search icon and type any of the known app names only to see that nothing was found.

The output of your Nextcloud log in Admin > Logging:

{"reqId":"EWfeiPfczTrwqcgIlRvG","level":3,"time":"2022-12-17T05:09:51+00:00","remoteAddr":"192.168.2.146","user":"IngwiePhoenix","app":"internet_connection_check","method":"GET","url":"/index.php/settings/ajax/checksetup","message":"Cannot connect to: www.eff.org","userAgent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/107.0.0.0 Safari/537.36 OPR/93.0.0.0","version":"25.0.2.3","exception":{"Exception":"GuzzleHttp\\Exception\\RequestException","Message":"cURL error 61: Unrecognized content encoding type. libcurl understands identity content encodings. (see https://curl.haxx.se/libcurl/c/libcurl-errors.html) for https://www.eff.org/","Code":200,"Trace":[{"file":"/sdcard/srv/nextcloud/3rdparty/guzzlehttp/guzzle/src/Handler/CurlFactory.php","line":158,"function":"createRejection","class":"GuzzleHttp\\Handler\\CurlFactory","type":"::","args":[{"__class__":"GuzzleHttp\\Handler\\EasyHandle","sink":{"__class__":"GuzzleHttp\\Psr7\\Stream"},"headers":["HTTP/1.1 200 OK","Connection: keep-alive","Content-Length: 13102","Server: nginx","Content-Type: text/html; charset=utf-8","And 26 more entries, set log level to debug to see all entries"],"response":{"__class__":"GuzzleHttp\\Psr7\\Response"},"request":{"__class__":"GuzzleHttp\\Psr7\\Request"},"options":{"0":"And 7 more entries, set log level to debug to see all entries","verify":"/sdcard/srv/nextcloud/data/files_external/rootcerts.crt","timeout":30,"allow_redirects":{"0":"And 1 more entries, set log level to debug to see all entries","on_redirect":{"__class__":"Closure"},"max":5,"protocols":["http","https"],"strict":false,"referer":false},"nextcloud":{"allow_local_address":false},"synchronous":true},"errno":61,"onHeadersException":null,"createResponseException":null},[61,"Unrecognized content encoding type. libcurl understands identity content encodings.",0.121861,"https://www.eff.org/","text/html; charset=utf-8","And 36 more entries, set log level to debug to see all entries"]]},{"file":"/sdcard/srv/nextcloud/3rdparty/guzzlehttp/guzzle/src/Handler/CurlFactory.php","line":110,"function":"finishError","class":"GuzzleHttp\\Handler\\CurlFactory","type":"::","args":[{"__class__":"GuzzleHttp\\Handler\\CurlHandler"},{"__class__":"GuzzleHttp\\Handler\\EasyHandle","sink":{"__class__":"GuzzleHttp\\Psr7\\Stream"},"headers":["HTTP/1.1 200 OK","Connection: keep-alive","Content-Length: 13102","Server: nginx","Content-Type: text/html; charset=utf-8","And 26 more entries, set log level to debug to see all entries"],"response":{"__class__":"GuzzleHttp\\Psr7\\Response"},"request":{"__class__":"GuzzleHttp\\Psr7\\Request"},"options":{"0":"And 7 more entries, set log level to debug to see all entries","verify":"/sdcard/srv/nextcloud/data/files_external/rootcerts.crt","timeout":30,"allow_redirects":{"0":"And 1 more entries, set log level to debug to see all entries","on_redirect":{"__class__":"Closure"},"max":5,"protocols":["http","https"],"strict":false,"referer":false},"nextcloud":{"allow_local_address":false},"synchronous":true},"errno":61,"onHeadersException":null,"createResponseException":null},{"__class__":"GuzzleHttp\\Handler\\CurlFactory"}]},{"file":"/sdcard/srv/nextcloud/3rdparty/guzzlehttp/guzzle/src/Handler/CurlHandler.php","line":47,"function":"finish","class":"GuzzleHttp\\Handler\\CurlFactory","type":"::","args":[{"__class__":"GuzzleHttp\\Handler\\CurlHandler"},{"__class__":"GuzzleHttp\\Handler\\EasyHandle","sink":{"__class__":"GuzzleHttp\\Psr7\\Stream"},"headers":["HTTP/1.1 200 OK","Connection: keep-alive","Content-Length: 13102","Server: nginx","Content-Type: text/html; charset=utf-8","And 26 more entries, set log level to debug to see all entries"],"response":{"__class__":"GuzzleHttp\\Psr7\\Response"},"request":{"__class__":"GuzzleHttp\\Psr7\\Request"},"options":{"0":"And 7 more entries, set log level to debug to see all entries","verify":"/sdcard/srv/nextcloud/data/files_external/rootcerts.crt","timeout":30,"allow_redirects":{"0":"And 1 more entries, set log level to debug to see all entries","on_redirect":{"__class__":"Closure"},"max":5,"protocols":["http","https"],"strict":false,"referer":false},"nextcloud":{"allow_local_address":false},"synchronous":true},"errno":61,"onHeadersException":null,"createResponseException":null},{"__class__":"GuzzleHttp\\Handler\\CurlFactory"}]},{"file":"/sdcard/srv/nextcloud/lib/private/Http/Client/DnsPinMiddleware.php","line":146,"function":"__invoke","class":"GuzzleHttp\\Handler\\CurlHandler","type":"->","args":["*** sensitive parameters replaced ***","*** sensitive parameters replaced ***"]},{"file":"/sdcard/srv/nextcloud/3rdparty/guzzlehttp/guzzle/src/PrepareBodyMiddleware.php","line":35,"function":"OC\\Http\\Client\\{closure}","class":"OC\\Http\\Client\\DnsPinMiddleware","type":"->","args":["*** sensitive parameters replaced ***"]},{"file":"/sdcard/srv/nextcloud/3rdparty/guzzlehttp/guzzle/src/Middleware.php","line":31,"function":"__invoke","class":"GuzzleHttp\\PrepareBodyMiddleware","type":"->","args":["*** sensitive parameters replaced ***","*** sensitive parameters replaced ***"]},{"file":"/sdcard/srv/nextcloud/3rdparty/guzzlehttp/guzzle/src/RedirectMiddleware.php","line":71,"function":"GuzzleHttp\\{closure}","class":"GuzzleHttp\\Middleware","type":"::","args":["*** sensitive parameters replaced ***"]},{"file":"/sdcard/srv/nextcloud/3rdparty/guzzlehttp/guzzle/src/RedirectMiddleware.php","line":107,"function":"__invoke","class":"GuzzleHttp\\RedirectMiddleware","type":"->","args":["*** sensitive parameters replaced ***","*** sensitive parameters replaced ***"]},{"file":"/sdcard/srv/nextcloud/3rdparty/guzzlehttp/guzzle/src/RedirectMiddleware.php","line":73,"function":"checkRedirect","class":"GuzzleHttp\\RedirectMiddleware","type":"->","args":[{"__class__":"GuzzleHttp\\Psr7\\Request"},"*** sensitive parameters replaced ***","*** sensitive parameters replaced ***"]},{"file":"/sdcard/srv/nextcloud/3rdparty/guzzlehttp/promises/src/FulfilledPromise.php","line":41,"function":"GuzzleHttp\\{closure}","class":"GuzzleHttp\\RedirectMiddleware","type":"->","args":["*** sensitive parameters replaced ***"]},{"file":"/sdcard/srv/nextcloud/3rdparty/guzzlehttp/promises/src/TaskQueue.php","line":48,"function":"GuzzleHttp\\Promise\\{closure}","class":"GuzzleHttp\\Promise\\FulfilledPromise","type":"::","args":["*** sensitive parameters replaced ***"]},{"file":"/sdcard/srv/nextcloud/3rdparty/guzzlehttp/promises/src/Promise.php","line":248,"function":"run","class":"GuzzleHttp\\Promise\\TaskQueue","type":"->","args":[true]},{"file":"/sdcard/srv/nextcloud/3rdparty/guzzlehttp/promises/src/Promise.php","line":224,"function":"invokeWaitFn","class":"GuzzleHttp\\Promise\\Promise","type":"->","args":[]},{"file":"/sdcard/srv/nextcloud/3rdparty/guzzlehttp/promises/src/Promise.php","line":269,"function":"waitIfPending","class":"GuzzleHttp\\Promise\\Promise","type":"->","args":[]},{"file":"/sdcard/srv/nextcloud/3rdparty/guzzlehttp/promises/src/Promise.php","line":226,"function":"invokeWaitList","class":"GuzzleHttp\\Promise\\Promise","type":"->","args":[]},{"file":"/sdcard/srv/nextcloud/3rdparty/guzzlehttp/promises/src/Promise.php","line":62,"function":"waitIfPending","class":"GuzzleHttp\\Promise\\Promise","type":"->","args":[]},{"file":"/sdcard/srv/nextcloud/3rdparty/guzzlehttp/guzzle/src/Client.php","line":187,"function":"wait","class":"GuzzleHttp\\Promise\\Promise","type":"->","args":[]},{"file":"/sdcard/srv/nextcloud/lib/private/Http/Client/Client.php","line":218,"function":"request","class":"GuzzleHttp\\Client","type":"->","args":["get","http://www.eff.org/",["/sdcard/srv/nextcloud/data/files_external/rootcerts.crt",30,[{"__class__":"Closure"}],[false],["Nextcloud Server Crawler","gzip"],"And 1 more entries, set log level to debug to see all entries"]]},{"file":"/sdcard/srv/nextcloud/apps/settings/lib/Controller/CheckSetupController.php","line":211,"function":"get","class":"OC\\Http\\Client\\Client","type":"->","args":["http://www.eff.org/"]},{"file":"/sdcard/srv/nextcloud/apps/settings/lib/Controller/CheckSetupController.php","line":193,"function":"isSiteReachable","class":"OCA\\Settings\\Controller\\CheckSetupController","type":"->","args":["www.eff.org"]},{"file":"/sdcard/srv/nextcloud/apps/settings/lib/Controller/CheckSetupController.php","line":869,"function":"hasInternetConnectivityProblems","class":"OCA\\Settings\\Controller\\CheckSetupController","type":"->","args":[]},{"file":"/sdcard/srv/nextcloud/lib/private/AppFramework/Http/Dispatcher.php","line":225,"function":"check","class":"OCA\\Settings\\Controller\\CheckSetupController","type":"->","args":[]},{"file":"/sdcard/srv/nextcloud/lib/private/AppFramework/Http/Dispatcher.php","line":133,"function":"executeController","class":"OC\\AppFramework\\Http\\Dispatcher","type":"->","args":[{"__class__":"OCA\\Settings\\Controller\\CheckSetupController"},"check"]},{"file":"/sdcard/srv/nextcloud/lib/private/AppFramework/App.php","line":172,"function":"dispatch","class":"OC\\AppFramework\\Http\\Dispatcher","type":"->","args":[{"__class__":"OCA\\Settings\\Controller\\CheckSetupController"},"check"]},{"file":"/sdcard/srv/nextcloud/lib/private/Route/Router.php","line":298,"function":"main","class":"OC\\AppFramework\\App","type":"::","args":["OCA\\Settings\\Controller\\CheckSetupController","check",{"__class__":"OC\\AppFramework\\DependencyInjection\\DIContainer"},["settings.CheckSetup.check"]]},{"file":"/sdcard/srv/nextcloud/lib/base.php","line":1047,"function":"match","class":"OC\\Route\\Router","type":"->","args":["/settings/ajax/checksetup"]},{"file":"/sdcard/srv/nextcloud/index.php","line":36,"function":"handleRequest","class":"OC","type":"::","args":[]}],"File":"/sdcard/srv/nextcloud/3rdparty/guzzlehttp/guzzle/src/Handler/CurlFactory.php","Line":211,"message":"Cannot connect to: www.eff.org","exception":[],"CustomMessage":"Cannot connect to: www.eff.org"},"id":"639d4f490d968"}

There are a few more like this, including nextcloud.com et cetera.

The output of your config.php file in /path/to/nextcloud (make sure you remove any identifiable information!):

<?php
$CONFIG = array (
  'passwordsalt' => '...',
  'secret' => '...',
  'memcache.distributed' => '\OC\Memcache\Redis',
  'memcache.locking' => '\OC\Memcache\Redis',
  'redis' => [
     'host' => 'localhost',
     'port' => 6379,
  ],
  'trusted_domains' =>
  array (
    0 => 'localhost',
    1 => '...'
  ),
  'trusted_proxies' =>
  array(
    0 => '192.168.2.1'
  ),
  'default_phone_region' => 'DE',
  'datadirectory' => '/sdcard/srv/nextcloud/data',
  'dbtype' => 'mysql',
  'version' => '25.0.2.3',
  'overwrite.cli.url' => '...',
  'dbname' => 'nextcloud',
  'dbhost' => 'localhost',
  'dbport' => '',
  'dbtableprefix' => 'oc_',
  'mysql.utf8mb4' => true,
  'dbuser' => '...',
  'dbpassword' => '...',
  'installed' => true,
  'instanceid' => '...',
  'enabledPreviewProviders' => [
    'OC\Preview\MP3',
    'OC\Preview\TXT',
    'OC\Preview\MarkDown',
    'OC\Preview\OpenDocument',
    'OC\Preview\Krita'
  ]
);

The output of your Apache/nginx/system log in /var/log/____:

No errors here.

Output errors in nextcloud.log in /var/www/ or as admin user in top right menu, filtering for errors. Use a pastebin service if necessary.

Posted above.

Edit:

After a lot of back and forth with documentations of cURL, Guzzle and trial-and-error, I eventually figured out the problem, which creates a new one:

# curl --compressed --head "https://apps.nextcloud.com/api/v1/apps.json"
curl: option --compressed: the installed libcurl version doesn't support this
curl: try 'curl --help' for more information

The cURL on my server does not support compression - which quite likely trips Guzzle, which tries to make a compressed request. Thus, the content encoding is bound to be wrong.

How can I force Guzzle into not doing that? Thanks!