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

[Bug]: Removing a directory containing directory junction results in data loss #4770

Closed
1 task done
Amunak opened this issue Jul 22, 2022 · 6 comments
Closed
1 task done

Comments

@Amunak
Copy link

Amunak commented Jul 22, 2022

Bug description

Removing a synced directory that contains a directory junction recursively deletes content within that directory junction, resulting in file removal (data loss) outside the Nextcloud-managed (synced) folder.

I feel like #4232 should be a much higher priority.

Steps to reproduce

  1. Have a directory structure with valuable data somewhere on your PC and create an NTFS Directory Junction in your Nextcloud folder:
D:
|-data
| `-subfolder
|   `-valuable data.txt
`-Nextcloud
  `-whatever
    `-junction to D-data
  1. Wait for it to sync and observe that the junction is (correctly) not synced, so on a synced system or web only an empty folder whatever/ exists. This to me indicates that Nextcloud knows it's a junction and doesn't want to touch it, which is intuitive and expected.
  2. On a different synced system or from Nexctcloud FIles on Web remove folder whatever.
  3. Observe that folder D:\\Nextcloud\\whatever correctly disappeared. More importantly observe that D:\\data\\subfolder disappeared as well, and that your valuable data are gone.

Expected behavior

The directory junction should be removed (unlinked), but the data inside must not be deleted.

Alternatively not deleting the junction or the parent folder and only emitting an error and not syncing the parent folder would be acceptable as well.

Which files are affected by this bug

whatever

Operating system

Windows

Which version of the operating system you are running.

Windows 10

Package

Official install

Nextcloud Server version

23.0.5

Nextcloud Desktop Client version

3.5.2

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

Updated to a major version (ex. 3.3.6 to 3.4.0)

Are you using the Nextcloud Server Encryption module?

Encryption is Disabled

Are you using an external user-backend?

  • Default internal user-backend
@Rello
Copy link
Contributor

Rello commented Oct 9, 2024

Hello,

thank you for reporting this issue.

This issue was reported long time ago on old versions and we improved a lot since then.
If the error shows up again, please open an issue for the current versions.

@Amunak
Copy link
Author

Amunak commented Oct 10, 2024

Sooo you created an automated test for this to make sure it'll never happen again, right?

...right??

@plauderer
Copy link

another issue with junction points have been posted at #7157
A confirmation that the issue in #4770 was resolved would be nice!

@gerroon
Copy link

gerroon commented Oct 22, 2024

NC didn't use to sync Windows junction folders, which I liked a lot. Did this behavior change? It looks like it is synching them now and this should be optional given it changed an existing behavior. I am using client 3.14.1

@CorneliousJD
Copy link

Yes, #7157 is indeed a junction issue again - specifically inside the "Documents" folder there's "My Pictures" and "My Videos" and "My Music" junctions that are causing data loss too -- I am a victim of this and family photos have been lost now, thankfully I do have some backups but this is a very disastrous issue right now

@tairabiteru
Copy link

Issue is also present in 3.15.0.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

7 participants