Downloading certain Apps not working

Hi, i’ve got a Nextcloud instance running on ubuntu.
This instance got migrated from CentOS, but I’ve already tried a new installation, the problem still persists.
The problem is, i’cant install certain apps out of the appstore. Some are downloadable, e.g. the W2G app, but others are failing with the error: “cURL error 28: Operation timed out after 30000 milliseconds with 1113682 out of 3112147 bytes received (see http://curl.haxx.se/libcurl/c/libcurl-errors.html)”, for example the deck app.

[/details]

Nextcloud version 17.0.0.9
Operating system and version Ubuntu 19.10
Apache or nginx version 2.4.41
PHP version 7.3

The issue you are facing:

Is this the first time you’ve seen this error? (Y/N):
Yes

Steps to replicate it:

  1. Try to install the Deck app

The output of your Nextcloud log in Admin > Logging:

[settings] Error: GuzzleHttp\Exception\ConnectException: cURL error 28: Operation timed out after 30000 milliseconds with 1026642 out of 3112147 bytes received (see http://curl.haxx.se/libcurl/c/libcurl-errors.html) at <>

  1. /var/www/nextcloud/3rdparty/guzzlehttp/guzzle/src/Handler/CurlFactory.php line 149
    GuzzleHttp\Handler\CurlFactory::createRejection(GuzzleHttp\Handl … l}, {errno: 28,error … 1})
    Dieser Text wird versteckt/var/www/nextcloud/3rdparty/guzzlehttp/guzzle/src/Handler/CurlFactory.php line 102
    GuzzleHttp\Handler\CurlFactory::finishError(GuzzleHttp\Handler\CurlHandler {}, GuzzleHttp\Handl … l}, GuzzleHttp\Handler\CurlFactory {})
  2. /var/www/nextcloud/3rdparty/guzzlehttp/guzzle/src/Handler/CurlHandler.php line 43
    GuzzleHttp\Handler\CurlFactory::finish(GuzzleHttp\Handler\CurlHandler {}, GuzzleHttp\Handl … l}, GuzzleHttp\Handler\CurlFactory {})
  3. /var/www/nextcloud/3rdparty/guzzlehttp/guzzle/src/Handler/Proxy.php line 28
    GuzzleHttp\Handler\CurlHandler->__invoke("*** sensitive parameter replaced ", " sensitive parameter replaced ***")
  4. /var/www/nextcloud/3rdparty/guzzlehttp/guzzle/src/Handler/Proxy.php line 51
    GuzzleHttp\Handler\Proxy::GuzzleHttp\Handler{closure}("*** sensitive parameters replaced ***")
  5. /var/www/nextcloud/3rdparty/guzzlehttp/guzzle/src/PrepareBodyMiddleware.php line 37
    GuzzleHttp\Handler\Proxy::GuzzleHttp\Handler{closure}("*** sensitive parameters replaced ***")
  6. /var/www/nextcloud/3rdparty/guzzlehttp/guzzle/src/Middleware.php line 30
    GuzzleHttp\PrepareBodyMiddleware->__invoke("*** sensitive parameter replaced ", " sensitive parameter replaced ***")
  7. /var/www/nextcloud/3rdparty/guzzlehttp/guzzle/src/RedirectMiddleware.php line 70
    GuzzleHttp\Middleware::GuzzleHttp{closure}("*** sensitive parameters replaced ***")
  8. /var/www/nextcloud/3rdparty/guzzlehttp/guzzle/src/RedirectMiddleware.php line 107
    GuzzleHttp\RedirectMiddleware->__invoke("*** sensitive parameter replaced ", " sensitive parameter replaced ***")
  9. /var/www/nextcloud/3rdparty/guzzlehttp/guzzle/src/RedirectMiddleware.php line 72
    GuzzleHttp\RedirectMiddleware->checkRedirect(GuzzleHttp\Psr7\Request {}, “*** sensitive parameter replaced ", " sensitive parameter replaced ***”)
  10. /var/www/nextcloud/3rdparty/guzzlehttp/promises/src/FulfilledPromise.php line 39
    GuzzleHttp\RedirectMiddleware->GuzzleHttp{closure}("*** sensitive parameters replaced ***")
  11. /var/www/nextcloud/3rdparty/guzzlehttp/promises/src/TaskQueue.php line 47
    GuzzleHttp\Promise\FulfilledPromise::GuzzleHttp\Promise{closure}("*** sensitive parameters replaced ***")
  12. /var/www/nextcloud/3rdparty/guzzlehttp/promises/src/Promise.php line 246
    GuzzleHttp\Promise\TaskQueue->run(true)
  13. /var/www/nextcloud/3rdparty/guzzlehttp/promises/src/Promise.php line 223
    GuzzleHttp\Promise\Promise->invokeWaitFn()
  14. /var/www/nextcloud/3rdparty/guzzlehttp/promises/src/Promise.php line 267
    GuzzleHttp\Promise\Promise->waitIfPending()
  15. /var/www/nextcloud/3rdparty/guzzlehttp/promises/src/Promise.php line 225
    GuzzleHttp\Promise\Promise->invokeWaitList()
  16. /var/www/nextcloud/3rdparty/guzzlehttp/promises/src/Promise.php line 62
    GuzzleHttp\Promise\Promise->waitIfPending()
  17. /var/www/nextcloud/3rdparty/guzzlehttp/guzzle/src/Client.php line 131
    GuzzleHttp\Promise\Promise->wait()
  18. /var/www/nextcloud/lib/private/Http/Client/Client.php line 144
    GuzzleHttp\Client->request(“get”, “https://github. … z”, {proxy: null,ver … e})
  19. /var/www/nextcloud/lib/private/Installer.php line 269
    OC\Http\Client\Client->get(“https://github. … z”, {save_to: "/mnt/ … "})
  20. /var/www/nextcloud/settings/Controller/AppSettingsController.php line 444
    OC\Installer->downloadApp(“deck”)
  21. /var/www/nextcloud/lib/private/AppFramework/Http/Dispatcher.php line 170
    OC\Settings\Controller\AppSettingsController->enableApps([“deck”], [])
  22. /var/www/nextcloud/lib/private/AppFramework/Http/Dispatcher.php line 99
    OC\AppFramework\Http\Dispatcher->executeController(OC\Settings\Cont … {}, “enableApps”)
  23. /var/www/nextcloud/lib/private/AppFramework/App.php line 126
    OC\AppFramework\Http\Dispatcher->dispatch(OC\Settings\Cont … {}, “enableApps”)
  24. /var/www/nextcloud/lib/private/AppFramework/Routing/RouteActionHandler.php line 47
    OC\AppFramework\App::main(“OC\Settings\C … r”, “enableApps”, OC\AppFramework\ … {}, {_route: "settin … "})
  25. <>
    OC\AppFramework\Routing\RouteActionHandler->__invoke({_route: "settin … "})
  26. /var/www/nextcloud/lib/private/Route/Router.php line 297
    undefinedundefinedcall_user_func(OC\AppFramework\ … {}, {_route: "settin … "})
  27. /var/www/nextcloud/lib/base.php line 1000
    OC\Route\Router->match("/settings/apps/enable")
  28. /var/www/nextcloud/index.php line 42
    OC::handleRequest()

POST /settings/apps/enable
from 217.236.117.163 by **** at 2019-10-23T20:10:14+00:00

The output of your config.php file

<?php $CONFIG = array ( 'passwordsalt' => '********', 'secret' => '********', 'trusted_domains' => array ( 0 => '*********', ), 'datadirectory' => '/mnt/cloudData/data', 'dbtype' => 'mysql', 'version' => '17.0.0.9', 'overwrite.cli.url' => 'http://localhost', 'dbname' => 'nextcloud', 'dbhost' => 'localhost', 'dbport' => '', 'dbtableprefix' => 'oc_', 'dbuser' => '*******', 'dbpassword' => '********', 'installed' => true, 'htaccess.RewriteBase' => '/', 'instanceid' => '*******', 'memcache.local' => '\\OC\\Memcache\\APCu', 'maintenance' => false, 'theme' => '', 'loglevel' => 2, 'memcache.distributed' => '\\OC\\Memcache\\Redis', 'redis' => array ( 'host' => '/var/run/redis/redis.sock', 'port' => 0, 'timeout' => 0, 'password' => '************************************* ), 'memcache.locking' => '\\OC\\Memcache\\Redis', 'updater.release.channel' => 'stable', 'twofactor_enforced' => 'true', 'twofactor_enforced_groups' => array ( ), ), 'twofactor_enforced_excluded_groups' => array ( 0 => '***********', ), 'trusted_proxies' => array ( 0 => '********', ), 'data-fingerprint' => '************', );

@padwa Hi Dwayne and welcome.

AFAIK this can happen irregularly due to apparent traffic overload of the Nextcloud Appstore or similar.

Give it some time and retry the download later. Unfortunately, the ‘curl’ tool involved cannot deduce much and nobody thought about how to reduce this kind of message with certain url by means of an optional filter to the NC Logging apparently.

Furthermore, you could try to download the resp. Apps from the Nextcloud Appstore by help of your browser as a workaround. It is quite easy to copy the packaged app archives into the nextcloud/apps folder if you have access to CLI and feel familiar with such effort.
:adult: :smiley:

Please keep in mind you can destroy things when on the CLI and acting unwisely.
:innocent:

Hi,

thanks for your fast answer, the problem persists since two or three weeks now, so this is unlikely.
Is there any way to set the timeout manually to a higher value?

You may take a look at: Add config option to change curl timeout #21821
However, this may not meet your needs in a timely fashion or be no solution at all to you , I presume


In the meantime you should just download the app package file by help of your internet browser as mentioned above, I propose. Furthermore, there is the ‘wget’ tool for CLI which could be of assistance to you in low bandwidth scenarios or after a download interrupt.

Docs » Apps management

Unpack the file in a local folder after the download succeeded. Put the resulting folder and all it’s contents just under nextcloud/apps by means of an applicable sudo -u www-data copy command on CLI by using the correct user name for your NC server install. Enable this App by help of the occ command on CLI (the preferred way for this kind of activities) or in the NC administration GUI as appropriate. Never make more than one sole folder as copy of this or similar NC App package in parallel folders with different names from same NC Apps (e.g., due to renaming for backup) in nextcloud/apps as this would bring quite a trouble.

Please think first, act second only and always have the protection of your data in mind. :innocent:


Generally speaking you could add a proxy cache to your local network or install such a thingie on your local computer. Routing any traffic through such self managed internet service could be quite helpful for downloads against regular interrupts or in lastingly bad network conditions.

@padwa Please accept my apologies if I cannot be of a greater assistance.

Any news?
:smile_cat:


Await a fix to heal the apparent core issue

see below:


Presumably outdated by the apparent fix:

There may be a solution available to overcome interrupted downloads like:

However, you should always prefer the most current PHP 7.3 official package for NC 15 & NC 16 & NC 17 installs instead of PHP 7.2 if feasible. Please be also aware of the correct paths to two different php.ini files. Always heed the PHP syntax in each of the php.ini config files, I presume.

This example is suitable for the Apache 2.x web server only.

Please consult the NC 16 Admin Docs » Nextcloud configuration for the admin tasks in general.

Point the plain text editor of your convenience at both /etc/php/7.3/apache2/php.ini and /etc/php/7.3/cli/php.ini to change the following:

  • setting the parametermax_execution_time to 3600 i.e. one hour

; Maximum execution time of each script, in seconds
; http://php.net/max-execution-time
; Note: This directive is hardcoded to 0 for the CLI SAPI
; default: max_execution_time = 30
max_execution_time = 3600

  • setting the parameter max_input_time to 3600 i.e. one hour

; Maximum amount of time each script may spend parsing request data. It's a good
; idea to limit this time on productions servers in order to eliminate unexpectedly
; long running scripts.
; Note: This directive is hardcoded to -1 for the CLI SAPI
; Default Value: -1 (Unlimited)
; Development Value: 60 (60 seconds)
; Production Value: 60 (60 seconds)
; http://php.net/max-input-time
; default: max_input_time = 60
max_input_time = 3600

However, please consider to use more conservative values (i.e. lower numbers) for avoiding unexpectedly long running scripts which could result in unwanted load to your server performance.

Hope this helps.
:smile:

Hallo,
I have the same problems with different Nextcloud (17.0) installations at different places. So I think it has nothing to do with the internet connection. Some apps I could update, but with some it is impossible (Bookmarks, Talk …).
I tried to find the file with the timeout-options but it does not exist (like in the owncloud link above).
What else could help to solve the problem?
Thank you!
Ruebezahl

The above example is suitable for NC 17 similarily.

Please consult the NC 17 Admin Docs » Nextcloud configuration for the admin tasks in general.

Hope this helps.
:smiley:

Hello,
same problem here on a fresh nextcloud 17.0 installation on raspbian with nginx and php 7.3.11.
Some small apps were downloaded and installed successfully, but larger app installations fail.
Changing max_execution_time or max_input_time in /etc/php/7.3/cli/php.ini or /etc/php/7.3/fpm/php.ini didn’t fix the problem.
I also tried searching the config files for nc and php but couldn’t find the right timeout anywere.
This https://stackoverflow.com/questions/21501159/curl-error-operation-timed-out may fix the issue, but I don’t know were the right place for this would be.

I would be very happy about some help on this, thanks.

1 Like

Did you restart the web service to make the changed parameters work accordingly?

I appreciate your approach to look for other solutions like CURL optimisations.


Furtherly:

Learning of your configuration I would like to point at two more articles:

(1) some advice on Apache versus NGINX install

(2) the availabilty of a pre-packaged NC for Rasp out-of-the box effort like NCP

Happy hacking.
:sunflower:

Sure, I restarted the web server, and since this did not fix the problem, rebooted the whole system.

Hi,

I’ve solved the Problem by manually Setting the Value for
"RequestOptions::TIMEOUT "
to 120 or a higher value in the following file:
“/path/to/nextcloud/lib/private/Http/Client/Client.php”
In this File, there’s a hard coded timeout for cURL, which is used for Appdownloads.
After this Change, everything is working.
This soloution is found here:

3 Likes

@padwa Good catch, I guess. :+1:

Hm, there was a commit establishing such value for the first time to the code just 2 months ago. Would fit with the observed download drop-outs, I presume.

:smile:


Please everybody note I took the liberty to just copy & paste from ‘@padwa’ - ‘Dwayne Parker’ - to produce the below issue report to nextcloud/server

Note: The here contribution was copied by @padwa from

Hope this helps.
:smile:


Some early birds and this report are comprised as:

Happy hacking.
:wave:

Hi,
I tried the solution from padwa but in this file was no entry with “… TIMEOUT”.
I found another solution that worked on two nextcloud server: the bookmarks-app was unable to update. So I deactivated it, deleted it and installed it new. This was working without errors. Than I tried to update Talk and the other apps that were impossible to update before: and it worked for all apps as fast as ever!
Maybe here was only the bookmarks app blocking the updates?

Depends on the NC version and this value was introduced to the code only recently.

Just to clarify this, this is not my solution, I found this solution in the following Github Issue:

1 Like

It works until next upgrade…

Ty,

It helped me install Document Server Community