-
-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
Incorrect local state when using !
negated ignore patterns combined with parent folder ignored
#8735
Comments
I don't think this is incorrect; the folder is ignored and shouldn't be included. What happens on the other side is that the folder is created because it's required for the file to be able to exist, and then it's discovered locally on the next scan because it's not ignored on that side. If the other side is receive only things will get confusing, I agree. The directory isn't supposed to exist, but it must, and this does not compute 🤖 What you're imagining is that unignoring a file should unignore all the parent dirs, and perhaps that's what should happen, but it's not (and would be tricky to implement). The difference might not be visible for the most part, but things like permissions and extended attributes won't be the same on that parent directory, since it's in fact ignored and not synced. |
But I think this is exactly what is supposed to happen normally 🙃. In fact, I've just found my old issue about basically the same thing at #7740 which I forgot about and which was supposed to be fixed by @imsodin a long time ago. On top of that, the steps to reproduce are actually almost identical as in here. However, it seems that something still triggers the same issue… 😕. The difference between the old issue and this one is that there the problem happened every time. Here, as mentioned above, one step is missing but I'm unable to figure out what it is exactly. It is recorded in the logs though. |
I'd just like to add a comment on this point. The thing is that the folder is ignored on that side too (see step 3. in the OP)! The ignore patterns are the same, yet the behaviour is different. |
That's odd. |
I this this depends on the events going on inside the folder, e.g.
and so on, and at some point we end up with the state as in the last screenshot 🙁. |
More testing, and I've managed to trigger the issue almost immediately this time. I'm attaching new logs below, as they're super short compared to the original ones, so they should be much easier to analyse. I think this may be the exact moment the folder was ignored and removed from the local state.
|
I became somewhat fed up with the folders being constantly stuck in this "fake" Local Additions state, so I've managed to find a clunky workaround for this issue. Basically, if instead of
you do
and so on, then the parent folders will be unignored and "synced". Of course, this is only viable if the folder structure is known and fixed. |
I believe this is likely responsible for the long-term issue I've been experiencing since basically forever which leads to non-matching local and remote folder states despite using the exact same ignore patterns on both sides.
file.txt
is present inside/folder
, the folder should be included in the local state as well, however in reality only the file is. Once this happens, neither rescanning the folder nor restarting Syncthing repairs the broken local state.There is a caveat though. The steps above aren't complete. I've just managed to reproduce this in my test environment and I'm attaching logs with
model,db
enabled below, however in my testing I was repeatedly creating and removing folders and files in order to find the culprit. While doing so, I eventually managed to reach the state as seen above, but I can't reproduce it at will directly yet.The logs should contain the relevant information though. They aren't very large either, as the whole testing took less than 10 minutes or so.
syncthing1.log
syncthing2.log
For the record, I think the actual synchronisation still functions fine despite the incorrect local states. However, I've encountered problems with Receive Only folders being stuck in a permanent "Out of Sync" state which I believe is likely related to this very bug. I still haven't been able to reproduce that one in my test environment though.
The text was updated successfully, but these errors were encountered: