Apps do not update with GuzzleHttp exception (cURL error 49)

Nextcloud version: Nextcloud Hub 3 (25.0.3)
Operating system and version: Ubuntu 22.04.2 LTS
Apache or nginx version: Apache/2.4.52 (Ubuntu)
PHP version : 8.1.2-1ubuntu2.10

I cannot update any apps. All apps produce the same error. Nextcloud log reports errors like this:

GuzzleHttp\Exception\RequestException: cURL error 49: Couldn't parse CURLOPT_RESOLVE entry 'github.com:80:'! (see https://curl.haxx.se/libcurl/c/libcurl-errors.html) for https://github.com/nextcloud-releases/mail/releases/download/v2.2.3/mail-v2.2.3.tar.gz

Any ideas how I can start debugging this?

I note that the CURLOPT_RESOLVE entry is using port 80, while the github file is being access using HTTPS.

I can download the tar.gz manually using a web browser.

I can download the tar.gz manually using cURL (with “-L” to follow the redirection):

mike@server:~$ curl -L -o temp.zip https://github.com/nextcloud-releases/mail/releases/download/v2.2.3/mail-v2.2.3.tar
.gz
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
  0     0    0     0    0     0      0      0 --:--:--  0:00:02 --:--:--     0
100 21.1M  100 21.1M    0     0  1486k      0  0:00:14  0:00:14 --:--:-- 2951k

Is this the first time you’ve seen this error? Yes

Steps to replicate it:

  1. go to “Apps” page on web interface of local nextcloud installation
  2. there is an update for “Mail”. I click on “Update to 2.2.3” button.
  3. update fails with error msg: “An error occurred during the request. Unable to proceed.
    Could not update app”.
  4. I restarted apache. Error still occurs.
  5. I reboot server. Error still occurs.

The output of your Nextcloud log in Admin > Logging:

[no app in context] Error: GuzzleHttp\Exception\RequestException: cURL error 49: Couldn't parse CURLOPT_RESOLVE entry 'github.com:80:'! (see https://curl.haxx.se/libcurl/c/libcurl-errors.html) for https://github.com/nextcloud-releases/mail/releases/download/v2.2.3/mail-v2.2.3.tar.gz at <<closure>>

 0. /var/www/nextcloud/3rdparty/guzzlehttp/guzzle/src/Handler/CurlFactory.php line 158
    GuzzleHttp\Handler\CurlFactory::createRejection()
 1. /var/www/nextcloud/3rdparty/guzzlehttp/guzzle/src/Handler/CurlFactory.php line 110
    GuzzleHttp\Handler\CurlFactory::finishError()
 2. /var/www/nextcloud/3rdparty/guzzlehttp/guzzle/src/Handler/CurlHandler.php line 47
    GuzzleHttp\Handler\CurlFactory::finish()
 3. /var/www/nextcloud/lib/private/Http/Client/DnsPinMiddleware.php line 146
    GuzzleHttp\Handler\CurlHandler->__invoke()
 4. /var/www/nextcloud/3rdparty/guzzlehttp/guzzle/src/PrepareBodyMiddleware.php line 35
    OC\Http\Client\DnsPinMiddleware->OC\Http\Client\{closure}("*** sensitive parameters replaced ***")
 5. /var/www/nextcloud/3rdparty/guzzlehttp/guzzle/src/Middleware.php line 31
    GuzzleHttp\PrepareBodyMiddleware->__invoke()
 6. /var/www/nextcloud/3rdparty/guzzlehttp/guzzle/src/RedirectMiddleware.php line 71
    GuzzleHttp\Middleware::GuzzleHttp\{closure}("*** sensitive parameters replaced ***")
 7. /var/www/nextcloud/3rdparty/guzzlehttp/guzzle/src/Middleware.php line 63
    GuzzleHttp\RedirectMiddleware->__invoke()
 8. /var/www/nextcloud/3rdparty/guzzlehttp/guzzle/src/HandlerStack.php line 75
    GuzzleHttp\Middleware::GuzzleHttp\{closure}("*** sensitive parameters replaced ***")
 9. /var/www/nextcloud/3rdparty/guzzlehttp/guzzle/src/Client.php line 331
    GuzzleHttp\HandlerStack->__invoke()
10. /var/www/nextcloud/3rdparty/guzzlehttp/guzzle/src/Client.php line 168
    GuzzleHttp\Client->transfer()
11. /var/www/nextcloud/3rdparty/guzzlehttp/guzzle/src/Client.php line 187
    GuzzleHttp\Client->requestAsync()
12. /var/www/nextcloud/lib/private/Http/Client/Client.php line 218
    GuzzleHttp\Client->request()
13. /var/www/nextcloud/lib/private/Installer.php line 295
    OC\Http\Client\Client->get()
14. /var/www/nextcloud/lib/private/Installer.php line 193
    OC\Installer->downloadApp()
15. /var/www/nextcloud/apps/settings/lib/Controller/AppSettingsController.php line 535
    OC\Installer->updateAppstoreApp("*** sensitive parameters replaced ***")
16. /var/www/nextcloud/lib/private/AppFramework/Http/Dispatcher.php line 225
    OCA\Settings\Controller\AppSettingsController->updateApp("*** sensitive parameters replaced ***")
17. /var/www/nextcloud/lib/private/AppFramework/Http/Dispatcher.php line 133
    OC\AppFramework\Http\Dispatcher->executeController()
18. /var/www/nextcloud/lib/private/AppFramework/App.php line 172
    OC\AppFramework\Http\Dispatcher->dispatch()
19. /var/www/nextcloud/lib/private/Route/Router.php line 298
    OC\AppFramework\App::main()
20. /var/www/nextcloud/lib/base.php line 1047
    OC\Route\Router->match()
21. /var/www/nextcloud/index.php line 36
    OC::handleRequest()

GET /index.php/settings/apps/update/mail
from 192.168.0.1 by mike at 2023-02-23T17:12:30+11:00

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

<?php
$CONFIG = array (
  'instanceid' => 
  'passwordsalt' => ,
  'secret' => ,
  'trusted_domains' =>
  array (
    0 => 'localhost',
    1 => '[server LAN ip]',
    2 => '[cloud.my.domain]',
  ),
  'datadirectory' => '/var/www/nextcloud/data',
  'default_phone_region' => 'AU',
  'dbtype' => 'mysql',
  'version' => '25.0.3.2',
  'overwrite.cli.url' => 'http://[server LAN ip]',
  'dbname' => 'nextcloud',
  'dbhost' => 'localhost',
  'dbport' => '',
  'dbtableprefix' => 'oc_',
  'mysql.utf8mb4' => true,
  'dbuser' => 'nextcloud',
  'dbpassword' => ,
  'installed' => true,
  'filelocking.enabled' => true,
  'memcache.local' => '\\OC\\Memcache\\Redis',
  'memcache.locking' => '\\OC\\Memcache\\Redis',
  'redis' =>
  array (
    'host' => '127.0.0.1',
    'port' => 6379,
  ),
  'maintenance' => false,
  'loglevel' => '2',
  'logtimezone' => 'Australia/Sydney',
  'mail_smtpmode' => 'smtp',
  'mail_smtpsecure' => 'ssl',
  'mail_sendmailmode' => 'smtp',
  'mail_from_address' => 'cloud.admin',
  'mail_domain' => '[my.domain]',
  'mail_smtpauthtype' => 'PLAIN',
  'mail_smtphost' => '[mail.my.domain]',
  'mail_smtpport' => '465',
  'mail_smtpauth' => 1,
  'mail_smtpname' => '',
  'mail_smtppassword' => '',
  'theme' => '',
);

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

No errors appear in /var/log/syslog, /var/log/named/* or /var/log/apache2/*.log while or after update fails.

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.

{"reqId":"4PVQYtPCqb6MSYwU6tI4","level":3,"time":"2023-02-23T17:44:00+11:00","remoteAddr":"192.168.0.1","user":"mike","app":"no app in context","method":"GET","url":"/index.php/settings/apps/update/mail","message":"cURL error 49: Couldn't parse CURLOPT_RESOLVE entry 'github.com:80:'! (see https://curl.haxx.se/libcurl/c/libcurl-errors.html) for https://github.com/nextcloud-releases/mail/releases/download/v2.2.3/mail-v2.2.3.tar.gz","userAgent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/110.0.0.0 Safari/537.36","version":"25.0.3.2","exception":{"Exception":"GuzzleHttp\\Exception\\RequestException","Message":"cURL error 49: Couldn't parse CURLOPT_RESOLVE entry 'github.com:80:'! (see https://curl.haxx.se/libcurl/c/libcurl-errors.html) for https://github.com/nextcloud-releases/mail/releases/download/v2.2.3/mail-v2.2.3.tar.gz","Code":0,"Trace":[{"file":"/var/www/nextcloud/3rdparty/guzzlehttp/guzzle/src/Handler/CurlFactory.php","line":158,"function":"createRejection","class":"GuzzleHttp\\Handler\\CurlFactory","type":"::"},{"file":"/var/www/nextcloud/3rdparty/guzzlehttp/guzzle/src/Handler/CurlFactory.php","line":110,"function":"finishError","class":"GuzzleHttp\\Handler\\CurlFactory","type":"::"},{"file":"/var/www/nextcloud/3rdparty/guzzlehttp/guzzle/src/Handler/CurlHandler.php","line":47,"function":"finish","class":"GuzzleHttp\\Handler\\CurlFactory","type":"::"},{"file":"/var/www/nextcloud/lib/private/Http/Client/DnsPinMiddleware.php","line":146,"function":"__invoke","class":"GuzzleHttp\\Handler\\CurlHandler","type":"->"},{"file":"/var/www/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":"/var/www/nextcloud/3rdparty/guzzlehttp/guzzle/src/Middleware.php","line":31,"function":"__invoke","class":"GuzzleHttp\\PrepareBodyMiddleware","type":"->"},{"file":"/var/www/nextcloud/3rdparty/guzzlehttp/guzzle/src/RedirectMiddleware.php","line":71,"function":"GuzzleHttp\\{closure}","class":"GuzzleHttp\\Middleware","type":"::","args":["*** sensitive parameters replaced ***"]},{"file":"/var/www/nextcloud/3rdparty/guzzlehttp/guzzle/src/Middleware.php","line":63,"function":"__invoke","class":"GuzzleHttp\\RedirectMiddleware","type":"->"},{"file":"/var/www/nextcloud/3rdparty/guzzlehttp/guzzle/src/HandlerStack.php","line":75,"function":"GuzzleHttp\\{closure}","class":"GuzzleHttp\\Middleware","type":"::","args":["*** sensitive parameters replaced ***"]},{"file":"/var/www/nextcloud/3rdparty/guzzlehttp/guzzle/src/Client.php","line":331,"function":"__invoke","class":"GuzzleHttp\\HandlerStack","type":"->"},{"file":"/var/www/nextcloud/3rdparty/guzzlehttp/guzzle/src/Client.php","line":168,"function":"transfer","class":"GuzzleHttp\\Client","type":"->"},{"file":"/var/www/nextcloud/3rdparty/guzzlehttp/guzzle/src/Client.php","line":187,"function":"requestAsync","class":"GuzzleHttp\\Client","type":"->"},{"file":"/var/www/nextcloud/lib/private/Http/Client/Client.php","line":218,"function":"request","class":"GuzzleHttp\\Client","type":"->"},{"file":"/var/www/nextcloud/lib/private/Installer.php","line":295,"function":"get","class":"OC\\Http\\Client\\Client","type":"->"},{"file":"/var/www/nextcloud/lib/private/Installer.php","line":193,"function":"downloadApp","class":"OC\\Installer","type":"->"},{"file":"/var/www/nextcloud/apps/settings/lib/Controller/AppSettingsController.php","line":535,"function":"updateAppstoreApp","class":"OC\\Installer","type":"->","args":["*** sensitive parameters replaced ***"]},{"file":"/var/www/nextcloud/lib/private/AppFramework/Http/Dispatcher.php","line":225,"function":"updateApp","class":"OCA\\Settings\\Controller\\AppSettingsController","type":"->","args":["*** sensitive parameters replaced ***"]},{"file":"/var/www/nextcloud/lib/private/AppFramework/Http/Dispatcher.php","line":133,"function":"executeController","class":"OC\\AppFramework\\Http\\Dispatcher","type":"->"},{"file":"/var/www/nextcloud/lib/private/AppFramework/App.php","line":172,"function":"dispatch","class":"OC\\AppFramework\\Http\\Dispatcher","type":"->"},{"file":"/var/www/nextcloud/lib/private/Route/Router.php","line":298,"function":"main","class":"OC\\AppFramework\\App","type":"::"},{"file":"/var/www/nextcloud/lib/base.php","line":1047,"function":"match","class":"OC\\Route\\Router","type":"->"},{"file":"/var/www/nextcloud/index.php","line":36,"function":"handleRequest","class":"OC","type":"::"}],"File":"/var/www/nextcloud/3rdparty/guzzlehttp/guzzle/src/Handler/CurlFactory.php","Line":211,"message":"cURL error 49: Couldn't parse CURLOPT_RESOLVE entry 'github.com:80:'! (see https://curl.haxx.se/libcurl/c/libcurl-errors.html) for https://github.com/nextcloud-releases/mail/releases/download/v2.2.3/mail-v2.2.3.tar.gz","exception":{},"CustomMessage":"cURL error 49: Couldn't parse CURLOPT_RESOLVE entry 'github.com:80:'! (see https://curl.haxx.se/libcurl/c/libcurl-errors.html) for https://github.com/nextcloud-releases/mail/releases/download/v2.2.3/mail-v2.2.3.tar.gz"}}