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

Slow log out. #9179

Closed
wjwieland opened this issue Apr 13, 2018 · 88 comments · Fixed by #16310 or #17784
Closed

Slow log out. #9179

wjwieland opened this issue Apr 13, 2018 · 88 comments · Fixed by #16310 or #17784
Labels
1. to develop Accepted and waiting to be taken care of bug high
Milestone

Comments

@wjwieland
Copy link

Steps to reproduce

  1. Log into nextcloud
  2. Log out

Expected behaviour

Log out should be as fast as log in. There should not be a delay to get out of the system.

Actual behaviour

I have two instances of Nextcloud (one mine, one is a friends). Both are V 13.1. Either may take anywhere from 5 to 30 seconds to achieve log out.

Server configuration

Operating system:
Ubuntu

Web server:
Apache2
Database:
MySQL
PHP version:
7.2
Nextcloud version: (see Nextcloud admin page)
13.1
Updated from an older Nextcloud/ownCloud or fresh install:
One of each
Where did you install Nextcloud from:
Web
Signing status:

Signing status
Login as admin user into your Nextcloud and access 
http://example.com/index.php/settings/integrity/failed 
paste the results here.
No errors have been found.
</details>

**List of activated apps:**
<details>
<summary>App list</summary>

If you have access to your command line run e.g.:
sudo -u www-data php occ app:list
from within your Nextcloud installation folder
Enabled:

  • activity: 2.6.1
  • apporder: 0.4.1
  • bruteforcesettings: 1.0.3
  • calendar: 1.6.1
  • comments: 1.3.0
  • contacts: 2.1.3
  • dashboard: 4.0.6
  • dav: 1.4.6
  • federatedfilesharing: 1.3.1
  • federation: 1.3.0
  • files: 1.8.0
  • files_pdfviewer: 1.2.1
  • files_sharing: 1.5.0
  • files_texteditor: 2.5.1
  • files_trashbin: 1.3.0
  • files_versions: 1.6.0
  • files_videoplayer: 1.2.0
  • firstrunwizard: 2.2.1
  • gallery: 18.0.0
  • logreader: 2.0.0
  • lookup_server_connector: 1.1.0
  • nextcloud_announcements: 1.2.0
  • notifications: 2.1.2
  • oauth2: 1.1.0
  • passman: 2.1.4
  • password_policy: 1.3.0
  • provisioning_api: 1.3.0
  • serverinfo: 1.3.0
  • sharebymail: 1.3.0
  • survey_client: 1.1.0
  • systemtags: 1.3.0
  • tasks: 0.9.6
  • theming: 1.4.1
  • twofactor_backupcodes: 1.2.3
  • updatenotification: 1.3.0
  • weather: 1.5.1
  • workflowengine: 1.3.0

Nextcloud configuration:

Config report
If you have access to your command line run e.g.:
sudo -u www-data php occ config:list system
from within your Nextcloud installation folder

or 

Insert your config.php content here. 
Make sure to remove all sensitive content such as passwords. (e.g. database password, passwordsalt, secret, smtp password, …)
{
    "system": {
        "instanceid": "***REMOVED SENSITIVE VALUE***",
        "passwordsalt": "***REMOVED SENSITIVE VALUE***",
        "secret": "***REMOVED SENSITIVE VALUE***",
        "trusted_domains": [
            "bobbi1.is-an-artist.net",
            "192.168.0.16",
            "192.168.50.176"
        ],
        "datadirectory": "***REMOVED SENSITIVE VALUE***",
        "overwrite.cli.url": "http:\/\/bobbi1.is-an-artist.net\/nextcloud",
        "dbtype": "mysql",
        "version": "13.0.1.1",
        "dbname": "***REMOVED SENSITIVE VALUE***",
        "dbhost": "***REMOVED SENSITIVE VALUE***",
        "dbport": "",
        "dbtableprefix": "oc_",
        "mysql.utf8mb4": true,
        "dbuser": "***REMOVED SENSITIVE VALUE***",
        "dbpassword": "***REMOVED SENSITIVE VALUE***",
        "installed": true,
        "memcache.local": "\\OC\\Memcache\\APCu",
        "defaultapp": "calendar,files,dashboard",
        "maintenance": false,
        "theme": "",
        "loglevel": 2
    }
}

</details>

**Are you using external storage, if yes which one:** local/smb/sftp/...
No
**Are you using encryption:** yes/no
No
**Are you using an external user-backend, if yes which one:** LDAP/ActiveDirectory/Webdav/...
No
#### LDAP configuration (delete this part if not used)
<details>
<summary>LDAP config</summary>

With access to your command line run e.g.:
sudo -u www-data php occ ldap:show-config
from within your Nextcloud installation folder

Without access to your command line download the data/owncloud.db to your local
computer or access your SQL server remotely and run the select query:
SELECT * FROM oc_appconfig WHERE appid = 'user_ldap';

Eventually replace sensitive data as the name/IP-address of your LDAP server or groups.

</details>

### Client configuration
**Browser:**
chromium, Google Chrome
**Operating system:**
Ubuntu
### Logs
#### Web server error log
<details>
<summary>Web server error log</summary>

N/A
Insert your webserver log here

Nextcloud log (data/nextcloud.log)

Nextcloud log {"reqId":"JTdr8OQ7ACQEgPi71sJ0","level":3,"time":"2018-04-13T17:23:54+00:00","remoteAddr":"71.48.121.114","user":"wjw","app":"PHP","method":"GET","url":"\/nextcloud\/index.php\/settings\/admin","message":"Cannot modify header information - headers already sent by (output started at \/var\/www\/nextcloud\/apps\/passman\/personal.php:1) at \/var\/www\/nextcloud\/lib\/private\/AppFramework\/Http\/Output.php#69","userAgent":"Mozilla\/5.0 (X11; Linux x86_64) AppleWebKit\/537.36 (KHTML, like Gecko) Chrome\/65.0.3325.181 Safari\/537.36","version":"13.0.1.1"}

Insert your Nextcloud log here

Browser log

Browser log

N/A
Insert your browser log here, this could for example include:

a) The javascript console log
b) The network log
c) ...
JQMIGRATE: Migrate is installed, version 1.4.0
12:32:08.990 DevTools failed to parse SourceMap: https://bobbi1.is-an-artist.net/nextcloud/core/vendor/purify.min.js.map
12:32:09.381 inject.js:324 Found 1 logins for this site
12:32:09.443 inject.js:324 Found 1 logins for this site

@nextcloud-bot nextcloud-bot added the stale Ticket or PR with no recent activity label Jun 20, 2018
@nextcloud-bot nextcloud-bot removed the stale Ticket or PR with no recent activity label Jul 5, 2018
@gohrner
Copy link

gohrner commented Nov 15, 2018

I'm also observing this in NextCloud 13.0.7. Any hints what might be causing this?

@wjwieland
Copy link
Author

@gohrner
Oddly enough, after I 'click' on logour the second time, it immediately logs out and goes back to the login page. If I don't click the second time, it will grind away for up to ~30 seconds before finally logging out....odd....and bothersome.

@upmferraz
Copy link

I have a similar problem on nextcloud 14.0.3, and actually a even worse issue.
When is trying to logout all the sessions under the same domain are closed even the sessions under shibboleth. Is this related on having authentication with ldap?

@wjwieland
Copy link
Author

I upgraded to NextCloud 14.03, same issue. Will check into the log-rotate setting above mentioned by @nextcloud-bot. The second click behavior mentioned still persists as well. Same applies to Nextcloud 14.04. This is after following steps in https://docs.nextcloud.com/server/14/admin_manual/issues/general_troubleshooting.html#service-discovery.

@upmferraz
Copy link

In 14.04 this issue was solved to me :)

@adrhc
Copy link

adrhc commented Jan 20, 2019

For me the logout takes 15s (owncloud takes < 1s).
My system:
Ubuntu 16.04.5 LTS

PHP 7.0.32-0ubuntu0.16.04.1 (cli) ( NTS )
Zend Engine v3.0.0, Copyright (c) 1998-2017 Zend Technologies
    with Zend OPcache v7.0.32-0ubuntu0.16.04.1, Copyright (c) 1999-2017, by Zend Technologies
'filelocking.enabled' => true,
'memcache.local' => '\\OC\\Memcache\\Redis',
'redis' => 
array (
  'host' => '/var/run/redis/redis.sock',
  'port' => 0,
),
'memcache.locking' => '\\OC\\Memcache\\Redis',

@pgera
Copy link

pgera commented Feb 15, 2019

Logout takes really long some times (latest stable 15.x). In chromium, if I do 'empty cache and hard reload', logouts becomes fast again.

@agarek
Copy link

agarek commented Mar 6, 2019

Same issue and no solution found :-(
Ubuntu 18.04.1
Apache 2.4.29
PHP 7.2.15
MySQL 5.7.25

@deddc23efb
Copy link

Same issue in 15. I saw it in 14 too. Clicking the logout again after a few seconds wakes it up for me.

@alexanderheckel
Copy link

alexanderheckel commented Apr 6, 2019

Please open again, the problem persists.

Nexcloud 15.0.6

Steps to reproduce:

  • sign in, then sign out

Results (sign out duration, deterministic / reproducible):

  • Chrome 73.0.3683.86 - 9.89 s
  • Safari 12.1.1 (14607.2.2) - 701 ms

@kesselb
Copy link
Contributor

kesselb commented Apr 6, 2019

Can you reproduce this with https://demo.nextcloud.com?

@alexanderheckel
Copy link

Thanks for your quick response.

Yes, I can reproduce the behaviour with the demo instance -- 9.92 s with Chrome and 368 ms with Safari.

Here the header details of Chrome's logout request, if you have the change to see something in the logs of the demo instance:

Request URL: https://demo.nextcloud.com/aeb9ouc9/logout?requesttoken=WRHtv%2BSN6UKbAyDm9VByvhAlsnZbkcgvCvgPw1d4l24%3D%3AFSOc67PVpBvDO2eLkB8l%2BlZMggQc3bpaPIhrpiIS8lg%3D
Request Method: GET
Status Code: 303 See Other
Remote Address: 91.103.114.57:443
Referrer Policy: no-referrer
Cache-Control: no-cache, no-store, must-revalidate
Clear-Site-Data: "cache", "storage", "executionContexts"
Connection: Keep-Alive
Content-Length: 0
Content-Security-Policy: default-src 'none';base-uri 'none';manifest-src 'self';script-src 'nonce-ckFDN0xEbFd3bGlpMytnZ3l5QUtzZWpjWkVZRTZ3eEFKUDdZb1FvZlZDbz06NERMS2VHNE9qd0g2NTY5TnJtOWQ5YTYxVkRSRHAzNDFFbzY4eEg5MU1Sdz0=';style-src 'self' 'unsafe-inline';img-src 'self' data: blob:;font-src 'self' data:;connect-src 'self' stun.nextcloud.com:443;media-src 'self';frame-src https://demo.nextcloud.com
Content-Type: text/html; charset=UTF-8
Date: Sat, 06 Apr 2019 12:08:07 GMT
Expires: Thu, 19 Nov 1981 08:52:00 GMT
Keep-Alive: timeout=5, max=100
Location: https://demo.nextcloud.com/aeb9ouc9/login
Pragma: no-cache
Referrer-Policy: no-referrer
Server: Apache
Set-Cookie: nc_username=deleted; expires=Thu, 01-Jan-1970 00:00:01 GMT; Max-Age=0; path=/aeb9ouc9; secure; HttpOnly
Set-Cookie: nc_token=deleted; expires=Thu, 01-Jan-1970 00:00:01 GMT; Max-Age=0; path=/aeb9ouc9; secure; HttpOnly
Set-Cookie: nc_session_id=deleted; expires=Thu, 01-Jan-1970 00:00:01 GMT; Max-Age=0; path=/aeb9ouc9; secure; HttpOnly
Set-Cookie: nc_username=deleted; expires=Thu, 01-Jan-1970 00:00:01 GMT; Max-Age=0; path=/aeb9ouc9/; secure; HttpOnly
Set-Cookie: nc_token=deleted; expires=Thu, 01-Jan-1970 00:00:01 GMT; Max-Age=0; path=/aeb9ouc9/; secure; HttpOnly
Set-Cookie: nc_session_id=deleted; expires=Thu, 01-Jan-1970 00:00:01 GMT; Max-Age=0; path=/aeb9ouc9/; secure; HttpOnly
Set-Cookie: ocy3i56r5v7j=fcv2pt18f7g3eujgkdilf428kg; path=/aeb9ouc9; secure; HttpOnly
Strict-Transport-Security: max-age=15768000
X-Content-Type-Options: nosniff
X-Download-Options: noopen
X-Frame-Options: SAMEORIGIN
X-Permitted-Cross-Domain-Policies: none
X-Robots-Tag: none
X-XSS-Protection: 1; mode=block
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,/;q=0.8,application/signed-exchange;v=b3
Accept-Encoding: gzip, deflate, br
Accept-Language: de-DE,de;q=0.9,en-US;q=0.8,en;q=0.7
Connection: keep-alive
Cookie: oc_sessionPassphrase=La7jsToQu5QdWUSXWBNdhCs3LiYHgzO9V46eL9riUdywKwWpoZzdyjnbeVPiyutZl2KlVu8LndhbsGt4RMMVQ4LF%2FRzpRMv4M6Dcy6W28CXmVUR15mMn24kFRtQrUv%2BO; nc_sameSiteCookielax=true; nc_sameSiteCookiestrict=true; ocy3i56r5v7j=nmsm2s1npcdo65u8g6e58t22a2; nc_username=admin; nc_token=pCopR%2BQVogmDxBFRY65Byf%2F%2FK0OS%2F0Qq; nc_session_id=nmsm2s1npcdo65u8g6e58t22a2; _pk_ref.1.7a80=%5B%22%22%2C%22%22%2C1554487329%2C%22https%3A%2F%2Fwww.google.com%2F%22%5D; _pk_id.1.7a80=1a7153c162da0beb.1542219749.16.1554487336.1554487329.
Host: demo.nextcloud.com
Upgrade-Insecure-Requests: 1
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/73.0.3683.86 Safari/537.36
requesttoken: WRHtv+SN6UKbAyDm9VByvhAlsnZbkcgvCvgPw1d4l24=:FSOc67PVpBvDO2eLkB8l+lZMggQc3bpaPIhrpiIS8lg=

@gohrner
Copy link

gohrner commented Apr 6, 2019

The issue definitely isn't fixed, I observe it on both of my NextCloud instances, one using LDAP and the other not using LDAP. The problem persists since 13, is still present in 15.0.5 and simply hasn't been dealt with so far...

@kesselb kesselb added 0. Needs triage Pending check for reproducibility or if it fits our roadmap bug labels Apr 6, 2019
@kesselb
Copy link
Contributor

kesselb commented Apr 6, 2019

Not sure why but logout with chrome is (much) slower than firefox.

@kesselb kesselb reopened this Apr 6, 2019
@pgera

This comment has been minimized.

@alexanderheckel

This comment has been minimized.

@pgera

This comment has been minimized.

@efelon

This comment has been minimized.

@Falken82

This comment has been minimized.

@tynie

This comment has been minimized.

@SupercowsNL

This comment has been minimized.

@j9367

This comment has been minimized.

@DawidDIV

This comment has been minimized.

@skjnldsv

This comment has been minimized.

@td001

This comment has been minimized.

@skjnldsv

This comment has been minimized.

@hheinen

This comment has been minimized.

@greenais

This comment has been minimized.

@rollanders

This comment has been minimized.

@pgera

This comment has been minimized.

@thestepafter

This comment has been minimized.

@kangaroo72

This comment has been minimized.

@kesselb

This comment has been minimized.

@jendib
Copy link

jendib commented Oct 20, 2019

For those who can live with it and need a fast logout, just remove the cache clear from the Clear-Site-Data header. It works on Chrome but the user cache will not be cleared on logout.

@kesselb
Copy link
Contributor

kesselb commented Oct 20, 2019

Index: core/Controller/LoginController.php
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- core/Controller/LoginController.php	(revision 9d6a58e6aef035dc99fd5dedddc8353b5d888491)
+++ core/Controller/LoginController.php	(date 1571566516960)
@@ -128,7 +128,11 @@
 
 		$this->session->set('clearingExecutionContexts', '1');
 		$this->session->close();
-		$response->addHeader('Clear-Site-Data', '"cache", "storage"');
+
+		if ($this->config->getSystemValueBool('clear_site_data', true)) {
+			$response->addHeader('Clear-Site-Data', '"cache", "storage"');
+		}
+
 		return $response;
 	}
 
Index: config/config.sample.php
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- config/config.sample.php	(revision 9d6a58e6aef035dc99fd5dedddc8353b5d888491)
+++ config/config.sample.php	(date 1571566436340)
@@ -1716,4 +1716,12 @@
  */
 
 'login_form_autocomplete' => true,
+
+/**
+ * By default we send Clear-Site-Data header on logout.
+ * For some reason clearing the site data takes a while in Chrome.
+ *
+ * Set this property to "false" to not send clear-site-data header
+ */
+'clear_site_data' => true,
 );

I guess it's valid to have some config property to manage this behaviour. Feel free to take the above patch as start and submit a pull requests. Don't forget to update the tests: https://github.com/nextcloud/server/blob/master/core/Controller/LoginController.php

@davodego
Copy link

davodego commented Nov 2, 2019

+1
My logout takes 45 seconds from klick to end logout on Vivaldi Browser.
I have mdae the changes from the patch in the post above. No effect to logout time.
I can found nothing in log: nextcloud.log, ssl_access.log, error.log.

@nextcloud nextcloud deleted a comment from nextcloud-bot Nov 2, 2019
@kesselb
Copy link
Contributor

kesselb commented Nov 2, 2019

+1

Please use GitHub Reactions for "+1" or "Same here". I've hidden most of the +1 posts to make reading easier ;)

I have mdae the changes from the patch in the post above. No effect to logout time.

The patch adds a way to disable the Clear-Site-Data header. You still need to modify your config.php and add 'clear_site_data' => false,.

My logout takes 45 seconds from klick to end logout on Vivaldi Browser.

With Clear-Site-Data header logout is much slower in chrome and browsers using the chrome engine. This needs to be fixed by chrome.

The issue (slow logout if clear-site-data header is present) should to be fixed by chromium. There are multiple ways for you to get rid of this problem:

  1. Apply one of the patches above Slow log out. #9179 (comment) or Slow log out. #9179 (comment)
  2. Tell your webserver to drop the Clear-Site-Data header (e.g. https://httpd.apache.org/docs/current/mod/mod_headers.html#header look for unset) <- no warnings from the integrity check 😎
  3. Start hacking and create a pull request (you can use Slow log out. #9179 (comment) as starting point) 🎉 Disable Clear-Site-Data for Chrom* (and Opera, Brave, etc) #17784

Thanks to all of you for helping with this issue 👍

@davodego

This comment has been minimized.

@kesselb
Copy link
Contributor

kesselb commented Nov 2, 2019

I proposed a patch to disable the Clear-Site-Data header for Nextcloud 18 (and probably 17): #17784

@kesselb
Copy link
Contributor

kesselb commented Nov 3, 2019

https://bugs.chromium.org/p/chromium/issues/detail?id=762417 here is a bug report for this issue. Can someone of you test it with a newer (>= 77) chrome version and confirm that the issue is fixed?

@jendib
Copy link

jendib commented Nov 3, 2019

I tested with the stable version (78) and it still happens. ~30sec to logout on a decent computer.

@alexanderheckel
Copy link

With a fresh Nextcloud installation, the issue seems to be fixed \o/ (Build 78.0.3904.87, macOS 10.15.1). However, the logout is slow when testing with my old installation (both 16.0.5, same config.php/webserver/database).

@jendib
Copy link

jendib commented Nov 3, 2019

I tested on https://try.nextcloud.com/ so it cannot be fresher. However I am under Win 10 (but the exact same Chrome version).

@kesselb
Copy link
Contributor

kesselb commented Dec 13, 2019

Nextcloud 18 will not send the clear site data header for chrome* browsers.

* actually every browser that user agents matches ^Mozilla\/5\.0 \([^)]+\) AppleWebKit\/[0-9.]+ \(KHTML, like Gecko\)( Ubuntu Chromium\/[0-9.]+|) Chrome\/[0-9.]+ (Mobile Safari|Safari)\/[0-9.]+$/

@LMaiorano
Copy link

I know this is closed, but the issue is still present in NextCloud 18.0.3

@kangaroo72
Copy link

Hi. As mentioned, it's Chrome-related

@HLFH
Copy link
Contributor

HLFH commented Oct 30, 2023

Broken again on NC27.
I submitted the issue: #41196

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
1. to develop Accepted and waiting to be taken care of bug high
Projects
None yet