Downloading apps fail in Dockerized Nextcloud: cURL error 28: Operation timed out

Support intro

Sorry to hear you’re facing problems :slightly_frowning_face:

help.nextcloud.com is for home/non-enterprise users. If you’re running a business, paid support can be accessed via portal.nextcloud.com where we can ensure your business keeps running smoothly.

In order to help you as quickly as possible, before clicking Create Topic please provide as much of the below as you can. Feel free to use a pastebin service for logs, otherwise either indent short log examples with four spaces:

example

Or for longer, use three backticks above and below the code snippet:

longer
example
here

Some or all of the below information will be requested if it isn’t supplied; for fastest response please provide as much as you can :heart:

Nextcloud version (eg, 20.0.5): 24.0.6
Operating system and version (eg, Ubuntu 20.04): Docker on Debian 10
Apache/PHP version are whatever the Docker container uses.

The issue you are facing:

Is this the first time you’ve seen this error? (Y/N): No, I’ve been having this problem for like a year and I’m finally deciding to fix it.

Steps to replicate it:

  1. Navigate to Calendar app in apps area
  2. Wait a really long time
  3. Error appears: cURL error 28: Operation timed out after 120001 milliseconds with 0 out of 0 bytes received (see https://curl.haxx.se/libcurl/c/libcurl-errors.html) for https://objects.githubusercontent.com/github-production-release-asset-2e65be/377456681/9222a9ef-76dc-449c-b5b5-914f0ef6e018?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIAIWNJYAX4CSVEH53A%2F20221017%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20221017T225900Z&X-Amz-Expires=300&X-Amz-Signature=12df1e6bd1742be6cb983a8497b2f39a789976d230ee2bda7e6676d911737f7a&X-Amz-SignedHeaders=host&actor_id=0&key_id=0&repo_id=377456681&response-content-disposition=attachment%3B%20filename%3Dcalendar-v3.5.0.tar.gz&response-content-type=application%2Foctet-stream

The output of your Nextcloud log in Admin > Logging:

GuzzleHttp\Exception\ConnectException: cURL error 28: Operation timed out after 120001 milliseconds with 0 out of 0 bytes received (see https://curl.haxx.se/libcurl/c/libcurl-errors.html) for https://objects.githubusercontent.com/github-production-release-asset-2e65be/377456681/9222a9ef-76dc-449c-b5b5-914f0ef6e018?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIAIWNJYAX4CSVEH53A%2F20221017%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20221017T225900Z&X-Amz-Expires=300&X-Amz-Signature=12df1e6bd1742be6cb983a8497b2f39a789976d230ee2bda7e6676d911737f7a&X-Amz-SignedHeaders=host&actor_id=0&key_id=0&repo_id=377456681&response-content-disposition=attachment%3B%20filename%3Dcalendar-v3.5.0.tar.gz&response-content-type=application%2Foctet-stream

    /var/www/html/3rdparty/guzzlehttp/guzzle/src/Handler/CurlFactory.php - line 158:

    GuzzleHttp\Handler\CurlFactory::createRejection(GuzzleHttp\H ... l}, [ 28,"Operat ... "])

    /var/www/html/3rdparty/guzzlehttp/guzzle/src/Handler/CurlFactory.php - line 110:

    GuzzleHttp\Handler\CurlFactory::finishError(GuzzleHttp\H ... {}, GuzzleHttp\H ... l}, GuzzleHttp\H ... {})

    /var/www/html/3rdparty/guzzlehttp/guzzle/src/Handler/CurlHandler.php - line 47:

    GuzzleHttp\Handler\CurlFactory::finish(GuzzleHttp\H ... {}, GuzzleHttp\H ... l}, GuzzleHttp\H ... {})

    /var/www/html/lib/private/Http/Client/DnsPinMiddleware.php - line 146:

    GuzzleHttp\Handler\CurlHandler->__invoke("*** sensiti ... *", "*** sensiti ... *")

    /var/www/html/3rdparty/guzzlehttp/guzzle/src/PrepareBodyMiddleware.php - line 35:

    OC\Http\Client\DnsPinMiddleware->OC\Http\Client\{closure}("*** sensiti ... *")

    /var/www/html/3rdparty/guzzlehttp/guzzle/src/Middleware.php - line 31:

    GuzzleHttp\PrepareBodyMiddleware->__invoke("*** sensiti ... *", "*** sensiti ... *")

    /var/www/html/3rdparty/guzzlehttp/guzzle/src/RedirectMiddleware.php - line 71:

    GuzzleHttp\Middleware::GuzzleHttp\{closure}("*** sensiti ... *")

    /var/www/html/3rdparty/guzzlehttp/guzzle/src/RedirectMiddleware.php - line 107:

    GuzzleHttp\RedirectMiddleware->__invoke("*** sensiti ... *", "*** sensiti ... *")

    /var/www/html/3rdparty/guzzlehttp/guzzle/src/RedirectMiddleware.php - line 73:

    GuzzleHttp\RedirectMiddleware->checkRedirect(GuzzleHttp\Psr7\Request {}, "*** sensiti ... *", "*** sensiti ... *")

    /var/www/html/3rdparty/guzzlehttp/promises/src/FulfilledPromise.php - line 41:

    GuzzleHttp\RedirectMiddleware->GuzzleHttp\{closure}("*** sensiti ... *")

    /var/www/html/3rdparty/guzzlehttp/promises/src/TaskQueue.php - line 48:

    GuzzleHttp\Promise\FulfilledPromise::GuzzleHttp\Promise\{closure}("*** sensiti ... *")

    /var/www/html/3rdparty/guzzlehttp/promises/src/Promise.php - line 248:

    GuzzleHttp\Promise\TaskQueue->run(true)

    /var/www/html/3rdparty/guzzlehttp/promises/src/Promise.php - line 224:

    GuzzleHttp\Promise\Promise->invokeWaitFn()

    /var/www/html/3rdparty/guzzlehttp/promises/src/Promise.php - line 269:

    GuzzleHttp\Promise\Promise->waitIfPending()

    /var/www/html/3rdparty/guzzlehttp/promises/src/Promise.php - line 226:

    GuzzleHttp\Promise\Promise->invokeWaitList()

    /var/www/html/3rdparty/guzzlehttp/promises/src/Promise.php - line 62:

    GuzzleHttp\Promise\Promise->waitIfPending()

    /var/www/html/3rdparty/guzzlehttp/guzzle/src/Client.php - line 187:

    GuzzleHttp\Promise\Promise->wait()

    /var/www/html/lib/private/Http/Client/Client.php - line 218:

    GuzzleHttp\Client->request("get", "https://git ... z", [ "/var/www/ ... "])

    /var/www/html/lib/private/Installer.php - line 296:

    OC\Http\Client\Client->get("https://git ... z", [ "/tmp/oc_t ... 0])

    /var/www/html/apps/settings/lib/Controller/AppSettingsController.php - line 448:

    OC\Installer->downloadApp("calendar")

    /var/www/html/lib/private/AppFramework/Http/Dispatcher.php - line 225:

    OCA\Settings\Controller\AppSettingsController->enableApps([ "calendar"], [])

    /var/www/html/lib/private/AppFramework/Http/Dispatcher.php - line 133:

    OC\AppFramework\Http\Dispatcher->executeController(OCA\Settings ... {}, "enableApps")

    /var/www/html/lib/private/AppFramework/App.php - line 172:

    OC\AppFramework\Http\Dispatcher->dispatch(OCA\Settings ... {}, "enableApps")

    /var/www/html/lib/private/Route/Router.php - line 298:

    OC\AppFramework\App::main("OCA\\Settin ... r", "enableApps", OC\AppFramew ... {}, [ "settings. ... "])

    /var/www/html/lib/base.php - line 1030:

    OC\Route\Router->match("/settings/apps/enable")

    /var/www/html/index.php - line 36:

    OC::handleRequest()

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

<?php
$CONFIG = array (
  'instanceid' => 'REDACTED',
  'passwordsalt' => 'REDACTED+',
  'secret' => 'REDACTED',
  'trusted_domains' =>
  array (
    0 => 'REDACTED',
  ),
  'trusted_proxies' =>
  array (
    0 => 'REDACTED',
  ),
  'datadirectory' => '/var/www/html/data',
  'dbtype' => 'mysql',
  'version' => '24.0.6.1',
  'overwrite.cli.url' => 'REDACTED',
  'overwriteprotocol' => 'https',
  'dbname' => 'next',
  'dbhost' => 'mariadb',
  'dbport' => '',
  'dbtableprefix' => 'oc_',
  'mysql.utf8mb4' => true,
  'dbuser' => 'REDACTED',
  'dbpassword' => 'REDACTED',
  'installed' => true,
  'mail_smtpmode' => 'smtp',
  'mail_sendmailmode' => 'smtp',
  'mail_from_address' => 'noreply',
  'mail_domain' => 'REDACTED',
  'redis' =>
  array (
    'host' => 'redis',
    'port' => 6379,
  ),
  'memcache.local' => '\\OC\\Memcache\\APCu',
  'filelocking.enabled' => true,
  'memcache.locking' => '\\OC\\Memcache\\Redis',
  'maintenance' => false,
  'theme' => '',
  'loglevel' => 2,
  'default_phone_region' => 'US',
);

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

There are no relevant web server logs.

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.

https://pastie.io/fkhkiv.json

Other details:

I’ve had this problem for ages, and search results only contain solutions like this, which does not work: Downloading certain Apps not working

Increasing the timeout only makes this take longer to fail. I can curl other things from inside the container. Curling the githubusercontent URL from outside the container intermittently returns an empty response. I’ve curled this URL from multiple other networks and see this same problem where the response is empty. I’m wondering if I have an old/bad URL saved somewhere that needed to get changed during an upgrade, but for some reason did not get updated.

I would think the problem lies with your actual system or networking setup. Have you considered migrating to Debian 11 Bullseye and making sure your system is up-to-date?

You could also share the docker run or compose file you used to set it up.

I found the solution. For reasons I won’t get into, I had to decrease the MTU on this machine’s primary network interface to 1400. This morning I remembered that I did this, and decided to try setting Docker’s MTU to the same. In docker-compose, I created a network:

networks:
  cherry:
    driver: bridge
    driver_opts:
      com.docker.network.driver.mtu: 1400
    ipam:
      driver: default
      config:
        - subnet: 172.19.4.0/24
          gateway: 172.19.4.1

I assigned all my containers to this network. Nextcloud apps now download, and other network-related problems I’ve been having were solved as well.

2 Likes