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
panic with "WARNING: Error starting the main Syncthing process: exec: "syncthing.exe": cannot run executable found relative to current directory" when starting v1.21.0-rc.1 in command line in Windows #8499
bugA problem with current functionality, as opposed to missing functionality (enhancement)frozen-due-to-ageIssues closed and untouched for a long time, together with being locked for discussionskip-changelogBugs that have never been in a released stable version, and as such excluded from the release notes
This happens if you try to start the current RC from the command line in Windows.
R:\syncthing-windows-amd64-v1.21.0-rc.1>syncthing.exe
[monitor] 2022/08/13 15:32:57 INFO: Log output saved to file "C:\Users\User\AppData\Local\Syncthing\syncthing.log"
[monitor] 2022/08/13 15:32:57 WARNING: Error starting the main Syncthing process: exec: "syncthing.exe": cannot run executable found relative to current directory
panic: Error starting the main Syncthing process
goroutine 1 [running]:
main.monitorMain({{{0x0}, {0x0, 0x0}, {0x0, 0x0}, 0x0, 0x0}, 0x0, 0x0, {0x0, ...}, ...})
github.com/syncthing/syncthing/cmd/syncthing/monitor.go:124 +0x110f
main.serveOptions.Run({{{0x0}, {0x0, 0x0}, {0x0, 0x0}, 0x0, 0x0}, 0x0, 0x0, {0x0, ...}, ...})
github.com/syncthing/syncthing/cmd/syncthing/main.go:404 +0x798
reflect.Value.call({0x10df7c0?, 0x1a8c660?, 0xf13515?}, {0x10ed8d2, 0x4}, {0xc0001dbb80, 0x0, 0x645948?})
reflect/value.go:584 +0x8c5
reflect.Value.Call({0x10df7c0?, 0x1a8c660?, 0xfde580?}, {0xc0001dbb80?, 0x10?, 0x1a8caa0?})
reflect/value.go:368 +0xbc
github.com/alecthomas/kong.callMethod({0x10ed2c7, 0x3}, {0x10df7c0?, 0x1a8c660?, 0x3?}, {0x10df7c0?, 0x1a8c660?, 0x0?}, 0x0?)
github.com/alecthomas/[email protected]/callbacks.go:95 +0x549
github.com/alecthomas/kong.(*Context).RunNode(0xc000160d80, 0xc0001262d0, {0x0, 0x0, 0x0})
github.com/alecthomas/[email protected]/context.go:734 +0x5f7
github.com/alecthomas/kong.(*Context).Run(0xf6efe0?, {0x0?, 0x0?, 0x0?})
github.com/alecthomas/[email protected]/context.go:759 +0x14e
main.main()
github.com/syncthing/syncthing/cmd/syncthing/main.go:255 +0x3a5
goroutine 6 [chan receive]:
github.com/syncthing/notify.(*recursiveTree).dispatch(0xc00007c7d0)
github.com/syncthing/[email protected]/tree_recursive.go:125 +0x48
created by github.com/syncthing/notify.newRecursiveTree
github.com/syncthing/[email protected]/tree_recursive.go:119 +0x165
goroutine 7 [sleep]:
time.Sleep(0x1dcd6500)
runtime/time.go:195 +0x13c
github.com/syncthing/syncthing/lib/dialer.init.0.func2()
github.com/syncthing/syncthing/lib/dialer/internal.go:43 +0x1e
created by github.com/syncthing/syncthing/lib/dialer.init.0
github.com/syncthing/syncthing/lib/dialer/internal.go:42 +0xbe
goroutine 8 [select]:
main.(*autoclosedFile).closerLoop(0xc000247c00)
github.com/syncthing/syncthing/cmd/syncthing/monitor.go:528 +0x71
created by main.newAutoclosedFile
github.com/syncthing/syncthing/cmd/syncthing/monitor.go:468 +0x1e5
goroutine 9 [syscall]:
os/signal.signal_recv()
runtime/sigqueue.go:152 +0x2f
os/signal.loop()
os/signal/signal_unix.go:23 +0x19
created by os/signal.Notify.func1.1
os/signal/signal.go:151 +0x2a
The workaround is to use .\syncthing.exe, but this wasn't the case before when compiled with Go 1.18. I personally think it is a big problem, because this requirement is very likely to break custom scripts, especially since using .\ isn't common in batch scripts at all (as it's optional and thus usually omitted).
Probably, because I've just recompiled with Go 1.18, and the issue is gone.
Is this restriction absolutely necessary though? Would it be a problem to disable it? It breaks the established workflow, as no command line Windows software behaves like that (or at least I've never encountered anything similar until now). The CMD itself doesn't even add .\ to paths when using TAB autocomplete (in contrary to PowerShell, which does).
Edit:
I also want to add that this crashes Syncthing on upgrade from an older version.
Run v1.20.4 from the command line, e.g. syncthing.exe -home=test
Enable upgrade to release candidates, restart, and press the upgrade button in the GUI.
The upgraded executable fails to start with the same panic as described above.
bugA problem with current functionality, as opposed to missing functionality (enhancement)frozen-due-to-ageIssues closed and untouched for a long time, together with being locked for discussionskip-changelogBugs that have never been in a released stable version, and as such excluded from the release notes
Activity
bt90 commentedon Aug 13, 2022
Isn't this a new restriction introduced in go 1.19?
https://tip.golang.org/doc/go1.19#os-exec-path
tomasz1986 commentedon Aug 13, 2022
Probably, because I've just recompiled with Go 1.18, and the issue is gone.
Is this restriction absolutely necessary though? Would it be a problem to disable it? It breaks the established workflow, as no command line Windows software behaves like that (or at least I've never encountered anything similar until now). The CMD itself doesn't even add
.\to paths when using TAB autocomplete (in contrary to PowerShell, which does).Edit:
I also want to add that this crashes Syncthing on upgrade from an older version.
syncthing.exe -home=testimsodin commentedon Aug 13, 2022
That's because of our monitor stuff using
execwitharg[0]which issyncthing, and thus being affected by that behaviour change. I'll take care of it.cmd/syncthing: Work around binary in current dir restriction (fixes s…
Merge branch 'main' into xattr
Merge branch 'main' into encode-windows-filenames