Skip to content

Out of sync calculation for remote devices becomes odd in three-device setup with middle one ignoring files #7474

Description

@tomasz1986

I'm sorry for the title, but I'm not sure how to describe this. For reference, see https://forum.syncthing.net/t/folder-stuck-in-sync-and-non-matching-local-and-global-states/16431.

  1. Add a new folder with some files on Device A.
  2. Share the folder with Device B.
  3. When adding the folder on Device B, ignore everything with *.
  4. Share the folder from Device B to Device C.
  5. Device B is now stuck trying to push the ignored files to Device C.

Device A:

1

Device B:

2

Device C:

3

Activity

  1. added
    bug
    needs-triage
    on Mar 14, 2021
  2. calmh commented on Mar 14, 2021

    @calmh
    Member

    If you add a single non-ignored thing on the middle device, does that change the situation?

  3. tomasz1986 commented on Mar 14, 2021

    @tomasz1986
    MemberAuthor

    Not really. The newly added file does get synced from B to C, but the rest looks exactly the same as before.

    The number of Out of Sync Items is also strange. It seems that it includes files that existed in the past, and were ignored at that time, but are long gone now. Currently the only files that exist are 50 files on Device A (plus the 1 file created on B for testing purposes right now). The other 450 files listed below were deleted previously and are no longer present.

    image

  4. calmh commented on Mar 14, 2021

    @calmh
    Member

    Weird.

  5. tomasz1986 commented on Mar 14, 2021

    @tomasz1986
    MemberAuthor

    Yeah, although the number is likely because I reused my test folder. Normally, there should be just the currently existing 50 files stuck in sync.

  6. imsodin commented on Mar 14, 2021

    @imsodin
    Member

    This is https://forum.syncthing.net/t/folder-stuck-in-sync-and-non-matching-local-and-global-states/16431/14, right?

    The reason is that we have an "efficiency" measure: We do not pull items that are not present at all locally and globally invalid or deleted. B sees valid items from A, thus their global is valid. C only sees invalid items from B, thus their global is invalid and they don't pull. B doesn't know about C's global, thus shows C as out of sync. The fix here is to always pull invalid files ("pull" as in create a local invalid entry too).

  7. calmh commented on Mar 14, 2021

    @calmh
    Member

    Alternately we could just document that this happens and say not to do it.

  8. tomasz1986 commented on Mar 14, 2021

    @tomasz1986
    MemberAuthor

    Alternately we could just document that this happens and say not to do it.

    What should be done in this situation though?

    The only workaround that I can think of would be to connect Device A with Device C directly, which in this particular case I cannot do, as Device A is someone else's machine, outside of my control.

    I have also tried using the same ignore patterns on Device C, but it doesn't change anything either.

    Edit: I just wanted to say thank you very much @imsodin for such a quick fix! 🙂

  9. added a commit that references this issue on Mar 14, 2021
    c9f0f21
  10. added this to the v1.15.0 milestone on Mar 17, 2021
  11. reopened this on Apr 29, 2021
  12. removed
    needs-triage
    on Apr 29, 2021
  13. calmh commented on Apr 29, 2021

    @calmh
    Member

    Not easy to fix, it turns out.

  14. removed this from the v1.15.0 milestone on Apr 29, 2021
  15. galilley commented on Aug 3, 2021

    @galilley

    Just out of curiosity, are you going to fix it?

  16. added a commit that references this issue on Aug 18, 2021
    309ded1
  17. thomasmerz commented on Aug 9, 2023

    @thomasmerz
    Sponsor

    If you add a single non-ignored thing on the middle device, does that change the situation?

    I had a similar problem ("no connected device has the required version of this file" which never ended) with ignore-patterns **(?d).DAV/ and a three-way-sync (because one of these devices is "gone" forever). After removing the "gone" device my problem vanished. Thanks for your hint here 😃

  18. rieje commented on Apr 1, 2025

    @rieje

    Is it possible to check for sync completeness as "100%" when sync % is maxed out at 99% because ignored directories are considered out of sync? I am trying to use the API to reliably ensure sync is complete--the ignored directories can be considered "synced". Merely checking for 99% is not good enough if I have a large set of files as real (non-ignored) out-of-sync files may still contribute to a 99% completeness.

    My issue is with #9804 that's marked as a duplicate of this issue.

  19. added theissue type on May 30, 2025
  20. changed the title [-]Device tries to push ignored files to a remote device in a 3-device setup[/-] [+]Out of sync calculation for remote devices becomes odd in three-device setup with middle one ignoring files[/+] on Jun 8, 2025
  21. calmh commented on Jun 8, 2025

    @calmh
    Member

    I was looking at this issue again because it came up in another bugfix for v2. I think we could "resolve" this in v2 now, but if/how we do so is really more of a philosophical question – what does it mean for a device to be in sync / out of sync as reported in the GUI?

    Currently, it answers the question "what does this device report compared to the known global state". In that worldview the current behaviour is correct: the other device is entirely out of sync, because there are a lot of files it can't sync, because we can't serve them, because we've ignored them. We close this issue as functions-as-designed. (The behaviour is the same in v2 as v1 currently, not because I made it that way explicitly but because it kind of comes out of the general principles.)

    Instead, we could consider a remote device in sync if it has all the same files and versions that we do. In that case the remote device would look in sync – it has no files, we have none to give it, it's all fine. It would also change things under normal operations. Currently, when we get an update for a file we mark both ourselves and other peers as out of sync until they've synced that file. With this change we'd mark ourselves out of sync, but other peers would remain "in sync" until we've synced the changed file, at which point they would become out of sync until they do the same...

    The second alternative is a trickier worldview as we no longer get to compare to a single state, but to a multitude of different ones. We can't just say "needs to be the same as us" because we might be the one out of sync, so we need to take into account their files might be newer. But then we might have two peers who both have newer files than us, but different compared to each other. Currently, we'd compare against the global and say one peer is in sync and the other isn't. If just comparing to ourselves, they would both be newer and both in sync – but not with anything else really...

  22. danielo515 commented on Aug 18, 2025

    @danielo515

    I am facing a similar situation, which involves ignore lists but only two servers. After setting my ignore list in my target server I get them up to date, but because of the missing files that are excluded by ignore list, they think they are out of sync. This is between two servers, let's say A and B, but I have A sync to many servers (C,X,Y) with the same settings and no problems. Let me know if I need to provide more details. I have a topic open in the forum but nobody answers

  23. aressler38 commented on Aug 21, 2025

    @aressler38

    I've run into this too with three machines: A <- B -> C, but A and C are not connected and don't know about each other. Device A is a Windows host. Device B is a Linux host, and device C is a Mac OS host. I discovered .DS_Store files showing up in B and A. I disconnected everything and wiped out the states to start from scratch, but this time I added .DS_Store to the ignored files on B. Then I joined A and also ignored .DS_Store. Then I joined C, but from B's perspective, A is out of sync because C puts .DS_Store files there. I don't have full control over C, so it would be nice if I could push the ignore list to C, which I don't have full control over, or have B understand that A doesn't want ignored files and omit them from the "out of sync items" calculation. Alternatively, issue #10208 discusses ignoring commonly ignored files, and that'd probably solve it for my situation but not in general.

  24. Railander commented on Dec 14, 2025

    @Railander

    If you add a single non-ignored thing on the middle device, does that change the situation?

    I had a similar problem ("no connected device has the required version of this file" which never ended) with ignore-patterns **(?d).DAV/ and a three-way-sync (because one of these devices is "gone" forever). After removing the "gone" device my problem vanished. Thanks for your hint here 😃

    exactly what just happened to me and exactly how i solved it.

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    bug

    Type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions