nextcloud / desktop

💻 Desktop sync client for Nextcloud
https://nextcloud.com/install/#install-clients
GNU General Public License v2.0
2.97k stars 784 forks source link

[Bug]: Windows Desktop Client UI completely unresponsive during preparation for sync #5031

Open electrocnic opened 1 year ago

electrocnic commented 1 year ago

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

Bug description

The UI of the client is unresponsive (see screenshots). Sometimes, when the connection times out (indicated by a grey symbol and a timeout error message), the UI is normally responsive again. I have to wait for several minutes until the UI pops up after I once click on the nextcloud icon when it is in either state "preparing for sync" or "Waiting to start syncing".

I even tried to delete all nextcloud database files from the folder to be synced, i.e. .sync_2e9e607b5567.db and *.db-wal and so on PLUS deleted the nextcloud cache in AppData, restarted the app and it freezes again. Interestingly, a TestFolder with just one very small txt file (containing only "test" as text and the file itself called "test.txt") worked immediately and was successfully synced to the server. The Folder I actually want to sync contains 1.477.544 Files in 232.580 Folders, and is only 84,3 GB (90 590 769 152 bytes) in size. This should not be an issue, especially because 9/10 from that should be ignored by the ignore list of the nextcloud client. I had this folder already completely synced in my old nextcloud server instance but wanted to migrate to a new one, therefore a wanted to freshly sync the folder and uninstalled and reinstalled the client completely.

Also I observed, that the Windows explorer itself is frozen by nextcloud when it tries to prepare for sync. As soon as I kill nextcloud, the Windows Explorer is responsive again.

EDIT: I deleted half of the files, in the hope to speed up the process a little bit, and it now worked after 1h of preparation for sync the files are now indeed syncing and the UI is responsive again. Therefore: The UI seems to be responsive while syncing, but the initial process when a new Folder is added to the list ("preparation for sync") seems to be implemented very inefficiently.

Steps to reproduce

  1. Installed nextcloud client on my Windows 10 PC
  2. Added connection to my server with https and login credentials
  3. Skip folder sync to add individual folders later
  4. Added folder sync for one specific folder on the Windows host and one specific folder on the nextcloud server
  5. The UI freezes, but the Task Manager indicates that the client is working in the background (see screenshots), due to high CPU usage and Disk operations.
  6. Clicking (either right or left click) on the nextcloud icon in the hidden icons menu of the Windows Search Bar does not respond in any way, but after several minutes, the window pops up. The window itself does not respond either.
  7. Sometimes a server timeout happens. Then the UI is responsive again until a re-login freezes the UI again.

Expected behavior

UI should be always responsive, no matter how busy the thread in the background currently is. UI should be implemented in a separate thread than other tasks.

Which files are affected by this bug

no files

Operating system

Windows

Which version of the operating system you are running.

Windows 10, windows-10.0.19044

Package

Other

Nextcloud Server version

24.0.6

Nextcloud Desktop Client version

3.6.0

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?

Nextcloud Server logs

No errors related to the syncing process (only login token errors when I manually logged in to the webservice).

Additional info

nextcloud_ui_freeze_1 nextcloud_ui_freeze_2 nextcloud_ui_freeze_3 nextcloud_ui_freeze_responsive nextcloud_ui_freeze_responsive_2

Download debug-archive.zip: https://www.file-upload.net/download-15019081/nextcloud_client_debug-archive.zip.html

Thranthir commented 1 year ago

Hello,

I see the same problem.

The client freezes as the synchronization starts.

I stopped the sync in the short time after starting the nextcloud application.

Then I removed the Dir sync settings, deleted all local files and added it again.

but it still crashed when I change a file.

Nextcloud Server Version: Nextcloud Hub 3 (25.0.0) Nextcloud Windows Desktop Client: 3.6.1

leegarrett commented 1 year ago

Commenting on this bug report, since it seems to match the symptoms the closest:

Upon start, the desktop application completely freezes (no possibility to open it from the systray) and uses a high amount of CPU. It does not recover after several hours of leaving it. To make matters worse, it blocks opening the File Explorer until I kill the nextcloud process via task manager. And to complicate things further, running nextcloud.exe --logwindow opens up a log window, but immediately freezes the application with no log output.

As a workaround, disabling bulkupload on the server seems to alleviate the issue, though that's far from ideal.

electrocnic commented 1 year ago

I also have a possible idea for another reason of freezing (unverified): It seems that conflicts might lead to this: It seems there could be a deadlock or something when the client tries to upload or download conflicted files again and again because: I use a Windows and a Linux client and there might always be different line endings afterwards no matter how often one of the clients uploads or downloads the conflicted duplicates.

Nextcloud should implement something like git, where line endings are normalized on the server and only updated for the OS-depending local downloads.

But as said: unverified, it might not be the case at all, it is just a possible idea. Don't know how many people use nextcloud with two different OSes.

leegarrett commented 1 year ago

I use a Windows and a Linux client and there might always be different line endings afterwards no matter how often one of the clients uploads or downloads the conflicted duplicates.

nextcloud neither cares about line endings, nor should it touch them. That might have been appropriate in ancient FTP times, but not in 2022.

RobertoMaurizzi commented 1 year ago

Commenting on this bug report, since it seems to match the symptoms the closest:

  • Running nextcloud server 25.0.1
  • Nextcloud Desktop Client 3.6.2 (on Windows 10)

Upon start, the desktop application completely freezes (no possibility to open it from the systray) and uses a high amount of CPU. It does not recover after several hours of leaving it. To make matters worse, it blocks opening the File Explorer until I kill the nextcloud process via task manager. And to complicate things further, running nextcloud.exe --logwindow opens up a log window, but immediately freezes the application with no log output.

As a workaround, disabling bulkupload on the server seems to alleviate the issue, though that's far from ideal.

Pretty much what I see on my laptop since a few months ago, unsure if it started "randomly" or when I upgraded to 25.0.x and 22H2 because I did both in 48 hours and then it started.

OwnCloud's client does work (with the same 25.0.x server and files).

Thranthir commented 1 year ago

Hello all,

disabling the bulkupload described in https://github.com/nextcloud/desktop/issues/4106#issuecomment-1302736545 helped on my side.

Not the best solution, but it's a workaround.

Regards Dean

vindic commented 1 year ago

I have the same problem since I have upgraded the Nextcloud server to 25.x on different instances.

The probleme occurs with different machines on Windows 11 and 10.

It's look like it concerns the association of the client sync and the version of the server.

For example with a client in 3.4.x it was working well with a server in 25.x

For another machine with a client on 3.5 the problem came with the new version of the server.

I have solved the problem on one machine installing and desintalling the sync application but I don't know exactly what did the trick.

Update : I have solved it, uninstalling the client and reinstalling the last version it on three other machines. I don't have a clue about what exactly is happening.

electrocnic commented 1 year ago

Re-assessing the problem, it seems to occur for specific files only, but I do not know which ones yet.

However, it uploads and downloads several hundret MB of data until it suddenly freezes. I closed the client for 2 weeks because of this annoyance, and hence I gathered about 200MB of data on my linux computer which got synced to the server.

I now reactivated the client on my Windows computer and it synced 200MB but froze for the last 8MB.

I have the same issue for different synced folders.

It really seems to boil down to some specific files.

I also tried to delete all conflicted local copies, but that did not resolve the problem.

electrocnic commented 1 year ago

I have finally found a workaround / interesting bug insight:

The error only happens during uploads but that might be because I have already synced all downloads and cannot verify the below steps for downloads as well: It seems to be tied to the setting "Automatically Limit Upload"

When I switch to "No limit", the upload starts, BUT: The displayed amount of bytes is weird, as you can see in the video.

When I switch back to "automatically limit" the client freezes again.

https://user-images.githubusercontent.com/13003800/206772710-bbf17bc3-a513-4218-98c1-a0e571b1f4db.mp4

This has been tested with the latest update for the client.

RobertoMaurizzi commented 1 year ago

The error only happens during uploads but that might be because I have already synced all downloads and cannot verify the below steps for downloads as well: It seems to be tied to the setting "Automatically Limit Upload"

I confirm that removing the upload limit (and the download one too, just to be sure) fixed the problem in my case too.

bitwolfe commented 1 year ago

I'm running Nextcloud 25.0.2 and yesterday downloaded the Windows client on my Win11 PC after successfully using the MacOS client just minutes before without issues. But on Win11 I'm seeing the same freezing issues reported here where Windows Explorer and the Nextcloud client locks up completely for 10-30 seconds at a time. All while watching the memory usage of the Nextcloud client climb at a rapid ~40MB/s. Adding or removing the limit makes no difference in my case. And I'm only trying to sync roughly 1GB of data.

image

Japaanc commented 1 year ago

Same with me, NC 25.0.2 Nextcloud Desktop Client Version 3.6.4 (Windows) Win 11, 22H2 build 22621.963

Yesterday for the first time played with speed limitations, and Client froze and gave response only for couple of seconds after desktop client start. Thanks to @electrocnic comment, switched to "no limit" both "up & down". And no freezing anymore.

For me there was few hundred GB data to sync (upload) to server

cerebellum92 commented 1 year ago

I have the same issue NC 25.0.5 Nextcloud Desktop Client Version 3.6.4 (Windows)

I downgrade the desktop client to 3.3.6 and the issue just disappear. I don't have this issue with the MacOS client.

ssancese commented 1 year ago

Same issue here server 25.0.2 win 3.6.4 client Disabling speed limits does not help.

Sieboldianus commented 1 year ago

Can confirm: Just updated my server from 24.0.9 to 25.0.3 and now my windows client also freezes upon start.

I tested to revoke Desktop client access - afterwards, the client would open again without freezing. Signing in again, immediatly afterwards when the sync starts, the app freezes again.

I think this is a critical issue, since a) I cannot sync anymore and b) there's no workaround.

Some observations:

alexjung commented 1 year ago

Luckily, I found this issue yesterday after having this problem for a week or so, and I can confirm that removing the network bandwidth limit allows the client to sync again.

Additionally, I want to add that if you can't even get into the settings UI (because it is immediately unresponsive), you can change the variable paused=false to paused=true in C:\Users\USERNAME\AppData\Roaming\Nextcloud\nextcloud.cfg before starting the client. This pauses the synchronization and the UI remains responsive until you unpause the synchronization again.

Maybe this helps someone with less "technical" knowledge to apply the workaround without the need to revoke the client access.

dilmash commented 1 year ago

I can confirm @alexjung's comment and workaround. I have exactly the same problem, probably after changing the server to version 25.0.2. After removing all upload and download limitations, the client is working again.

Manuel5cc commented 1 year ago

I can confirm that I have found this issue too. For my case to disable the up/down limitations was not a possibility so I tried the second option.

Disabling bulk upload like described in #4106 has worked for now.

cdnvn commented 1 year ago

I had a freezing issue syncing to my v25.03 Windows/WSL2 server after my desktop client upgraded to v3.7.X. Downgraded client back to v3.6.6 and the sync is now working as it was before the upgrade.

jimvanm commented 1 year ago

Windows client 3.7.3 Server 25.0.3 Same issue. Client is locked up in the tray. High CPU but nothing is happening. I set it to 'paused' in the config file. That allowed it to start. I removed bandwidth limits. Problem resolved

RealStickman commented 1 year ago

Changing from "Automatically Limit Upload" to "no limit" worked for me.
Never would have thought of that.

Windows client: 3.7.4 Server: 25.0.4

blitzdesigner commented 1 year ago

The Setting "No Limit" for upload helped to solve my issue too. Windows Client 3.8.1 Server: 25.0.5

Hellohi3654 commented 11 months ago

This is still an issue Can't believe it still hasn't been fixed with the number of updates the app gets

marxphil commented 10 months ago

Can confirm the "No Limit" Workaround.

Windows Client 3.10.1 Server: 27.1.2

GerardPolloRebozado commented 8 months ago

I have same issue I think its a Windows problem cause I was tired of having the same problem with OneDrive so decided to migrato to NextCloud and it has the same issue so maybe the problem is not the app?

deepwather commented 8 months ago

I have same issue I think its a Windows problem cause I was tired of having the same problem with OneDrive so decided to migrato to NextCloud and it has the same issue so maybe the problem is not the app?

I had exactly the same problem as well an freezing "explorer.exe", when right-click on files. As well, with my complete fresh installed Windows 11, as soon as I installed the Nextcloud-Client the problem was back. The solution for me, was to deactivate the "explorer integration" from Nextcloud-Client. Found here: image

GerardPolloRebozado commented 8 months ago

If I do this how I see my files from nextcloud?

deepwather commented 8 months ago

If I do this how I see my files from nextcloud?

You could simply pin your Nextcloud folder to your Explorer favorites. -> This is how I do it :) cheers

GerardPolloRebozado commented 8 months ago

I thought this option doesn't let you see nextcloud files from windows explorer. If I can still see them when I pin it what does this check makes?

TigerwareDev commented 7 months ago

For me both solutions did not work. The UI and Upload process were very unresponsive for most time. Configuring anything was difficult. But what worked, was disabling virtual files, as described in this issue: https://github.com/nextcloud/desktop/issues/6357

litetex commented 3 months ago

So this is still a valid issue for Client 3.13 on the latest Windows 10. Client get's stuck on 100% CPU usage on a single core (in my case ~8% total CPU) and it looks like it's also blocking some administrative Windows functions, e.g. opening the CMD as admin is not possible when this happens. Might be a Windows bug or something windows specific...

Bluejanis commented 2 months ago

@litetex Have you tried disabling virtual files?

litetex commented 2 months ago

@litetex Have you tried disabling virtual files?

Yes the problem occured when I had virtual files disabled (didn't check if it also happens when they are enabled)

RobertoMaurizzi commented 2 months ago

Yes the problem occured when I had virtual files disabled (didn't check if it also happens when they are enabled)

@litetex everybody else in this issue doesn't have the problem when virtual files are disabled. Are you sure you did disable them? If you find it difficult because the system freezes, try disconnecting the network before opening the settings, that way the bug doesn't trigger and you can save the client's settings properly.

Raider2000 commented 1 month ago

I have finally found a workaround / interesting bug insight:

The error only happens during uploads but that might be because I have already synced all downloads and cannot verify the below steps for downloads as well: It seems to be tied to the setting "Automatically Limit Upload"

When I switch to "No limit", the upload starts, BUT: The displayed amount of bytes is weird, as you can see in the video.

When I switch back to "automatically limit" the client freezes again. nextbug.mp4

This has been tested with the latest update for the client.

I have the same or a similar issue and this workaround also works for me. Thanks for sharing and hopefully the underlying bug will be fixed soon.