You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Logfile empty when running Syncthing using start command from CMD in Windows #10882
I assume this is some kind of a Windows-specific quirk, but when starting Syncthing from the command line (cmd.exe) as follows
start "" syncthing.exe
the log is not saved to the disk. It doesn't matter if it's the default location or a specific location set with --log-file=<filename>, the logfile just stays at 0 bytes all the time. This isn't the case when Syncthing is run without the start command.
I will try to do more testing later on, but I assume the problem may be related to #10726, as I've been using the same method to start Syncthing for years and I can say for sure that the logfile used to be written to the disk just fine.
@Shablone Have you perhaps got any idea what the culprit may be here?
It has multiple functions but when run with no arguments like that, it detaches the process from the current command line window (or rather starts it outside of the current window).
Current insight:
Syncthing not only tries to log to the file, but also to stdout.
The stdout handle is probably invalid in this scenario due to the policy.
->Syncthings logwriter first tries stdout then the file, but already fails silently for the stdout.
And it seems that this is also the case for Syncthing opened via double click 😱
I'll try to get a fix ready. Sry for your missing log 😬
So.. Currently I'm not allowed to open a PR, probably due to the new AI guidelines. Understandably.
I prepared a fix here
I reviewed and tested it. This solved the issue and logging will continue to work from console, ' start "" syncthing.exe ' and explorer.
But I have to admit that this is heavily inspired by AI and I'm still not deeply connected to the repo. So I do understand if this is not accepted.
The change will allow the logwriter to continue on other file handles after a failed write.
An alternative fix could be, letting the file be written first and stdout second, but this seems quirky.
Another alternative: Check if stdout is valid and skip its write otherwise. I haven't found a proper solution for that.
Another alternative: Check if we have that specific Windows scenario and skip that write. But that also seems quirky
Activity
Shablone commentedon Sep 15, 2026
Same here. On 2.1.1 it still logs, while on 2.1.2 it doesn't anymore.
I haven't looked into it deeply enough yet to have any idea why.
calmh commentedon Sep 16, 2026
What's the purpose of using the
startincantation?tomasz1986 commentedon Sep 16, 2026
It has multiple functions but when run with no arguments like that, it detaches the process from the current command line window (or rather starts it outside of the current window).
Shablone commentedon Sep 16, 2026
Current insight:
Syncthing not only tries to log to the file, but also to stdout.
The stdout handle is probably invalid in this scenario due to the policy.
->Syncthings logwriter first tries stdout then the file, but already fails silently for the stdout.
And it seems that this is also the case for Syncthing opened via double click 😱
I'll try to get a fix ready. Sry for your missing log 😬
Shablone commentedon Sep 16, 2026
So.. Currently I'm not allowed to open a PR, probably due to the new AI guidelines. Understandably.
I prepared a fix here
I reviewed and tested it. This solved the issue and logging will continue to work from console, ' start "" syncthing.exe ' and explorer.
But I have to admit that this is heavily inspired by AI and I'm still not deeply connected to the repo. So I do understand if this is not accepted.
The change will allow the logwriter to continue on other file handles after a failed write.
An alternative fix could be, letting the file be written first and stdout second, but this seems quirky.
Another alternative: Check if stdout is valid and skip its write otherwise. I haven't found a proper solution for that.
Another alternative: Check if we have that specific Windows scenario and skip that write. But that also seems quirky
calmh commentedon Sep 16, 2026
@Shablone I've sent you an invite so you can create a normal PR, we can discuss there.
fix(monitor): continue log writes when stdout is unavailable on detac…
Merge branch 'main' into protovalidate
Merge tag 'v2.1.6' into ossdrive