Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make App Store timeouts longer or configurable #40082

Open
5 of 8 tasks
canoine opened this issue Aug 28, 2023 · 15 comments
Open
5 of 8 tasks

Make App Store timeouts longer or configurable #40082

canoine opened this issue Aug 28, 2023 · 15 comments

Comments

@canoine
Copy link

canoine commented Aug 28, 2023

⚠️ This issue respects the following points: ⚠️

Bug description

As my internet connection is a joke, most of the times, curl stops on error 28 :

Aug 28 17:57:11 xxx nextcloud[9192]: {"reqId":"ZOzDmyKEzRATGUE9FKaEWwAAAE8","level":2,"time":"2023-08-28T17:57:11+02:00","remoteAddr":"90.62.30.145","user":"admin","app":"appstoreFetcher","method":"GET","url":"/index.php/settings/apps","message":"Could not connect to appstore: cURL error 28: Operation timed out after 60000 milliseconds with 4722688 bytes received (see https://curl.haxx.se/libcurl/c/libcurl-errors.html) for https://apps.nextcloud.com/api/v1/apps.json","userAgent":"Mozilla/5.0 (X11; Linux x86_64; rv:109.0) Gecko/20100101 Firefox/116.0","version":"26.0.5.1","data":{"app":"appstoreFetcher"}}

or
Aug 28 18:32:06 xxx nextcloud[11122]: {"reqId":"ZOzLjSEcSVqe3qzIFqTXUwAAAAY","level":3,"time":"2023-08-28T18:32:06+02:00","remoteAddr":"90.62.30.145","user":"admin","app":"settings","method":"POST","url":"/index.php/settings/apps/enable","message":"{\"Exception\":\"GuzzleHttp\\\\Exception\\\\ConnectException\",\"Message\":\"cURL error 28: Operation timed out after 120000 milliseconds with 2322560 out of 5238706 bytes received (see https://curl.haxx.se/libcurl/c/libcurl-errors.html) for https://objects.githubusercontent.com/github-production-release-asset-2e65be/187186203/e96bc648-7e72-4612-90e0-3524b7ee8e12?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIAIWNJYAX4CSVEH53A%2F20230828%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20230828T162757Z&X-Amz-Expires=300&X-Amz-Signature=65d518673cf3a25d9191d0dfefd560962fd48e91b23acafaaf0807e5ac0a0d2c&X-Amz-SignedHeaders=host&actor_id=0&key_id=0&repo_id=187186203&response-content-disposition=attachment%3B%20filename%3DCookbook-0.10.2.tar.gz&response-content-type=application%2Foctet-stream\",\"Code\":0,\"Trace\":[{\"file\":\"/var/www/localhost/htdocs/nextcloud/3rdparty/guzzlehttp/guzzle/src/Handler/CurlFactory.php\",\"line\":158,\"function\":\"createRejection\",\"class\":\"GuzzleHttp\\\\Handler\\\\CurlFactory\",\"type\":\"::\",\"args\":[\"*** sensitive parameters replaced ***\"]},{\"file\":\"/var/www/localhost/htdocs/nextcloud/3rdparty/guzzlehttp/guzzle/src/Handler/CurlFactory.php\",\"line\":110,\"function\":\"finishError\",\"class\":\"GuzzleHttp\\\\Handler\\\\CurlFactory\",\"type\":\"::\"},{\"file\":\"/var/www/localhost/htdocs/nextcloud/3rdparty/guzzlehttp/guzzle/src/Handler/CurlHandler.php\",\"line\":47,\"function\":\"finish\",\"class\":\"GuzzleHttp\\\\Handler\\\\CurlFactory\",\"type\":\"::\"},{\"file\":\"/var/www/localhost/htdocs/nextcloud/lib/private/Http/Client/DnsPinMiddleware.php\",\"line\":150,\"function\":\"__invoke\",\"class\":\"GuzzleHttp\\\\Handler\\\\CurlHandler\",\"type\":\"->\"},{\"file\":\"/var/www/localhost/htdocs/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/localhost/htdocs/nextcloud/3rdparty/guzzlehttp/guzzle/src/Middleware.php\",\"line\":31,\"function\":\"__invoke\",\"class\":\"GuzzleHttp\\\\PrepareBodyMiddleware\",\"type\":\"->\"},{\"file\":\"/var/www/localhost/htdocs/nextcloud/3rdparty/guzzlehttp/guzzle/src/RedirectMiddleware.php\",\"line\":71,\"function\":\"GuzzleHttp\\\\{closure}\",\"class\":\"GuzzleHttp\\\\Middleware\",\"type\":\"::\",\"args\":[\"*** sensitive parameters replaced ***\"]},{\"file\":\"/var/www/localhost/htdocs/nextcloud/3rdparty/guzzlehttp/guzzle/src/RedirectMiddleware.php\",\"line\":107,\"function\":\"__invoke\",\"class\":\"GuzzleHttp\\\\RedirectMiddleware\",\"type\":\"->\"},{\"file\":\"/var/www/localhost/htdocs/nextcloud/3rdparty/guzzlehttp/guzzle/src/RedirectMiddleware.php\",\"line\":73,\"function\":\"checkRedirect\",\"class\":\"GuzzleHttp\\\\RedirectMiddleware\",\"type\":\"->\"},{\"file\":\"/var/www/localhost/htdocs/nextcloud/3rdparty/guzzlehttp/promises/src/FulfilledPromise.php\",\"line\":41,\"function\":\"GuzzleHttp\\\\{closure}\",\"class\":\"GuzzleHttp\\\\RedirectMiddleware\",\"type\":\"->\",\"args\":[\"*** sensitive parameters replaced ***\"]},{\"file\":\"/var/www/localhost/htdocs/nextcloud/3rdparty/guzzlehttp/promises/src/TaskQueue.php\",\"line\":48,\"function\":\"GuzzleHttp\\\\Promise\\\\{closure}\",\"class\":\"GuzzleHttp\\\\Promise\\\\FulfilledPromise\",\"type\":\"::\",\"args\":[\"*** sensitive parameters replaced ***\"]},{\"file\":\"/var/www/localhost/htdocs/nextcloud/3rdparty/guzzlehttp/promises/src/Promise.php\",\"line\":248,\"function\":\"run\",\"class\":\"GuzzleHttp\\\\Promise\\\\TaskQueue\",\"type\":\"->\"},{\"file\":\"/var/www/localhost/htdocs/nextcloud/3rdparty/guzzlehttp/promises/src/Promise.php\",\"line\":224,\"function\":\"invokeWaitFn\",\"class\":\"GuzzleHttp\\\\Promise\\\\Promise\",\"type\":\"->\"},{\"file\":\"/var/www/localhost/htdocs/nextcloud/3rdparty/guzzlehttp/promises/src/Promise.php\",\"line\":269,\"function\":\"waitIfPending\",\"class\":\"GuzzleHttp\\\\Promise\\\\Promise\",\"type\":\"->\"},{\"file\":\"/var/www/localhost/htdocs/nextcloud/3rdparty/guzzlehttp/promises/src/Promise.php\",\"line\":226,\"function\":\"invokeWaitList\",\"class\":\"GuzzleHttp\\\\Promise\\\\Promise\",\"type\":\"->\"},{\"file\":\"/var/www/localhost/htdocs/nextcloud/3rdparty/guzzlehttp/promises/src/Promise.php\",\"line\":62,\"function\":\"waitIfPending\",\"class\":\"GuzzleHttp\\\\Promise\\\\Promise\",\"type\":\"->\"},{\"file\":\"/var/www/localhost/htdocs/nextcloud/3rdparty/guzzlehttp/guzzle/src/Client.php\",\"line\":187,\"function\":\"wait\",\"class\":\"GuzzleHttp\\\\Promise\\\\Promise\",\"type\":\"->\"},{\"file\":\"/var/www/localhost/htdocs/nextcloud/lib/private/Http/Client/Client.php\",\"line\":226,\"function\":\"request\",\"class\":\"GuzzleHttp\\\\Client\",\"type\":\"->\"},{\"file\":\"/var/www/localhost/htdocs/nextcloud/lib/private/Installer.php\",\"line\":295,\"function\":\"get\",\"class\":\"OC\\\\Http\\\\Client\\\\Client\",\"type\":\"->\"},{\"file\":\"/var/www/localhost/htdocs/nextcloud/apps/settings/lib/Controller/AppSettingsController.php\",\"line\":448,\"function\":\"downloadApp\",\"class\":\"OC\\\\Installer\",\"type\":\"->\"},{\"file\":\"/var/www/localhost/htdocs/nextcloud/lib/private/AppFramework/Http/Dispatcher.php\",\"line\":230,\"function\":\"enableApps\",\"class\":\"OCA\\\\Settings\\\\Controller\\\\AppSettingsController\",\"type\":\"->\"},{\"file\":\"/var/www/localhost/htdocs/nextcloud/lib/private/AppFramework/Http/Dispatcher.php\",\"line\":137,\"function\":\"executeController\",\"class\":\"OC\\\\AppFramework\\\\Http\\\\Dispatcher\",\"type\":\"->\"},{\"file\":\"/var/www/localhost/htdocs/nextcloud/lib/private/AppFramework/App.php\",\"line\":183,\"function\":\"dispatch\",\"class\":\"OC\\\\AppFramework\\\\Http\\\\Dispatcher\",\"type\":\"->\"},{\"file\":\"/var/www/localhost/htdocs/nextcloud/lib/private/Route/Router.php\",\"line\":315,\"function\":\"main\",\"class\":\"OC\\\\AppFramework\\\\App\",\"type\":\"::\"},{\"file\":\"/var/www/localhost/htdocs/nextcloud/lib/base.php\",\"line\":1065,\"function\":\"match\",\"class\":\"OC\\\\Route\\\\Router\",\"type\":\"->\"},{\"file\":\"/var/www/localhost/htdocs/nextcloud/index.php\",\"line\":36,\"function\":\"handleRequest\",\"class\":\"OC\",\"type\":\"::\"}],\"File\":\"/var/www/localhost/htdocs/nextcloud/3rdparty/guzzlehttp/guzzle/src/Handler/CurlFactory.php\",\"Line\":210,\"message\":\"could not enable apps\",\"exception\":{},\"CustomMessage\":\"could not enable apps\"}","userAgent":"Mozilla/5.0 (X11; Linux x86_64; rv:109.0) Gecko/20100101 Firefox/116.0","version":"26.0.5.1"}

So, most of the times, the app store is missing, or I can't update my apps.

Yes, my connection is slow, but it works. So the downloads are in progress, not stalled. Curl should be more patient, I think.
With his ugly workaround, I can do my updates :

lib/private/App/AppStore/Fetcher/Fetcher.php: // 'timeout' => 60,
lib/private/App/AppStore/Fetcher/Fetcher.php: 'timeout' => 600,
lib/private/Preview/Imaginary.php: // 'timeout' => 120,
lib/private/Preview/Imaginary.php: 'timeout' => 600,

Steps to reproduce

  1. Live far from the civilized world
  2. Try to update your nextcloud apps

Expected behavior

After a consequent amount of patience and coffee, apps are updated.

Installation method

Other Community project

Nextcloud Server version

26

Operating system

Other

PHP engine version

PHP 8.2

Web server

Apache (supported)

Database engine version

PostgreSQL

Is this bug present after an update or on a fresh install?

None

Are you using the Nextcloud Server Encryption module?

Encryption is Disabled

What user-backends are you using?

  • Default user-backend (database)
  • LDAP/ Active Directory
  • SSO - SAML
  • Other

Configuration report

No response

List of activated Apps

No response

Nextcloud Signing status

No response

Nextcloud Logs

No response

Additional info

No response

@canoine canoine added 0. Needs triage Pending check for reproducibility or if it fits our roadmap bug labels Aug 28, 2023
@joshtrichards
Copy link
Member

joshtrichards commented Aug 28, 2023

I think this is more an enhancement request than a bug. :-)

I don't know if we can bump these up too high. There could be some side effects. But it might be okay.

Another possibility, which would take a bit more work but would also be safer, is to expose the curl timeout as a configuration option. We already expose timeout parameters for a lot of the other services.

@joshtrichards joshtrichards changed the title [Bug]: curl timeouts are not sufficient for low-bandwidth internet connections curl timeouts are not sufficient for low-bandwidth internet connections Aug 28, 2023
@canoine
Copy link
Author

canoine commented Aug 29, 2023

I think this is more an enhancement request than a bug. :-)

Well, okay. :)

I don't know if we can bump these up too high. There could be some side effects. But it might be okay.

I don't know what would be the side effects of these huge timeouts. I put these as a quick and dirty workaround, that's it.
I don't know how curl works, neither. But as I see that a SFTP transfer goes on as long as the data comes, even slowly, perhaps there is an option for curl to adopt the same behaviour ?

Another possibility, which would take a bit more work but would also be safer, is to expose the curl timeout as a configuration option. We already expose timeout parameters for a lot of the other services.

If the amount of work is acceptable, and the result sufficiently safe for all, That seems a good solution.

@joshtrichards joshtrichards changed the title curl timeouts are not sufficient for low-bandwidth internet connections Make App Store timeouts longer or configurable Oct 17, 2023
@joshtrichards joshtrichards added the good first issue Small tasks with clear documentation about how and in which place you need to fix things in. label Oct 17, 2023
@joshtrichards
Copy link
Member

The Server Updater is also presumably impacted in a similar way as the App Store.

@bernd-wechner
Copy link

Another possibility, which would take a bit more work but would also be safer, is to expose the curl timeout as a configuration option. We already expose timeout parameters for a lot of the other services.

Crucial IMHO to those of us affected by this (server responses taking longer than the nominal timeout). It was changed in: #16972 with the comment "A default timeout of 30 seconds should cover the 99% case. If a job need specific longer time it should set that." which alas is not so simple. To be sure I updated it and it works, for our local need, but now that file fails its signature test (is detected by Nextcloud as modified code and reported as such).

The hash no differs from that in core/signature.json. And it is (near) impossible to fix that, changing the hash only destroys the integrity of that file which has its own internally recorded signature signed with a certificate. TO with removing such a local mod from the error list would requite regenerating an integral core/signature.json which (I presume and expect) would require a private key to do.

The doc only says ["Please don’t modify the mentioned signature.json itself."](https://docs.nextcloud.com/server/27/admin_manual /issues/code_signing.html#errors) with no explanation of why not. Why not is, simply that it's not so simple, that the file is signed certified internally, and any change to it just produces another reported error. The only way to remove it then would be the sledge hammer approach of modifying lib/private/IntegrityCheck/Checker.php to exempt this file explicitly, and consequently probably, also exempting itself explicitly from the hash check.

A load of rigmarole and not a simple case of "If a job need specific longer time it should set that.".

To wit, this should most definitely be a setting available in config.php! Given it is something that may need tuning to local network performance conditions -- i.e. some of us do a clean install and find no App Store and scratch our heads and waste a load of time, to get to this point right here all of which would shrink if a) there was a clear message on the App store that the timeout had been exceeded with a hint to set it in config.pp and b) it could be set in config.php.

@TobiPeterG
Copy link

I'm affected by this as well and another user posted about this only a few days ago:
https://help.nextcloud.com/t/how-to-change-the-appstore-fetcher-timeout/208720

Here is my log:
Could not connect to appstore: cURL error 28: Operation timed out after 60001 milliseconds with 420554 out of 7026000 bytes received (see https://curl.haxx.se/libcurl/c/libcurl-errors.html) for https://apps.nextcloud.com/api/v1/apps.json

However, accessing the page from my web browser loads it instantly, so I don't get why nextcloud is failing to.

I have nextcloud AIO in version Nextcloud Hub 8 (29.0.8)

@joshtrichards
Copy link
Member

However, accessing the page from my web browser loads it instantly, so I don't get why nextcloud is failing to.

Then it sounds like your need isn't a change in the timeout option. Can you test from within your container? This sounds like some sort of outbound connectivity problem within your Docker environment that a timeout change just covers up rather than fixes.

@detcordtech
Copy link

Finally landed here after 3 days of trying to figure out why the appstore won't load on multiple VMs and different versions of nextcloud... Did various debugging steps on these two:

  • v30.0.2
  • v29.0.12

The URL https://apps.nextcloud.com/api/v1/apps.json takes well over 1 minute for me to load everywhere, cURL via linux terminal, browser and for nextcloud too, but my connection is not slow.

I'm seeing the same error message as TobiPeterG showing timeout before the download finished.

Please consider treating this ticket as a bug, because in certain regions, even with 1 Gbps fiber link, for some reason connection to this URL is slow and does not finish loading within 60 seconds. The timeout is not long enough.

At first I was convinced something is broken in the last few releases because app store wouldn't load correctly.

Screenshot below shows ~500Mbps download speed via speedtest-cli while nextcloud apps.json download took 10.5 minutes to complete. Not sure why this is slower for me here.
Image

Ridiculous as it may sound, "15 minute timeout for a 15 MB file?", I like to think - better slow for once, cached for later, than completely broken and impossible to load/seemingly broken.

Timeouts should be configurable via config file instead of having to modify code to get around situations like these.

Until then I will modify php files as mentioned in the first post to hopefully get around this.

Thanks!

@JMarcosHP
Copy link

Finally landed here after 3 days of trying to figure out why the appstore won't load on multiple VMs and different versions of nextcloud... Did various debugging steps on these two:

  • v30.0.2
  • v29.0.12

The URL https://apps.nextcloud.com/api/v1/apps.json takes well over 1 minute for me to load everywhere, cURL via linux terminal, browser and for nextcloud too, but my connection is not slow.

I'm seeing the same error message as TobiPeterG showing timeout before the download finished.

Please consider treating this ticket as a bug, because in certain regions, even with 1 Gbps fiber link, for some reason connection to this URL is slow and does not finish loading within 60 seconds. The timeout is not long enough.

At first I was convinced something is broken in the last few releases because app store wouldn't load correctly.

Screenshot below shows ~500Mbps download speed via speedtest-cli while nextcloud apps.json download took 10.5 minutes to complete. Not sure why this is slower for me here.
Image

Ridiculous as it may sound, "15 minute timeout for a 15 MB file?", I like to think - better slow for once, cached for later, than completely broken and impossible to load/seemingly broken.

Timeouts should be configurable via config file instead of having to modify code to get around situations like these.

Until then I will modify php files as mentioned in the first post to hopefully get around this.

Thanks!

I have this issue too, just upgraded to Nextcloud 30 using the Mastercontainer and now the Appstore is not loading anymore.

@SystemKeeper
Copy link
Contributor

@detcordtech Would you be able to retry your tests and post the results please?

@leapyear1969
Copy link

leapyear1969 commented Dec 23, 2024

i have same issue here. i can open the JSON config https://apps.nextcloud.com/api/v1/apps.json via browser quickly,
Image

however when click NC apps store, it will always timeout.
Image

by the way, i'm newly upgraded to Nextcloud 30, version 29 seems rendering well

@SystemKeeper
Copy link
Contributor

What happens if you execute curl -v --compressed https://apps.nextcloud.com/api/v1/apps.json -o apps.json on your instance @leapyear1969 ?

@leapyear1969
Copy link

What happens if you execute curl -v --compressed https://apps.nextcloud.com/api/v1/apps.json -o apps.json on your instance @leapyear1969 ?

It is downloading the apps.json file very slowly. here's the network test result from speedtest.net.
Image

jason@mediaCloud:~$ curl -v --compressed https://apps.nextcloud.com/api/v1/apps.json -o apps.json
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0*   Trying 65.21.231.50:443...
  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0* Connected to apps.nextcloud.com (65.21.231.50) port 443 (#0)
* ALPN: offers h2,http/1.1
} [5 bytes data]
* TLSv1.3 (OUT), TLS handshake, Client hello (1):
} [512 bytes data]
*  CAfile: /etc/ssl/certs/ca-certificates.crt
*  CApath: /etc/ssl/certs
{ [5 bytes data]
* TLSv1.3 (IN), TLS handshake, Server hello (2):
{ [122 bytes data]
* TLSv1.3 (IN), TLS handshake, Encrypted Extensions (8):
{ [15 bytes data]
* TLSv1.3 (IN), TLS handshake, Certificate (11):
{ [2036 bytes data]
* TLSv1.3 (IN), TLS handshake, CERT verify (15):
{ [79 bytes data]
* TLSv1.3 (IN), TLS handshake, Finished (20):
{ [36 bytes data]
* TLSv1.3 (OUT), TLS change cipher, Change cipher spec (1):
} [1 bytes data]
* TLSv1.3 (OUT), TLS handshake, Finished (20):
} [36 bytes data]
* SSL connection using TLSv1.3 / TLS_AES_128_GCM_SHA256
* ALPN: server accepted h2
* Server certificate:
*  subject: CN=apps.nextcloud.com
*  start date: Nov  7 10:48:41 2024 GMT
*  expire date: Feb  5 10:48:40 2025 GMT
*  subjectAltName: host "apps.nextcloud.com" matched cert's "apps.nextcloud.com"
*  issuer: C=US; O=Let's Encrypt; CN=E5
*  SSL certificate verify ok.
} [5 bytes data]
* using HTTP/2
* h2h3 [:method: GET]
* h2h3 [:path: /api/v1/apps.json]
* h2h3 [:scheme: https]
* h2h3 [:authority: apps.nextcloud.com]
* h2h3 [user-agent: curl/7.88.1]
* h2h3 [accept: */*]
* h2h3 [accept-encoding: deflate, gzip, br, zstd]
* Using Stream ID: 1 (easy handle 0x55871a824d00)
} [5 bytes data]
> GET /api/v1/apps.json HTTP/2
> Host: apps.nextcloud.com
> user-agent: curl/7.88.1
> accept: */*
> accept-encoding: deflate, gzip, br, zstd
>
{ [5 bytes data]
* TLSv1.3 (IN), TLS handshake, Newsession Ticket (4):
{ [122 bytes data]
< HTTP/2 200
< accept-ranges: bytes
< alt-svc: h3=":443"; ma=2592000
< cache-control: max-age=14400
< content-encoding: gzip
< content-type: application/json
< date: Mon, 23 Dec 2024 15:45:27 GMT
< etag: "676949ca-6e5a4f"
< expires: Mon, 23 Dec 2024 19:45:27 GMT
< last-modified: Mon, 23 Dec 2024 11:30:18 GMT
< permissions-policy: interest-cohort=();
< server: NCSA/1.42;
< strict-transport-security: max-age=31536000; includeSubDomains; preload;
< x-content-type-options: nosniff
< x-frame-options: DENY
< x-xss-protection: 1; mode=block;
< content-length: 7232079
{ [5 bytes data]
38 7062k 38  2694k 0 0 18366 0 0:06:33 0:02:30 0:04:03 25690

@joshtrichards
Copy link
Member

The OP of this issue here was getting a timeout not just to apps.nextcloud.com, but during artifact downloads too (which load from GitHub's CDN are thus not part of Nextcloud controlled infrastructure):

{"reqId":"ZOzLjSEcSVqe3qzIFqTXUwAAAAY","level":3,"time":"2023-08-28T18:32:06+02:00","remoteAddr":"90.62.30.145","user":"admin","app":"settings","method":"POST","url":"/index.php/settings/apps/enable","message":"{\"Exception\":\"GuzzleHttp\\\\Exception\\\\ConnectException\",\"Message\":\"cURL error 28: Operation timed out after 120000 milliseconds with 2322560 out of 5238706 bytes received (see https://curl.haxx.se/libcurl/c/libcurl-errors.html) for https://objects.githubusercontent.com/github-production-release-asset-2e65be/187186203/e96bc648-7e72-4612-90e0-3524b7ee8e12?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIAIWNJYAX4CSVEH53A%2F20230828%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20230828T162757Z&X-Amz-Expires=300&X-Amz-Signature=65d518673cf3a25d9191d0dfefd560962fd48e91b23acafaaf0807e5ac0a0d2c&X-Amz-SignedHeaders=host&actor_id=0&key_id=0&repo_id=187186203&response-content-disposition=attachment%3B%20filename%3DCookbook-0.10.2.tar.gz&response-content-type=application%2Foctet-stream\",

The concern wasn't about Nc infrastructure performance; it was about adjusting app store behavior to be more accommodating to a wider variety of Internet connectivity ranges:

Yes, my connection is slow, but it works. So the downloads are in progress, not stalled. Curl should be more patient, I think.
With his ugly workaround, I can do my updates :

lib/private/App/AppStore/Fetcher/Fetcher.php: // 'timeout' => 60,
lib/private/App/AppStore/Fetcher/Fetcher.php: 'timeout' => 600,
lib/private/Preview/Imaginary.php: // 'timeout' => 120,
lib/private/Preview/Imaginary.php: 'timeout' => 600,

I understand that those having performances problems involving apps.nextcloud.com might naturally look to adjusting the app store timeout, but to be clear:

@joshtrichards joshtrichards removed the good first issue Small tasks with clear documentation about how and in which place you need to fix things in. label Jan 5, 2025
@joshtrichards
Copy link
Member

I'm in favor of adding a setting that exposes the timeout value used in the inline app store for HTTP interactions with the outside world.

  • IMO we can treat both app store API interactions and artifact downloads the time
  • i.e.
    • unify the default timeout values used in both use cases (both 60s and 120s seem to be in-use).
    • a single exposed timeout setting can cover both (no need for two config values)
    • make sure our documentation coverage is reasonable re: the other timeout this setting can't help with: web server / reverse proxy / SAPI (mainly relevant when interacting with the app store via the Web UI; less so in cli-mode)

@joshtrichards
Copy link
Member

joshtrichards commented Jan 10, 2025

Something else we may want to consider here would be to enable download resume to re-use any partially downloaded file. This would also help with #45162.

And we should maybe review the possibility of falling back on any existing apps.json file when there's a timeout. Better to use an older one than to be broken entirely.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

8 participants