Server is slow and cURL errors

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): 25.0.3
Operating system and version (eg, Ubuntu 20.04): Ubuntu 22.04.1 LTS
Apache or nginx version (eg, Apache 2.4.25): Caddy v2.4.6
PHP version (eg, 7.4): 8.1

The issue you are facing:

My system is responding very slowly. I have a high enough bandwith. Jellyfin Streaming works flawlessly for example.

Nextcloud and Jellyfin are “behind” Caddy.

CaddyFile

{
        email   admin@domain.com
}

foo1.domain.com {
        root * /var/www/fooBar/
        file_server
}

jellyfin.domain.com {
        php_fastcgi unix//run/php/php8.1-fpm.sock

        reverse_proxy :8096
}


calibre.domain.com {
        reverse_proxy 127.0.0.1:49150
}

nextcloud.domain.com {
        root    * /var/www/nextcloud
        file_server

        #log {
        #        output file     nextcloud/nextcloud.log
        #        format single_field common_log
        #}

        php_fastcgi unix//run/php/php8.1-fpm.sock

        header {
                Strict-Transport-Security               "max-age=15552000;"
                X-Frame-Options                         "SAMEORIGIN" always
                X-Permitted-Cross-Domain-Policies       "none" always
                X-Robots-Tag                            "none" always
                X-XSS-Protection                        "1; mode=block" always
                X-Content-Type-Options                  nosniff
        }

        #redir /.well-known/webfinger /public.php?service=webfinger last;
        redir /.well-known/carddav /remote.php/dav 301
        redir /.well-known/caldav /remote.php/dav 301
        redir /.well-known/host-meta /public.php?service=host-meta
        redir /.well-known/host-meta\.json /public.php?service=host-meta-json

        # .htaccess / data / config / ... shouldn't be accessible from outside
        @forbidden {
                path    /.htaccess
                path    /data/*
                path    /config/*
                path    /db_structure
                path    /.xml
                path    /README
                path    /3rdparty/*
                path    /lib/*
                path    /templates/*
                path    /occ
                path    /console.php
        }

        respond @forbidden 404
}

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

Steps to replicate it:

I do not know how to replicate.

The output of your Nextcloud log in Admin > Logging:

a lot entries like these

[richdocuments] Fehler: GuzzleHttp\Exception\ConnectException: cURL error 28: Operation timed out after 45001 milliseconds with 0 bytes received (see https://curl.haxx.se/libcurl/c/libcurl-errors.html) for https://subdomain.domain.com/index.php/login 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 113
    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/RedirectMiddleware.php line 107
    GuzzleHttp\RedirectMiddleware->__invoke()
 8. /var/www/nextcloud/3rdparty/guzzlehttp/guzzle/src/RedirectMiddleware.php line 73
    GuzzleHttp\RedirectMiddleware->checkRedirect()
 9. /var/www/nextcloud/3rdparty/guzzlehttp/promises/src/FulfilledPromise.php line 41
    GuzzleHttp\RedirectMiddleware->GuzzleHttp\{closure}("*** sensitive parameters replaced ***")
10. /var/www/nextcloud/3rdparty/guzzlehttp/promises/src/TaskQueue.php line 48
    GuzzleHttp\Promise\FulfilledPromise::GuzzleHttp\Promise\{closure}("*** sensitive parameters replaced ***")
11. /var/www/nextcloud/3rdparty/guzzlehttp/promises/src/Promise.php line 248
    GuzzleHttp\Promise\TaskQueue->run()
12. /var/www/nextcloud/3rdparty/guzzlehttp/promises/src/Promise.php line 224
    GuzzleHttp\Promise\Promise->invokeWaitFn()
13. /var/www/nextcloud/3rdparty/guzzlehttp/promises/src/Promise.php line 269
    GuzzleHttp\Promise\Promise->waitIfPending()
14. /var/www/nextcloud/3rdparty/guzzlehttp/promises/src/Promise.php line 226
    GuzzleHttp\Promise\Promise->invokeWaitList()
15. /var/www/nextcloud/3rdparty/guzzlehttp/promises/src/Promise.php line 62
    GuzzleHttp\Promise\Promise->waitIfPending()
16. /var/www/nextcloud/3rdparty/guzzlehttp/guzzle/src/Client.php line 187
    GuzzleHttp\Promise\Promise->wait()
17. /var/www/nextcloud/lib/private/Http/Client/Client.php line 218
    GuzzleHttp\Client->request()
18. /var/www/nextcloud/apps/richdocuments/lib/Service/CapabilitiesService.php line 136
    OC\Http\Client\Client->get()
19. /var/www/nextcloud/apps/richdocuments/lib/Service/CapabilitiesService.php line 74
    OCA\Richdocuments\Service\CapabilitiesService->refetch()
20. /var/www/nextcloud/apps/richdocuments/lib/Capabilities.php line 108
    OCA\Richdocuments\Service\CapabilitiesService->getCapabilities()
21. /var/www/nextcloud/lib/private/CapabilitiesManager.php line 75
    OCA\Richdocuments\Capabilities->getCapabilities()
22. /var/www/nextcloud/lib/private/Template/JSConfigHelper.php line 166
    OC\CapabilitiesManager->getCapabilities()
23. /var/www/nextcloud/lib/private/TemplateLayout.php line 230
    OC\Template\JSConfigHelper->getConfig()
24. /var/www/nextcloud/lib/private/legacy/OC_Template.php line 184
    OC\TemplateLayout->__construct()
25. /var/www/nextcloud/lib/public/AppFramework/Http/TemplateResponse.php line 213
    OC_Template->fetchPage()
26. /var/www/nextcloud/lib/private/AppFramework/Http/Dispatcher.php line 178
    OCP\AppFramework\Http\TemplateResponse->render()
27. /var/www/nextcloud/lib/private/AppFramework/App.php line 172
    OC\AppFramework\Http\Dispatcher->dispatch()
28. /var/www/nextcloud/lib/private/Route/Router.php line 298
    OC\AppFramework\App::main()
29. /var/www/nextcloud/lib/base.php line 1047
    OC\Route\Router->match()
30. /var/www/nextcloud/index.php line 36
    OC::handleRequest()

GET /index.php/login
from ::1 at 2023-02-08T14:56:58+00:00

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

<?php
$CONFIG = array (
  'instanceid' => 'foo',
  'passwordsalt' => 'foo',
  'secret' => 'foo',
  'trusted_domains' =>
  array (
    0 => 'subdomain.domain.com',
  ),
  'datadirectory' => '/nextcloud/',
  'dbtype' => 'pgsql',
  'version' => '25.0.3.2',
  'dbname' => 'owncloud',
  'dbhost' => 'localhost',
  'dbtableprefix' => 'oc_',
  'dbuser' => 'oc_db',
  'dbpassword' => 'foo',
  'logtimezone' => 'UTC',
  'installed' => true,
  'filelocking.enabled' => 'true',
  'memcache.local' => '\\OC\\Memcache\\Redis',
  'memcache.distributed' => '\\OC\\Memcache\\Redis',
  'memcache.locking' => '\\OC\\Memcache\\Redis',
  'redis' =>
  array (
    'host' => 'localhost',
    'port' => 6379,
    'timeout' => 0,
    'dbindex' => 0,
  ),
  'mail_smtpstreamoptions' =>
  array (
    'ssl' =>
    array (
      'allow_self_signed' => true,
      'verify_peer' => false,
      'verify_peer_name' => false,
    ),
  ),
  'mail_smtpmode' => 'smtp',
  'mail_from_address' => 'admin',
  'mail_domain' => 'domain.com',
  'mail_smtpsecure' => 'tls',
  'mail_smtpauthtype' => 'LOGIN',
  'mail_smtphost' => 'smtp.domain.com',
  'mail_smtpport' => '587',
  'log_type' => "file",
  'logfile' => "nextcloud.log",
  'loglevel' => 3,
  'logdateformat' => "F d, Y H:i:s",
  'maintenance' => false,
  'theme' => '',
  'updatechecker' => false,
  'updater.release.channel' => 'stable',
  'overwrite.cli.url' => 'https://subdomain.domain.com',
  'versions_retention_obligation' => 'auto',
  'ldapIgnoreNamingRules' => false,
  'ldapProviderFactory' => 'OCA\\User_LDAP\\LDAPProviderFactory',
  'app_install_overwrite' =>
  array (
    0 => 'calendar',
    1 => 'unsplash',
    2 => 'external',
    3 => 'keeweb',
    4 => 'theming',
    5 => 'contacts',
    6 => 'maps',
    7 => 'audioplayer',
    8 => 'spreed',
    9 => 'riotchat',
    10 => 'richdocumentscode',
    11 => 'bookmarks',
  ),
  'htaccess.RewriteBase' => '/',
  'mail_sendmailmode' => 'smtp',
  'mail_smtpauth' => 1,
  'mail_smtpname' => 'name',
  'mail_smtppassword' => 'foo',
  'default_phone_region' => 'DE',
);

I followed suggested solution but to now avail: cURL error 28: Operation timed out after XXXXXX milliseconds with XXXXXX out of XXXXXX bytes received (see http://curl.haxx.se/libcurl/c/libcurl-errors.html)

Can you use apache/nginx to test if you have the same issue? There are existing example configs that are working …

Other idea, reduce the number of apps if the problem exists as well, so you can identify the app if the error is involved with one of the apps.

I’m not really sure what the curl command does in your case, calling some external resource or if it calls itself to check for something.

?!?!? Thank disabling & enabling Apps helped.

I disabled all Apps and started to enable one by one. The Log did not show above mentioned error again… Oddly enough thooug, I have now “OCP\Files\NotPermittedException: Could not create folder” errors, which I cannot locate. The output is… well… unclear. It seems to have to do with the Photo App but I am not sure.

I will continue monitoring. And it seems to have sped up, will test it with another machine as well.

I can not really help you. But you use IPv4 but i found IPv6 in your logs. Maybe you can deactive IPv6 and it helps you. Maybe not.

Interestingly enough I cannot.
If I disable IPv6 then I can’t connect to Nextcloud within the same IP range. The Mobile Apps as well as the Browser won’t work.

Ok. That you need IPv6 may be due to something called DS-Lite in Germany: Internet without an own IPv4-address. Will probably not be the cause of your problem. However, your nextcloud will not be reachable from pure IPv4 networks, e.g. company proxies.

Yeah, correct. I think the config with IPv4 and v6 is now working, took me long enough, especially the DynDNS and the various update URLs and a wrong Documentation :smiley:
I had the config under scrutiny because I thought it actually might be the reason for a performance issue. Took me long enough to do it right. Especially in the early times when the Mobile apps had issues with IPv6…