-
Notifications
You must be signed in to change notification settings - Fork 308
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
Rancher Desktop 1.14.2 wiped my .zshrc file. #7154
Comments
I'm really sorry to hear that. This issue was supposed to be fixed in 1.12.2, and this is the first report that this has happened with any later release. Do you have any information on how to reproduce this? Is this reproducible on your machine? |
I only noticed it after around 3 hours of messing with Rancher Desktop - a series of factory resets, reinstalls, playing around with attempting to embed a CA, and some other stuff. My active terminal window lost its zshrc settings but I thought maybe it was just unloaded from that terminal session somehow so kept working and can't recall exactly what triggered it. Currently I don't have the time to reliably reproduce this, I'm raising this here in hopes that it can serve as a point of reference in case others run into the same thing. It replaced the contents with the following (Still available in my
|
I also faced the same issue on Mac M2. It can be reproduced with below steps
|
Thank you @amandeep-sharma — with those steps I can (sometimes) reproduce. I think it was easier for me to reproduce because that error case made shutting down faster, so it triggered the actual problem:
I think the most important change here is to avoid doing the write when we're starting to shut down. Also, we should look into doing the write atomically; I think that involves (at least on Linux) using file renames, and therefore bailing if the target file is a symlink or other non-normal files. |
Yes, and there needs to be some kind of mutex that prevents starting a shutdown while the write is in progress.
You could still fall back to the file copy when the rename is not possible. The important part is to keep a backup in place that will not be removed/overwritten even by repeated failed attempts to overwrite the original. |
Posted #7195 to at least not do the write on shutdown. I think we should do a bit extra to help with the data loss, though; I'm thinking of changing the existing logic to something like: (Edited to reflect the next four comments)
The main changes are:
Thoughts?** |
That is not really acceptable; it is a common use case1 to have config files in a Git repo, or shared cloud folder, and use symlinks to point to them. I think you can still follow the rest of your plan, except steps 8 and 9 need to be different when
You could also add an extra step 3.5 Verify that Another thing to add could be 8.5 Call I think step 3.5 and the alternate step 9 are paranoia, as long as the return codes of the Footnotes
|
I think 3.5 and I guess I can accept doing the alternate code path (not using a swap file) if the target is a symlink, though. |
It is a bit early to start bike-shedding about the filenames, but whatever, I'm already here:
Given that
If you really want to include the This also is more in line with your
The names should make sense to the user, who is already distressed about the original file missing/destroyed. They are unaware of the implementation details, so |
Oh, yeah, I don't actually plan to add a |
(Note that #7154 (comment) has been updated) Hmm, while writing a bunch of tests for this (haven't started on the implementation yet), I think there are some corner cases to think about:
|
I think we should leave the empty file. Another question though: if the symlink is dangling from the start, should we create the file? I would think it is better to throw an error, the same was as when the backup file already exists.
Probably not. Theoretically it guards against the editing producing a broken new version of the file by keeping a backup. But since we are going to delete it once the
On Linux you can use On macOS it will require some research; you can probably use I think it will be rather unusual to have xattrs and/or acls on the config files, and we could just disallow using "Automatic" path management in that case. Another thing I just thought about: we need to make sure the code works correctly if e.g. |
That means we will have to detect that there are things on the config files. That's going to be… annoying. On the bright side, though, I missed that This is incorrect: per the source, that just uses |
You can still do that with the commands I gave above. Or find a Node module, e.g. https://github.com/LinusU/fs-xattr for attributes; didn't find anything quickly for ACLs.
That is fine for macOS, but I wonder what it does on Linux. On btrfs and xfs it could to a reflink copy (don't know if it does). I think this is too much specialized logic for an edge case. Just more code that can have bugs. So I still think disallowing changes to path management when something unusual happens is the safest way:
In that case disable the path management checkboxes in the dialog and add a hover tip explaining the reason behind it. And force the setting in the app to "Manual" regardless what the actual file content is. |
Updated #7154 (comment) again. So (I'm avoiding |
This tests that the manageLinesInFile implementation corresponds to the algorithm specified in rancher-sandbox#7154 (in an attempt to reduce the chances of users losing data). Note that the implementation has not yet been updated, so this test is expected to fail. Signed-off-by: Mark Yen <[email protected]>
This tests that the manageLinesInFile implementation corresponds to the algorithm specified in rancher-sandbox#7154 (in an attempt to reduce the chances of users losing data). Note that the implementation has not yet been updated, so this test is expected to fail. Signed-off-by: Mark Yen <[email protected]>
This tests that the manageLinesInFile implementation corresponds to the algorithm specified in rancher-sandbox#7154 (in an attempt to reduce the chances of users losing data). Note that the implementation has not yet been updated, so this test is expected to fail. Signed-off-by: Mark Yen <[email protected]>
This tests that the manageLinesInFile implementation corresponds to the algorithm specified in rancher-sandbox#7154 (in an attempt to reduce the chances of users losing data). Note that the implementation has not yet been updated, so this test is expected to fail. Signed-off-by: Mark Yen <[email protected]>
This tests that the manageLinesInFile implementation corresponds to the algorithm specified in rancher-sandbox#7154 (in an attempt to reduce the chances of users losing data). Note that the implementation has not yet been updated, so this test is expected to fail. Signed-off-by: Mark Yen <[email protected]>
Actual Behavior
Unfortunately it seems this recurring bug is still around. I just lost my .zhrc and .bashrc at a minimum.
Didn't have a recent backup handy, my bad, but I had been installing Rancher Desktop to test as a replacement for Docker Desktop and the fact that this appears to be something the devs aren't able to fix on a permanent basis has been enough to put me off using it in the future.
Steps to Reproduce
N/A
Result
N/A
Expected Behavior
I shouldn't need to worry about losing my entire shell config when toying around with resets/etc using Rancher Desktop.
Additional Information
No response
Rancher Desktop Version
1.14.2
Rancher Desktop K8s Version
1.30.2
Which container engine are you using?
moby (docker cli)
What operating system are you using?
macOS
Operating System / Build Version
MacOS Sonoma, M3 Pro
What CPU architecture are you using?
arm64 (Apple Silicon)
Linux only: what package format did you use to install Rancher Desktop?
None
Windows User Only
No response
The text was updated successfully, but these errors were encountered: