Server: Slow log out.

Created on 13 Apr 2018  Â·  87Comments  Â·  Source: nextcloud/server

Steps to reproduce

  1. Log into nextcloud
  2. Log out
    3.

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

1. to develop bug high

Most helpful comment

@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.

All 87 comments

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

@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.

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?

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.

In 14.04 this issue was solved to me :)

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',

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

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

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

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

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

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=

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...

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

To anyone experimenting with chrome, can you try 'empty cache and hard reload' and check if it makes logout faster ? It reliably does for me. Press F12 and right click on the refresh button to the left of home.

I can confirm that clearing the cache (completely, every option and whole history) makes logout faster - thanks.
If this is necessary once to solve the problem, it's acceptable -- let's see for how long.

In my experience, the slowdowns happen again eventually. This is only a temporary fix.

NC 15.0.6 on Chromium or Firefox
PHP7.0
Raspbian Stretch

I observe the slow logout as well, but only when I'm in the same network as the nextcloud-raspberry-pi. If I logout from "extern" the logout is much faster.

I have this problem as well. It usually takes up to 30 seconds for the logout to finish. If I press the logout button again after 2-3 seconds, the logout happens instantly.

I am using the latest version of Chrome. I can confirm that a complete cache clears fixes the problem for a while, but it sure does come back.

same issue here...

I had this problem in 15.0.6 and now having the same issue in version 16

yup having the same issue on 15.0.6 as well

Yes, i can also confirm that logout without cache (incognito because i want to preserve my cache), is way faster. Also firefox gives the desired result when loggin in to the nextcloud and logout. So what is cache doing here that makes it takes forever?

I have the same issue. Logout goes on forever. If I press a second time and I get out. When I now want to log in again I get "Access denied. CSRF check failure". By chance I found out I could log in to https://mydomain.com/ or press the back button twice.

Clearing the cache does not help for me.
I have NC 16.0.1

Same here with a fresh installation of NC 16.01 + Ubuntu 18.04 x64. Slow logout etc. with NVMe storage - i7 7700 without cache. I came here after googling about this issue.

it works fast with Edge. The problem occurs in Chrome. The most used web browser.

This helped me
https://www.auslogics.com/en/articles/chrome-is-waiting-for-cache/

it seems to be a chrome issue, and maybe an SSD issue.

I'm still seeing this issue. Some new info:
From linux mint connected on a local LAN to Nextcloud using Chromium I see the slow log out.
From Fedora 28 connected from WAN through caddy reverse proxy using Chrome I see no problems. Logout is very quick.

This helped me
https://www.auslogics.com/en/articles/chrome-is-waiting-for-cache/

it seems to be a chrome issue, and maybe an SSD issue.

Not really. I only have problems with the logout option in nextcloud in Chrome.

Ah yep, I think this could be related tot he localstorage cleanup feature we added a few versions back. https://github.com/nextcloud/server/pull/10874 :thinking:

@weeman1337 ? :)

when logout:

t= 1987 [st=   30]     +HTTP_TRANSACTION_READ_HEADERS  [dt=118]
t= 1987 [st=   30]        HTTP_STREAM_PARSER_READ_HEADERS  [dt=118]
t= 2105 [st=  148]        HTTP_TRANSACTION_READ_RESPONSE_HEADERS
                          --> HTTP/1.1 303 See Other
                              Server: nginx
                              Date: Thu, 13 Jun 2019 10:04:27 GMT
                              Content-Type: text/html; charset=UTF-8
                              Content-Length: 0
                              Connection: close
                              Expires: Thu, 19 Nov 1981 08:52:00 GMT
                              Pragma: no-cache
                              X-Frame-Options: SAMEORIGIN
                              Set-Cookie: nc_username=deleted; expires=Thu, 01-Jan-1970 00:00:01 GMT; Max-Age=0; secure; HttpOnly
                              Set-Cookie: nc_token=deleted; expires=Thu, 01-Jan-1970 00:00:01 GMT; Max-Age=0; secure; HttpOnly
                              Set-Cookie: nc_session_id=deleted; expires=Thu, 01-Jan-1970 00:00:01 GMT; Max-Age=0; secure; HttpOnly
                              Set-Cookie: nc_username=deleted; expires=Thu, 01-Jan-1970 00:00:01 GMT; Max-Age=0; path=/; secure; HttpOnly
                              Set-Cookie: nc_token=deleted; expires=Thu, 01-Jan-1970 00:00:01 GMT; Max-Age=0; path=/; secure; HttpOnly
                              Set-Cookie: nc_session_id=deleted; expires=Thu, 01-Jan-1970 00:00:01 GMT; Max-Age=0; path=/; secure; HttpOnly
                              Set-Cookie: ociwk90iyrx4=usj4msg7b3p9bka3bjo6kvi3r3; path=/; secure; HttpOnly
                              Cache-Control: no-cache, no-store, must-revalidate
                              Location: https://xxxxx/login
                              Clear-Site-Data: "cache", "cookies", "storage", "executionContexts"
                              Content-Security-Policy: default-src 'none';base-uri 'none';manifest-src 'self';script-src 'nonce-bzI4a0xHTFM5NVphSHZzUy9PSGczMkdkdFNTam1YMFFFZk8raHpYRTZpST06MUJaUVpSRzJtOEFQYnNoVmxZeW83dy9rZ1dqWndCaEtScHZkNkdPUm9GVT0=' 'unsafe-eval';style-src 'self' 'unsafe-inline';img-src 'self' data: blob:;font-src 'self';connect-src 'self';media-src 'self' data:
                              X-Content-Type-Options: nosniff
                              X-XSS-Protection: 1; mode=block
                              X-Robots-Tag: none
                              X-Download-Options: noopen
                              X-Permitted-Cross-Domain-Policies: none
                              Strict-Transport-Security: max-age=15552000
                              Referrer-Policy: no-referrer
t= 2105 [st=  148]     -HTTP_TRANSACTION_READ_HEADERS
t= 2105 [st=  148]      HTTP_CACHE_WRITE_INFO  [dt=0]
t= 2105 [st=  148]      NETWORK_DELEGATE_HEADERS_RECEIVED  [dt=54183]
t=56288 [st=54331]      URL_REQUEST_DELEGATE_RECEIVED_REDIRECT  [dt=2]
t=56290 [st=54333]      URL_REQUEST_REDIRECTED
                        --> location = "https://xxxxx/login"
t=56290 [st=54333]   -URL_REQUEST_START_JOB
t=56290 [st=54333]    NETWORK_DELEGATE_BEFORE_URL_REQUEST  [dt=0]

why NETWORK_DELEGATE_HEADERS_RECEIVED state waste too much time ? I make sure the http response has been send early, and I found it appeard just in chrome.

@nextcloud-bot

Same Issue here. Nextcloud14

same issue here nextcloud 16.0.0.1

t= 1987 [st=   30]     +HTTP_TRANSACTION_READ_HEADERS  [dt=118]
t= 1987 [st=   30]        HTTP_STREAM_PARSER_READ_HEADERS  [dt=118]
t= 2105 [st=  148]        HTTP_TRANSACTION_READ_RESPONSE_HEADERS
                          --> HTTP/1.1 303 See Other
                              Server: nginx
                              Date: Thu, 13 Jun 2019 10:04:27 GMT
                              Content-Type: text/html; charset=UTF-8
                              Content-Length: 0
                              Connection: close
                              Expires: Thu, 19 Nov 1981 08:52:00 GMT
                              Pragma: no-cache
                              X-Frame-Options: SAMEORIGIN
                              Set-Cookie: nc_username=deleted; expires=Thu, 01-Jan-1970 00:00:01 GMT; Max-Age=0; secure; HttpOnly
                              Set-Cookie: nc_token=deleted; expires=Thu, 01-Jan-1970 00:00:01 GMT; Max-Age=0; secure; HttpOnly
                              Set-Cookie: nc_session_id=deleted; expires=Thu, 01-Jan-1970 00:00:01 GMT; Max-Age=0; secure; HttpOnly
                              Set-Cookie: nc_username=deleted; expires=Thu, 01-Jan-1970 00:00:01 GMT; Max-Age=0; path=/; secure; HttpOnly
                              Set-Cookie: nc_token=deleted; expires=Thu, 01-Jan-1970 00:00:01 GMT; Max-Age=0; path=/; secure; HttpOnly
                              Set-Cookie: nc_session_id=deleted; expires=Thu, 01-Jan-1970 00:00:01 GMT; Max-Age=0; path=/; secure; HttpOnly
                              Set-Cookie: ociwk90iyrx4=usj4msg7b3p9bka3bjo6kvi3r3; path=/; secure; HttpOnly
                              Cache-Control: no-cache, no-store, must-revalidate
                              Location: https://xxxxx/login
                              Clear-Site-Data: "cache", "cookies", "storage", "executionContexts"
                              Content-Security-Policy: default-src 'none';base-uri 'none';manifest-src 'self';script-src 'nonce-bzI4a0xHTFM5NVphSHZzUy9PSGczMkdkdFNTam1YMFFFZk8raHpYRTZpST06MUJaUVpSRzJtOEFQYnNoVmxZeW83dy9rZ1dqWndCaEtScHZkNkdPUm9GVT0=' 'unsafe-eval';style-src 'self' 'unsafe-inline';img-src 'self' data: blob:;font-src 'self';connect-src 'self';media-src 'self' data:
                              X-Content-Type-Options: nosniff
                              X-XSS-Protection: 1; mode=block
                              X-Robots-Tag: none
                              X-Download-Options: noopen
                              X-Permitted-Cross-Domain-Policies: none
                              Strict-Transport-Security: max-age=15552000
                              Referrer-Policy: no-referrer
t= 2105 [st=  148]     -HTTP_TRANSACTION_READ_HEADERS
t= 2105 [st=  148]      HTTP_CACHE_WRITE_INFO  [dt=0]
t= 2105 [st=  148]      NETWORK_DELEGATE_HEADERS_RECEIVED  [dt=54183]
t=56288 [st=54331]      URL_REQUEST_DELEGATE_RECEIVED_REDIRECT  [dt=2]
t=56290 [st=54333]      URL_REQUEST_REDIRECTED
                        --> location = "https://xxxxx/login"
t=56290 [st=54333]   -URL_REQUEST_START_JOB
t=56290 [st=54333]    NETWORK_DELEGATE_BEFORE_URL_REQUEST  [dt=0]

How did you do that?

But back to topic...
In the cases that I do run into this particular issue, i get the following into the nextcloud.log immediately after hitting the logout button. Then 40s waiting and I am logged out:
{"reqId":"XRWsZFUI2@fJDton6GukDQAAAIk","level":0,"time":"2019-06-28T05:57:56+00:00","remoteAddr":"x","user":"--","app":"PHP","method":"GET","url":"\/nextcloud\/index.php\/logout?requesttoken=8UA36pLRUBhQMKQnrOYxyu763DbdT4G%2B%2By2qY9YF0NM%3D%3AuAF%2FqMuYfy4bWZdGw9ZXn7%2BfuVuLf7HnnGn9Cv19grc%3D","message":"session_start(): A session had already been started - ignoring at \/var\/www\/...../pub\/nextcloud\/lib\/private\/Session\/Internal.php#205","userAgent":"Mozilla\/5.0 (Windows NT 10.0; WOW64) AppleWebKit\/537.36 (KHTML, like Gecko) Chrome\/75.0.3770.102 Safari\/537.36 Vivaldi\/2.6.1566.44","version":"16.0.1.1"} {"reqId":"XRWseWWqkP@TXpSo9XmcvAAAANE","level":0,"time":"2019-06-28T05:58:17+00:00","remoteAddr":"x","user":"--","app":"core","method":"GET","url":"\/nextcloud\/ocs\/v2.php\/apps\/notifications\/api\/v2\/notifications","message":{"Exception":"OC\\AppFramework\\Middleware\\Security\\Exceptions\\NotLoggedInException","Message":"Current user is not logged in","Code":401,"Trace":[{"file":"\/var\/www\/...\/pub\/nextcloud\/lib\/private\/AppFramework\/Middleware\/MiddlewareDispatcher.php","line":95,"function":"beforeController","class":"OC\\AppFramework\\Middleware\\Security\\SecurityMiddleware","type":"->","args":[{"__class__":"OCA\\Notifications\\Controller\\EndpointController"},"listNotifications"]},{"file":"\/var\/www\/...\/pub\/nextcloud\/lib\/private\/AppFramework\/Http\/Dispatcher.php","line":97,"function":"beforeController","class":"OC\\AppFramework\\Middleware\\MiddlewareDispatcher","type":"->","args":[{"__class__":"OCA\\Notifications\\Controller\\EndpointController"},"listNotifications"]},{"file":"\/var\/www\/....\/pub\/nextcloud\/lib\/private\/AppFramework\/App.php","line":126,"function":"dispatch","class":"OC\\AppFramework\\Http\\Dispatcher","type":"->","args":[{"__class__":"OCA\\Notifications\\Controller\\EndpointController"},"listNotifications"]},{"file":"\/var\/www\/...\/pub\/nextcloud\/lib\/private\/AppFramework\/Routing\/RouteActionHandler.php","line":47,"function":"main","class":"OC\\AppFramework\\App","type":"::","args":["OCA\\Notifications\\Controller\\EndpointController","listNotifications",{"__class__":"OC\\AppFramework\\DependencyInjection\\DIContainer"},{"apiVersion":"v2","_route":"ocs.notifications.Endpoint.listNotifications"}]},{"function":"__invoke","class":"OC\\AppFramework\\Routing\\RouteActionHandler","type":"->","args":[{"apiVersion":"v2","_route":"ocs.notifications.Endpoint.listNotifications"}]},{"file":"\/var\/www\/...\/pub\/nextcloud\/lib\/private\/Route\/Router.php","line":297,"function":"call_user_func","args":[{"__class__":"OC\\AppFramework\\Routing\\RouteActionHandler"},{"apiVersion":"v2","_route":"ocs.notifications.Endpoint.listNotifications"}]},{"file":"\/var\/www\/....\/pub\/nextcloud\/ocs\/v1.php","line":82,"function":"match","class":"OC\\Route\\Router","type":"->","args":["\/ocsapp\/apps\/notifications\/api\/v2\/notifications"]},{"file":"\/var\/www\/....\/pub\/nextcloud\/ocs\/v2.php","line":24,"args":["\/var\/www\/....\/pub\/nextcloud\/ocs\/v1.php"],"function":"require_once"}],"File":"\/var\/www\/....\/pub\/nextcloud\/lib\/private\/AppFramework\/Middleware\/Security\/SecurityMiddleware.php","Line":143,"CustomMessage":"--"},"userAgent":"Mozilla\/5.0 (Windows NT 10.0; WOW64) AppleWebKit\/537.36 (KHTML, like Gecko) Chrome\/75.0.3770.102 Safari\/537.36 Vivaldi\/2.6.1566.44","version":"16.0.1.1"}

In fact, the logout request has been send and the response has been recieved immediately. But in chrome, the http state still in pending..... It must the problem in chrome ...

At last, I fixed this question in another way, when click logout, send the same http request two times in chrome ...

At last, I fixed this question in another way, when click logout, send the same http request two times in chrome ...

This will lead to CSRF errors from Nextcloud if you try to sign in again immediately afterwards.

Better just click at the Nextcloud logo in the top-left corner, this will load a functional login screen.

If you really just want to sign out, you do not need to wait for the spinner to finish and can simply immediately enter a new web address or visit a bookmark.

@gohrner
Yep, cause by redirectUrl... So I change the rule, If redirect route is logout, the redirectUrl change to root url...

Same here,
NC: 16.0.1
Chrome: Versión 75.0.3770.100 (Build oficial) (64 bits)
Windows 7 64b

Hi,
Same issue in v15.0.5. I also have v14 & v16 instances, same issue as well.

Really hope besides putting it as milestone in Nextcloud 17, it can be fixed in v14, 15, & 16.
Nextcloud is a great software, it's kind of disappointing if basic logout is not behaving as efficient as users are expecting.

Thanks.

Same issue on Chrome 75.0.3770.100 and Nextcloud 16.0.1.

Takes 20+ seconds here ...
If I go directly too root NC page and retry login within this period. NC will not accept the login. Guess smth loops in the background during log-out process and prevents you from log-in.

Same for NC 16.0.2

@HelloLemon1992 mind to share how to create such debug output?

Index: core/Controller/LoginController.php
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- core/Controller/LoginController.php (revision eb092bbdc74fd10253e7a75850d5725df27daa25)
+++ core/Controller/LoginController.php (date 1562613978000)
@@ -128,7 +128,7 @@

        $this->session->set('clearingExecutionContexts', '1');
        $this->session->close();
-       $response->addHeader('Clear-Site-Data', '"cache", "storage", "executionContexts"');
+       //$response->addHeader('Clear-Site-Data', '"cache", "storage", "executionContexts"');
        return $response;
    }

This patch disables the Clear-Site-Data header. Logout is faster on my test instance. Could you measure the time again to validate?

@HelloLemon1992 mind to share how to create such debug output?

Index: core/Controller/LoginController.php
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- core/Controller/LoginController.php   (revision eb092bbdc74fd10253e7a75850d5725df27daa25)
+++ core/Controller/LoginController.php   (date 1562613978000)
@@ -128,7 +128,7 @@

      $this->session->set('clearingExecutionContexts', '1');
      $this->session->close();
-     $response->addHeader('Clear-Site-Data', '"cache", "storage", "executionContexts"');
+     //$response->addHeader('Clear-Site-Data', '"cache", "storage", "executionContexts"');
      return $response;
  }

This patch disables the Clear-Site-Data header. Logout is faster on my test instance. Could you measure the time again to validate?

Absolutelly right. I was made this change in my NC 16.0.2 and now logout is fast!

@kesselb chrome://net-internals/#events

if disable the Clear-Site-Data, will any mistake happen?

if disable the Clear-Site-Data, will any mistake happen?

https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Clear-Site-Data

I prefer not to make changes with nc original logic,
nc use Clear-Site-Data must has its reason...

I think the problem cause by chrome, how chrome handle the http response with http-header:Clear-Site-Data, and slow ? I think the problem is here.

Thank you @HelloLemon1992 :+1:

if disable the Clear-Site-Data, will any mistake happen?

Yes and No. Clear-Site-Data is a command for your browser. There are still browsers without these command. They will just ignore it.

Did some tests with chrome://net-export/:

  • Without Clear-Site-Data: NETWORK_DELEGATE_HEADERS_RECEIVED [dt=0]
  • "cache", "storage": NETWORK_DELEGATE_HEADERS_RECEIVED [dt=544]
  • "cache", "storage", "executionContexts": NETWORK_DELEGATE_HEADERS_RECEIVED [dt=2579]

Please check this pr: https://github.com/nextcloud/server/pull/16310

Hi, 6a088d6 doesn't resolve the slow log-out issue though.

Unfortunately. It improves the situation a bit for chrome users. I'm not sure why but it takes a while to delete all the cache and storage.

Mind to do some tests with chrome://net-export/? How long is "slow" in seconds :thinking:

I have to agree it is still considerably slower than a owncloud log out after removing execution contexts. It’s probably like 5 seconds on Nextcloud to Logout but owncloud has it down to 1 second.

@Harryjholmes but owncloud does not properly cleanup all the data from the browser on logout then :)

https://github.com/owncloud/core/blob/dc44bcedaf23cae84fad71b5807febf3904b4507/core/Controller/LoginController.php#L89-L97

OwnCloud does NOT send Clear-Site-Data.

The Clear-Site-Data header clears browsing data (cookies, storage, cache) associated with the requesting website.

https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Clear-Site-Data sounds like a nice feature. Don't you think?

27 seconds logoff time despite patch
After I have deleted "cached images and files" in Chrome (Linux) logoff time immediately

Same issue, very slow on Chrome 75.0.3770.100 and Nextcloud 15.0.10.
In Safari (12.1.1 ) very faster.
In Firefox (68.0) normal.

+1
Version 75.0.3770.100 (Official Build) (64-bit)
Nextcloud 16.0.3

Please use GitHub Reactions for "+1" or "Same here".

I'm not sure if we can do anything here. With Clear-Site-Data header logout is much slower in chrome. This needs to be fixed by chrome. Do you think we should remove Clear-Site-Data?

@kesselb I think meanwhile Chrome will be fixed, CSD should be removed

Has CSD been removed? If not, would there be a way to change the link for the logout button so that it triggers a javascript function like this:

function logoutButton() {
setTimeout(function() {
window.location.replace("serverlocation.com/index.php/login?clear=1");
}, 5000);
}

It would only be bodge, but it will hopefully fix the issue for the time being.

Did 16.0.4 update resolve the issue?

@DavidDzl 17

@skjnldsv If 17 fixes it, is 17 stable enough to roll out into production?

@jackm9367 17 is in beta since yesterday

Oh - so not a hope. :(

@skjnldsv And what is preliminary release date for 17?

But is it confirmed that v17 does in fact fix it?

@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.

Same for me with NC16

NC 16.0.5 - only doubleclick works as well

If I doubleclick I get a CSRF check failed when I want to log in again.

This is not fixed in 17

I can also confirm that this isn't fixed in 17.

Same here

Please use GitHub Reactions for "+1" or "Same here".

I don't think we can do anything here. With Clear-Site-Data header logout is much slower in chrome. This needs to be fixed by chrome.

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.

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

+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.

+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 https://github.com/nextcloud/server/issues/9179#issuecomment-509361586 or https://github.com/nextcloud/server/issues/9179#issuecomment-544239124
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 :sunglasses:
3) ~Start hacking and create a pull request (you can use https://github.com/nextcloud/server/issues/9179#issuecomment-544239124 as starting point) :tada:~ #17784

Thanks to all of you for helping with this issue :+1:

+1

I did not know that. I found the option now, thanks.

I'm back to Firefox after having another problem with the chrome engine.

Thank you for your explanation.

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

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?

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

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).

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

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.]+$/

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

Hi. As mentioned, it's Chrome-related

Was this page helpful?
0 / 5 - 0 ratings