desktop icon indicating copy to clipboard operation
desktop copied to clipboard

[Bug]: Desktop Client freezes in a 100% CPU load loop after server upgrade to 25

Open RainerKlute opened this issue 4 years ago • 127 comments

⚠️ Before submitting, please verify the following: ⚠️

Bug description

After upgrading the server to NC 25 stable (25.0.0.18, to be exact), the desktop client (3.6.1 on openSUSE Tumbleweed) does no longer sync from the client to the server. Instead, the client totally freezes, while using 100% CPU load.

It turned out that the bulk upload feature is in error. As a workaround, I turned off bulk upload in the server’s config.php file by adding the following line:

'bulkupload.enabled' => false,

Steps to reproduce

See the description above.

Expected behavior

The client should never freeze, even if the server is behaving incorrectly. Ideally, the client should support bulk upload. As the very minimum – for example, if the origin error is on the server side –, it should fall back to normal upload.

Which files are affected by this bug

–

Operating system

Linux

Which version of the operating system you are running.

openSUSE Tumbleweed

Package

Distro package manager

Nextcloud Server version

25.0.0.18

Nextcloud Desktop Client version

3.6.1

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

Fresh desktop client install

Are you using the Nextcloud Server Encryption module?

Encryption is Disabled

Are you using an external user-backend?

  • [X] Default internal user-backend
  • [ ] LDAP/ Active Directory
  • [ ] SSO - SAML
  • [ ] Other

Nextcloud Server logs

{
   "app" : "webdav",
   "exception" : {
      "Code" : 500,
      "CustomMessage" : "Unknown error while seeking content",
      "Exception" : "Sabre\\DAV\\Exception",
      "File" : "/data/nextcloud/apps/dav/lib/BulkUpload/MultipartRequestParser.php",
      "Line" : 111,
      "Message" : "Unknown error while seeking content",
      "Trace" : [
         {
            "class" : "OCA\\DAV\\BulkUpload\\MultipartRequestParser",
            "file" : "/data/nextcloud/apps/dav/lib/BulkUpload/MultipartRequestParser.php",
            "function" : "isAt",
            "line" : 129,
            "type" : "->"
         },
         {
            "class" : "OCA\\DAV\\BulkUpload\\MultipartRequestParser",
            "file" : "/data/nextcloud/apps/dav/lib/BulkUpload/BulkUploadPlugin.php",
            "function" : "isAtLastBoundary",
            "line" : 71,
            "type" : "->"
         },
         {
            "class" : "OCA\\DAV\\BulkUpload\\BulkUploadPlugin",
            "file" : "/data/nextcloud/3rdparty/sabre/event/lib/WildcardEmitterTrait.php",
            "function" : "httpPost",
            "line" : 89,
            "type" : "->"
         },
         {
            "class" : "Sabre\\DAV\\Server",
            "file" : "/data/nextcloud/3rdparty/sabre/dav/lib/DAV/Server.php",
            "function" : "emit",
            "line" : 472,
            "type" : "->"
         },
         {
            "class" : "Sabre\\DAV\\Server",
            "file" : "/data/nextcloud/3rdparty/sabre/dav/lib/DAV/Server.php",
            "function" : "invokeMethod",
            "line" : 253,
            "type" : "->"
         },
         {
            "class" : "Sabre\\DAV\\Server",
            "file" : "/data/nextcloud/3rdparty/sabre/dav/lib/DAV/Server.php",
            "function" : "start",
            "line" : 321,
            "type" : "->"
         },
         {
            "class" : "Sabre\\DAV\\Server",
            "file" : "/data/nextcloud/apps/dav/lib/Server.php",
            "function" : "exec",
            "line" : 360,
            "type" : "->"
         },
         {
            "class" : "OCA\\DAV\\Server",
            "file" : "/data/nextcloud/apps/dav/appinfo/v2/remote.php",
            "function" : "exec",
            "line" : 35,
            "type" : "->"
         },
         {
            "args" : [
               "/data/nextcloud/apps/dav/appinfo/v2/remote.php"
            ],
            "file" : "/data/nextcloud/remote.php",
            "function" : "require_once",
            "line" : 167
         }
      ],
      "exception" : {},
      "message" : "Unknown error while seeking content"
   },
   "level" : 3,
   "message" : "Unknown error while seeking content",
   "method" : "POST",
   "remoteAddr" : "*****",
   "reqId" : "Qrxj5bFNAAPoYgTYGy9B",
   "time" : "2022-10-25T13:43:09+00:00",
   "url" : "/cloud/remote.php/dav/bulk",
   "user" : "*****",
   "userAgent" : "Mozilla/5.0 (Linux) mirall/3.6.1git (Nextcloud, opensuse-tumbleweed-6.0.2-1-default ClientArchitecture: x86_64 OsArchitecture: x86_64)",
   "version" : "25.0.0.18"
}

Additional info

Under “Is this bug present after an update or on a fresh install?” I had to select something, although I did not update the client.

RainerKlute avatar Oct 26 '22 06:10 RainerKlute

Looks like the same issue: #4106 I also just had it crop up again too

appliedbarrel avatar Oct 26 '22 14:10 appliedbarrel

@RainerKlute would you be able to share your logs ? The error you report while in need of a fix should not cause such a big use of CPU.

mgallien avatar Oct 27 '22 08:10 mgallien

Hello, Thanks for creating this ticket, I have the same problem but with a cpu load of about 15/16%.

The addition of "'bulkupload.enabled' => false," in config.php solved my problem.

image

like this: https://github.com/nextcloud/desktop/issues/5031

Server : Nextcloud : 25.0.0 Nginx / Php 8

Client : Windows 10 - 21H1 Desktop : 3.6.1 ( same in 3.6.0 )

######################### Edit :

After reading this message: https://github.com/nextcloud/desktop/issues/4106#issuecomment-1292104697

I disabled the automatic upload speed limitation option, and the client not freeze

EVOTk avatar Oct 27 '22 16:10 EVOTk

I was able to sync a lot of files these days with desktop client 3.6.1 on openSUSE Tumbleweed 20221003 and Nextcloud 25.0.1 RC1.

However, after having synced a lot of files it's now stuck at 100%. I see the UI saying it's going to sync about 111 kb of files. The log only says this:

#=#=#=# Syncrun started 2022-10-31T21:55:05Z
#=#=#=#=# Propagation starts 2022-10-31T21:55:07Z (last step: 1771 msec, total: 1771 msec)

the nextcloud.log has this message:

{
  "reqId": "Y2BEO2rciF3muyD7udwG9AAAAAA",
  "level": 3,
  "time": "2022-10-31T21:55:17+00:00",
  "remoteAddr": "x.x.x.x",
  "user": "vincent",
  "app": "webdav",
  "method": "POST",
  "url": "/remote.php/dav/bulk",
  "message": "Unknown error while seeking content",
  "userAgent": "Mozilla/5.0 (Linux) mirall/3.6.1git (Nextcloud, opensuse-tumbleweed-5.19.13-1-default ClientArchitecture: x86_64 OsArchitecture: x86_64)",
  "version": "25.0.1.0",
  "exception": {
    "Exception": "Sabre\\DAV\\Exception",
    "Message": "Unknown error while seeking content",
    "Code": 500,
    "Trace": [
      {
        "file": "/var/www/html/nextcloud/apps/dav/lib/BulkUpload/MultipartRequestParser.php",
        "line": 129,
        "function": "isAt",
        "class": "OCA\\DAV\\BulkUpload\\MultipartRequestParser",
        "type": "->"
      },
      {
        "file": "/var/www/html/nextcloud/apps/dav/lib/BulkUpload/BulkUploadPlugin.php",
        "line": 71,
        "function": "isAtLastBoundary",
        "class": "OCA\\DAV\\BulkUpload\\MultipartRequestParser",
        "type": "->"
      },
      {
        "file": "/var/www/html/nextcloud/3rdparty/sabre/event/lib/WildcardEmitterTrait.php",
        "line": 89,
        "function": "httpPost",
        "class": "OCA\\DAV\\BulkUpload\\BulkUploadPlugin",
        "type": "->"
      },
      {
        "file": "/var/www/html/nextcloud/3rdparty/sabre/dav/lib/DAV/Server.php",
        "line": 472,
        "function": "emit",
        "class": "Sabre\\DAV\\Server",
        "type": "->"
      },
      {
        "file": "/var/www/html/nextcloud/3rdparty/sabre/dav/lib/DAV/Server.php",
        "line": 253,
        "function": "invokeMethod",
        "class": "Sabre\\DAV\\Server",
        "type": "->"
      },
      {
        "file": "/var/www/html/nextcloud/3rdparty/sabre/dav/lib/DAV/Server.php",
        "line": 321,
        "function": "start",
        "class": "Sabre\\DAV\\Server",
        "type": "->"
      },
      {
        "file": "/var/www/html/nextcloud/apps/dav/lib/Server.php",
        "line": 360,
        "function": "exec",
        "class": "Sabre\\DAV\\Server",
        "type": "->"
      },
      {
        "file": "/var/www/html/nextcloud/apps/dav/appinfo/v2/remote.php",
        "line": 35,
        "function": "exec",
        "class": "OCA\\DAV\\Server",
        "type": "->"
      },
      {
        "file": "/var/www/html/nextcloud/remote.php",
        "line": 171,
        "args": [
          "/var/www/html/nextcloud/apps/dav/appinfo/v2/remote.php"
        ],
        "function": "require_once"
      }
    ],
    "File": "/var/www/html/nextcloud/apps/dav/lib/BulkUpload/MultipartRequestParser.php",
    "Line": 111,
    "message": "Unknown error while seeking content",
    "exception": {},
    "CustomMessage": "Unknown error while seeking content"
  }
}

Basically: when I start the desktop client again, first I see the above message and then suddenly it's 100% CPU on the client side. Maybe it's not dealing with this error correctly ? Also unsure why there would be such error on the server side ?

Let me know where I should look if there's a way to provide more information.

@artonge @mgallien

PVince81 avatar Oct 31 '22 22:10 PVince81

I've just tried to make the server return a clean 400 Bad Request but the client still stucks at 100% CPU, so perhaps the error handling there has some issue or infinite loop of sorts.

The server side error seems to be about some problem in the multi part request.

Ah, and I just noticed that today I enabled the upload speed limitation and that it was reported to cause trouble also in the original report. @mgallien

PVince81 avatar Oct 31 '22 22:10 PVince81

I've restarted the client, paused the sync, then removed the upload and download speed limit, then resumed sync: no more issues

maybe there's something odd with the combination of bulk upload and upload speed limit I hope the speed limit implementation itself isn't somehow truncating multipart requests ?

PVince81 avatar Oct 31 '22 22:10 PVince81

The server is failing when trying to seek the stream backward. Two possibilities:

  1. Somehow, the stream content is not accessible anymore, not sure why this could happen.
  2. The fread call does not return false when reading further than EOF, but the fseek call return -1 when seeking back to an inaccessible offset.

artonge avatar Nov 02 '22 09:11 artonge

from my experience, doing an fseek backwards is often not a good idea as it can break on streams (not files)

PVince81 avatar Nov 02 '22 13:11 PVince81

Same thing here. Using Mac OS client.

Nowaker avatar Nov 03 '22 09:11 Nowaker

Same, CPU & RAM usage are really high and I just get "Network Error: 99" aswell

EDIT - I'm using Windows Desktop Client

The13thTimelord avatar Nov 06 '22 19:11 The13thTimelord

I'm also affected after upgrading to Nextcloud 25. Can confirm that disabling "upload limiting" in the desktop client makes this bug go away (but it then hoses my upload bandwidth to the point of making downloading impossible whenever I have a large upload).

NextCloud 25.0.1 Desktop Client Version 3.5.4 (Ubuntu) Ubuntu 20.04

Devonavar avatar Nov 09 '22 00:11 Devonavar

Any updates to this? Even in v3.6.2 the errors occur.

Der-K-2000 avatar Nov 13 '22 22:11 Der-K-2000

I can reproduce this bug and can confirm that removing the speed limit solves it. It is the combo of bulk upload + speed limits that cause this issue but it "just" looks like a bug in the client and server side the files had synchronised properly, still the client hangs with high cpu use.

avatar1024 avatar Nov 14 '22 14:11 avatar1024

I'm also affected after upgrading to Nextcloud 25. Can confirm that disabling "upload limiting" in the desktop client makes this bug go away (but it then hoses my upload bandwidth to the point of making downloading impossible whenever I have a large upload).

NextCloud 25.0.1 Desktop Client Version 3.5.4 (Ubuntu) Ubuntu 20.04

solves the issue for me !

Baeda73 avatar Nov 15 '22 14:11 Baeda73

I can confirm this issue and the solution of setting the Bandwidths to "No limit" on Debian Bullseye.

mayonezo avatar Nov 15 '22 16:11 mayonezo

Hello! I confirm the issue and the solution (disable bandwith limit") on Windows 10 21H2 with nextcloud client 3.6.2 and nextcloud 25.0.1.

pchesneau avatar Nov 16 '22 23:11 pchesneau

Hello! I confirm the issue and the solution (disable bandwith limit") on Windows 10 21H2 with nextcloud client 3.6.2 and nextcloud 25.0.1.

same here - solved the issue for me

mrothauer avatar Nov 20 '22 19:11 mrothauer

can confirm the issue on ubuntu 20.04 with client 3.5.4 (x86_64), when bw-limits are in place. I can also confirm, that it is server-dependant. i have 2 NC-Servers hooked up to my client. one with NC25, one with NC23. Neither of those have anything configured regarding bulk-uploads, but the Client only locks up, when a file would be synced to the NC25-Server (just a plain textfile of a few kB, nothing that would've been complicated to seek).

PS: because this box is unchecked in the OP: the NC25-Server uses LDAP as it's userbase.

zeus86 avatar Nov 22 '22 07:11 zeus86

I can confirm the issues on Ubuntu Mate 22.04 with the default client from the sources as well as the most recent version (3.6.2) from ppa:nextcloud-devs/client. Issues started happening once the server was updated to 25.0.1.

Disabling the bandwidth limits made the client sync again.

At first, I couldn't access the settings in the GUI, because it would freeze right after (re-)starting the client. So, to get to the settings, I edited the config file .config/Nextcloud/nextcloud.cfg where I set 0\Folders\1\paused=false to 0\Folders\1\paused=true. With the client launching in paused mode, I could access settings and disable the bandwidth limit in the GUI. Then I hit play and it synced fine.

hussong avatar Nov 23 '22 11:11 hussong

I can confirm the issues on Ubuntu Mate 22.04 with the default client from the sources as well as the most recent version (3.6.2) from ppa:nextcloud-devs/client. Issues started happening once the server was updated to 25.0.1.

Disabling the bandwidth limits made the client sync again.

At first, I couldn't access the settings in the GUI, because it would freeze right after (re-)starting the client. So, to get to the settings, I edited the config file .config/Nextcloud/nextcloud.cfg where I set 0\Folders\1\paused=false to 0\Folders\1\paused=true. With the client launching in paused mode, I could access settings and disable the bandwidth limit in the GUI. Then I hit play and it synced fine.

That's how i solved it, too.

zeus86 avatar Nov 23 '22 17:11 zeus86