Request is very slow when logging in

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: 23.0.4.1
Operating system and version: ubuntu 22.04
Apache or nginx version: nginx 1.18.0
PHP version: 7.4

The issue you are facing:
every login request takes 40 seconds or longer

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

Steps to replicate it:

  1. input username and password
  2. click login button

The output of your Nextcloud log in Admin > Logging:

Error	PHP	Missing boundary in multipart/form-data POST data at Unknown#0		2024-03-27T11:16:07+0800
Error	PHP	Error: unlink(/data/nextcloud/appdata_oc112tjsxc3n/css/user_status/54ac-fc31-user-status-menu.css): No such file or directory at /var/www/nextcloud/lib/private/Files/Storage/Local.php#291		2024-03-27T11:16:06+0800
Error	PHP	Error: unlink(/data/nextcloud/appdata_oc112tjsxc3n/css/user_status/54ac-fc31-user-status-menu.css): No such file or directory at /var/www/nextcloud/lib/private/Files/Storage/Local.php#291		2024-03-27T11:16:06+0800
Error	PHP	Error: unlink(/data/nextcloud/appdata_oc112tjsxc3n/css/theming/f5a2-fc31-theming.css): No such file or directory at /var/www/nextcloud/lib/private/Files/Storage/Local.php#291		2024-03-27T11:16:06+0800
Error	PHP	Error: unlink(/data/nextcloud/appdata_oc112tjsxc3n/css/theming/f5a2-fc31-theming.css): No such file or directory at /var/www/nextcloud/lib/private/Files/Storage/Local.php#291		2024-03-27T11:16:06+0800
Error	PHP	Error: unlink(/data/nextcloud/appdata_oc112tjsxc3n/css/settings/35c3-fc31-settings.css): No such file or directory at /var/www/nextcloud/lib/private/Files/Storage/Local.php#291		2024-03-27T11:16:05+0800
Error	PHP	Error: unlink(/data/nextcloud/appdata_oc112tjsxc3n/css/settings/35c3-fc31-settings.css): No such file or directory at /var/www/nextcloud/lib/private/Files/Storage/Local.php#291		2024-03-27T11:16:05+0800
Error	PHP	Error: unlink(/data/nextcloud/appdata_oc112tjsxc3n/css/photos/35c3-fc31-icons.css.deps): No such file or directory at /var/www/nextcloud/lib/private/Files/Storage/Local.php#291		2024-03-27T11:16:05+0800
Error	PHP	Error: unlink(/data/nextcloud/appdata_oc112tjsxc3n/css/photos/35c3-fc31-icons.css.deps): No such file or directory at /var/www/nextcloud/lib/private/Files/Storage/Local.php#291		2024-03-27T11:16:05+0800
Error	PHP	Error: unlink(/data/nextcloud/appdata_oc112tjsxc3n/css/photos/35c3-fc31-icons.css): No such file or directory at /var/www/nextcloud/lib/private/Files/Storage/Local.php#291		2024-03-27T11:16:05+0800
Error	PHP	Error: unlink(/data/nextcloud/appdata_oc112tjsxc3n/css/photos/35c3-fc31-icons.css): No such file or directory at /var/www/nextcloud/lib/private/Files/Storage/Local.php#291		2024-03-27T11:16:05+0800
Error	PHP	Error: unlink(/data/nextcloud/appdata_oc112tjsxc3n/css/notifications/7a5a-fc31-styles.css): No such file or directory at /var/www/nextcloud/lib/private/Files/Storage/Local.php#291		2024-03-27T11:16:04+0800
Error	PHP	Error: unlink(/data/nextcloud/appdata_oc112tjsxc3n/css/notifications/7a5a-fc31-styles.css): No such file or directory at /var/www/nextcloud/lib/private/Files/Storage/Local.php#291		2024-03-27T11:16:04+0800

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

<?php
$CONFIG = array (
  'instanceid' => '>>redacted by wwe<<',
  'passwordsalt' => '>>redacted by wwe<<',
  'secret' => '>>redacted by wwe<<',
  'trusted_domains' =>
  array (
    0 => '***.********.com',
  ),
  'default_language' => 'zh_CN',
  'force_language' => 'zh_CN',
  'default_phone_region' => 'cn',
  'datadirectory' => '/data/nextcloud',
  'dbtype' => 'mysql',
  'version' => '23.0.4.1',
  'overwrite.cli.url' => '***.********.com',
  'overwriteprotocol': => 'https',
  'dbname' => 'nextcloud',
  'dbhost' => 'localhost',
  'dbport' => '',
  'dbtableprefix' => 'oc_',
  'mysql.utf8mb4' => true,
  'dbuser' => 'oc_root',
  'dbpassword' => '***********************',
  'installed' => true,
  'mail_smtpmode' => 'smtp',
  'mail_smtpsecure' => 'ssl',
  'mail_sendmailmode' => 'smtp',
  'mail_from_address' => 'lq053',
  'mail_domain' => '********.com',
  'mail_smtpauthtype' => 'LOGIN',
  'mail_smtpauth' => 1,
  'mail_smtphost' => 'smtp.****.com',
  'mail_smtpport' => '465',
  'mail_smtpname' => 'system@********.com',
  'mail_smtppassword' => '********',
  'maintenance' => false,
  'loglevel' => 3,
  'enabledPreviewProviders' =>
  array (
    0 => 'OC\\Preview\\PNG',
    1 => 'OC\\Preview\\JPEG',
    2 => 'OC\\Preview\\GIF',
    3 => 'OC\\Preview\\BMP',
    4 => 'OC\\Preview\\SVG',
    5 => 'OC\\Preview\\XBitmap',
    6 => 'OC\\Preview\\MP3',
    7 => 'OC\\Preview\\TXT',
    8 => 'OC\\Preview\\MarkDown',
    9 => 'OC\\Preview\\OpenDocument',
    10 => 'OC\\Preview\\Krita',
  ),
  'updater.secret' => '>>redacted by wwe<<',
);

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

2024/03/27 12:50:51 [error] 1329#1329: *462706 access forbidden by rule, client: 10.10.5.198, server: ********.com>
2024/03/27 12:54:03 [error] 1329#1329: *463005 access forbidden by rule, client: 10.10.5.198, server: *******.com>
2024/03/27 12:54:33 [error] 1329#1329: *463186 access forbidden by rule, client: 10.10.5.198, server: *******.com>

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":"p4a8q56Zr76DQZyB6frF","level":2,"time":"2022-04-25T12:19:14+00:00","remoteAddr":"10.10.5.59","user":"--","app":"no app in context","method":"GET","url":"/","message":"Could not detect any host in https:///data/htaccesstest.txt","userAgent":"Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:99.0) Gecko/20100101 Firefox/99.0","version":""}
{"reqId":"p4a8q56Zr76DQZyB6frF","level":2,"time":"2022-04-25T12:19:14+00:00","remoteAddr":"10.10.5.59","user":"--","app":"no app in context","method":"GET","url":"/","message":"Could not detect any host in http:///data/htaccesstest.txt","userAgent":"Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:99.0) Gecko/20100101 Firefox/99.0","version":""}
{"reqId":"QTcWkLzNXE14Hz1VG7Tu","level":2,"time":"2022-04-25T12:21:34+00:00","remoteAddr":"10.10.5.59","user":"--","app":"no app in context","method":"POST","url":"/index.php","message":"Could not detect any host in https:///data/htaccesstest.txt","userAgent":"Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:99.0) Gecko/20100101 Firefox/99.0","version":""}
{"reqId":"QTcWkLzNXE14Hz1VG7Tu","level":2,"time":"2022-04-25T12:21:34+00:00","remoteAddr":"10.10.5.59","user":"--","app":"no app in context","method":"POST","url":"/index.php","message":"Could not detect any host in http:///data/htaccesstest.txt","userAgent":"Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:99.0) Gecko/20100101 Firefox/99.0","version":""}
{"reqId":"uvzemqJWp67R1WgiXKuv","level":2,"time":"2022-04-25T12:22:16+00:00","remoteAddr":"10.10.5.59","user":"--","app":"no app in context","method":"POST","url":"/index.php","message":"Could not detect any host in https:///data/htaccesstest.txt","userAgent":"Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:99.0) Gecko/20100101 Firefox/99.0","version":""}
{"reqId":"uvzemqJWp67R1WgiXKuv","level":2,"time":"2022-04-25T12:22:16+00:00","remoteAddr":"10.10.5.59","user":"--","app":"no app in context","method":"POST","url":"/index.php","message":"Could not detect any host in http:///data/htaccesstest.txt","userAgent":"Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:99.0) Gecko/20100101 Firefox/99.0","version":""}

btw I’m in China, maybe it’s a network issue,because when I disabled GAvatar, which is not accessible from China,many timeouts disappeared.

1 Like

hi @stalkercn welcome to the community :handshake:

I don’t think this is a reason but please be advised you are running very old NC and php version. I strongly recommend you upgrade to NC28 and php83.

It’s a production environment, I updated it to the latest stable version 25.0.13, but the problem still exists.

login with ‘root’ only takes 5-7 seconds,what’s the difference? What’s really going on when login request happening?

in my case fresh login using oidc takes 5-7 sec as well until my default app “files” completes loading. I think login with integrated auth could perform faster… but in general not a big deal you usually the user doesn’t do fresh login often… once logged in navigation and switching apps is reasonable fast for me

ok, now for me the most possible reason is, nextcloud is trying to access some services which are not accessible from China or will be very slow, the login api will keep trying until timedout. I’ll deploy a open source version of nextcloud and debug with it, will post here when I find out.

That went out of support as well:

You have the usage survey app installed? Worst case, use tcpdump or other tools to figure out what service it tries to connect to.