Panic: bug: unknown device should already have been rejected

Hey everyone,

I got another panic with “bug” in the description and thought it might help you to fix it. It appeared on several but not all devices at a similar time. This happend on two unrelated shared folders. Once on Windows and once on Linux.

syncthing_panic_bug_unkown_device.log (45.8 KB)

Should I open an issue on github for it?

Once again, thanks for reporting! And yes, please open an issue.

And just out of curiosity: You said that you manage a pretty dynamic (as in lots of changes) pool of devices - is it also a huge amount of devices? I am asking because all the panics you report could affect anyone, but you report all of them :smiley:

Looks like a race condition with a connection for a device coming in at the same time it’s being removed from the config.

Does this “dynamic” environment involve hitting Syncthing with multiple config changes in rapid sequence? For example, a change to a folder shared with device D (resulting in a reconnection of that device) immediately followed by another change that removes that device from the config?

We have about 70 linux and 70 Windows hosts, but connections are mainly in clusters between 2 and 15 machines. The connections are build up when a folder is shared and deleted when they are not needed anymore. We are still expanding the use of Syncthing and will probably share about 20 folders per system (linux/Windows) in varying configurations every night.

We definitely hit Syncthing with multiple config changes, but they should be set up in the right order. (Connecting → Sharing → Unsharing → Deleting the Connection). Of course there could be bugs in this script or weird orders due to multiple folders being shared or unshared at the same time. But there is a config lock which ensures that the configs are not changed between reading and rewriting. The configs are only accessed via the REST API.

1 Like

Nice :slight_smile:

The new issue calmh opened about less (not) racy config addresses the (likely) root cause of your issue, but it’s also a terrifying task. There is a simple “bandaid-fix” for your specific issue, so you could still file it on github for that.

Ok. I saw the issue and was not sure if I should still report it. I will do it now. Thanks for the quick response again.

1 Like

Yeah, I’m not accusing you of doing something wrong, I’m accusing Syncthing of not properly managing rapid sequential config changes.

Your best workaround at this point is to coalesce them into one change that does it all.

1 Like

That is what I figured from your description. I am not sure if I can do it easily because I do not think the current script design allows it, but it might be a good idea for the future anyways.

I have not seen this panic before and it is probably in correlation to the recent changes I made which put the connection build up and deletion closer to sharing/unsharing the folder.

At least today I have not found a new kind of panic yet :smile: Just the “index out of range” which should be fixed in 0.14.53 and the “unknown device should already have been rejected”.

1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.