nextcloud / desktop

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

[Bug]: Directory Symbolic Link _and_ Junction from a Nextcloud share to another Nextcloud share is synced on Windows, with errors #7157

Open Sieboldianus opened 2 months ago

Sieboldianus commented 2 months ago

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

Bug description

With the latest Nextcloud client on Windows 11, I started seeing upload errors with "unknown" in the client. After inspecting, I traced the errors to a Directory symbolic link I created from a share within my Nextcloud sync folder to another sync folder. I tested with Junctions and saw the same effect.

Steps to reproduce

  1. Create a NTFS Directory symbolic link with mklink /D from a folder that is synced to a Nextcloud server to another folder that is also synced to the same Nextcloud server
    mklink /D C:\Users\user\nc_share1\junction_folder C:\Users\user\Nextcloud\nc_share2\junction_folder_target
    symbolische Verknüpfung erstellt für C:\Users\user\nc_share1\junction_folder <<===>> C:\Users\user\Nextcloud\nc_share2\junction_folder_target

The same applies to Junctions:

mklink /J C:\Users\user\nc_share1\junction_folder C:\Users\user\Nextcloud\nc_share2\junction_folder_target
Verbindung erstellt für C:\Users\user\nc_share1\junction_folder <<===>> C:\Users\user\Nextcloud\nc_share2\junction_folder_target
  1. Observe Nextcloud attempting to upload files again grafik

  2. Observe Nextcloud to fail after scanning files with "Unknown Server error"

grafik

I have both folders as individual shares: grafik

Other observations:

Expected behavior

Directory Junctions are not synced, as is documented.

Which files are affected by this bug

ExpNature1to5.pdf

Operating system

Windows

Which version of the operating system you are running.

Windows 11

Package

Official Windows MSI

Nextcloud Server version

28.0.9

Nextcloud Desktop Client version

4.14.0

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

Updated from a minor version (ex. 3.4.2 to 3.4.4)

Are you using the Nextcloud Server Encryption module?

Encryption is Disabled

Are you using an external user-backend?

Nextcloud Server logs

No response

Additional info

No response

stevehuk commented 2 months ago

I recently saw something that also looks to be related to this issue.

On a windows laptop, "My Documents" and "My Pictures" are synchronised to the sever to separate folders. Since the installation of 3.14.0, the 'My Documents' sync included the standard hidden junctions: "My Music", "My Pictures" and "My Videos". Some files in both "My Music" and "My Pictures" were sent to the server with also some "Unknown server errors" in the log.

When I checked https://github.com/nextcloud/desktop/issues/4770, it describes local junction contents being deleted if they are removed from the sync list so for now I just added the folders to the exclude list.

My investigation was prompted by some performance issues where I saw nextcloud taking more CPU then usual and also being unresponsive whilst opening the drop down list of folders in the sync connection. Reverting to 3.13.4 avoids any performance issues.

I can collect more detailed logs if they would be useful.

plauderer commented 1 month ago

I recently saw something that also looks to be related to this issue.

On a windows laptop, "My Documents" and "My Pictures" are synchronised to the sever to separate folders. Since the installation of 3.14.0, the 'My Documents' sync included the standard hidden junctions: "My Music", "My Pictures" and "My Videos". Some files in both "My Music" and "My Pictures" were sent to the server with also some "Unknown server errors" in the log.

When I checked #4770, it describes local junction contents being deleted if they are removed from the sync list so for now I just added the folders to the exclude list.

My investigation was prompted by some performance issues where I saw nextcloud taking more CPU then usual and also being unresponsive whilst opening the drop down list of folders in the sync connection. Reverting to 3.13.4 avoids any performance issues.

I can collect more detailed logs if they would be useful.

I just ran in to the very same issue with a fresh Windows 11 24H2 installation and desktop client v3.14.1.

4770 was just recently closed without reference to any fix

Update: I tried another time and reproduced the issue with Windows 24H2 and Nextcloud Client v3.14.1

  1. In a fresh profile the folder Documents includes three junction points: Image

  2. When adding a sync between local and remote "Documents" folder the junction points for "My Pictures" a.s.o. will get created as subfolder in the remote documents folder

  3. Trying to avoid this by adding the folders in ignore list didn't help for me.

It seems to me that symbolic links / junction points in Windows aren't ignored anymore by default. Cleaning this up is turning into a nightmare as I'm usually syncing the very same folders from multiple clients.

At the moment I'm stuck. Please help!

woody30r0 commented 1 month ago

Same here with at least Windows 10 22H2 (OS Build 19045.4529) and at least Nextcloud client 3.14.1.20240927. Happens (at least) with the "My Pictures" junction point. Stopped synchronization immediately, but I assume this will be the same for the other junctions. Image Image Image Image Image

woody30r0 commented 1 month ago

I reverted back to "Version 3.13.4stable-Win64 (build 20240912)" (3.13.4.20240912) on the same machine (and disabled automatic updates - see "Preventing Automatic Updates" at https://docs.nextcloud.com/desktop/3.14/autoupdate.html). It now works again as expected. Junction points are being recognized correctly and not being synchronized twice. This seems to be an issue with 3.14.x only (Product Version: 3.14.1.20240927 and/or 3.14.0.20240914 (not verified explicitly with this previously installed version), Product Language: 1033) .

CorneliousJD commented 3 weeks ago

Confirming I've noticed this in 3.14.x as well - junction mishandling caused massive data loss of family photos for me...

CorneliousJD commented 3 weeks ago

Seems confirmed this was an issue with the .lnk handling in 3.14.x see here https://help.nextcloud.com/t/did-the-junction-folder-handling-changed-in-the-windows-client/207362

tairabiteru commented 2 weeks ago

Also confirming I see this issue in 3.14.x. Took me quite a long time to realize it was Nextcloud that was doing it though. It effectively caused the deletion of all of my pictures, videos, and music, but fortunately I had a snapshot backup system in place that I was able to restore from.

philipgo commented 2 weeks ago

This is outrageous. The Nextcloud client for Windows and thus my entire installation have been unusable for weeks.

How do I get out of this? Where can I find previous versions of the Windows client? I assume 3.13.3 is the last version without this bug, correct?

CorneliousJD commented 2 weeks ago

This is outrageous. The Nextcloud client for Windows and thus my entire installation have been unusable for weeks.

How do I get out of this? Where can I find previous versions of the Windows client? I assume 3.13.3 is the last version without this bug, correct?

First, in 3.14.x turn off the option to auto check for updates.

Then uninstall and install 3.13.4 from here https://download.nextcloud.com/desktop/releases/Windows/

Don't update until they fix this then. That's what I'm doing and it's okay for now.

philipgo commented 2 weeks ago

It deleted all my photos and videos, what a mess.

@Rello This is a fatal bug! Who can do something about it?

philipgo commented 2 weeks ago

How do I get rid of this in the meantime? All measures described in the documentation to prevent automatic updates appear to only prevent the check for new versions. However the new version has already been downloaded and Nextclouded continues to attempt to install it.

Image

CorneliousJD commented 2 weeks ago

How do I get rid of this in the meantime? All measures described in the documentation to prevent automatic updates appear to only prevent the check for new versions. However the new version has already been downloaded and Nextclouded continues to attempt to install it.

I have already mentioned this First, in 3.14 turn off the option to auto check for updates. Download the latest 3.14.x version, install it, then turn off the auto update check option. Once you're on the latest version, turn off the auto update check, uninstall, then install 3.13.4

tairabiteru commented 3 days ago

Just noting, I just got a new computer today and installed Nextcloud 3.15.0. I've just been manually synchronizing my Documents folder since this bug was found, and today I got this message while synchronizing: Image It's not even been a day yet and previously this issue took a while to manifest, but I did not notice this message before when running 3.14.x. It's possible 3.15 fixes this issue.

tairabiteru commented 2 days ago

Just noting, I just got a new computer today and installed Nextcloud 3.15.0. I've just been manually synchronizing my Documents folder since this bug was found, and today I got this message while synchronizing: Image It's not even been a day yet and previously this issue took a while to manifest, but I did not notice this message before when running 3.14.x. It's possible 3.15 fixes this issue.

Image And, strike that. Issue is present in 3.15.0 as well.