Skip to content
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

"syncthing cli config devices add" reflect error when using --addresses flag #8503

Closed
fatflyingpigs opened this issue Aug 16, 2022 · 6 comments
Labels
bug A problem with current functionality, as opposed to missing functionality (enhancement) frozen-due-to-age Issues closed and untouched for a long time, together with being locked for discussion
Milestone

Comments

@fatflyingpigs
Copy link

fatflyingpigs commented Aug 16, 2022

Does your log mention database corruption?

Nay

Include required information

I'm attempting to use the CLI to add a device. This device can be added via the GUI, and the address(es) also work within the GUI.

syncthing cli config devices add --device-id GYRZZQB-IRNPV4Z-T7TC52W-EQYJ3TT-FDQW6MW-DFLMU42-SSSU6EM-FBK2VAY --name MyDevice --addresses tcp://example.com:22000

Removing the --addresses tcp://example.com:22000 will cause the cli call to work correctly.

Other forms that also error:
--addresses 'tcp://example.com:22000'
--addresses "tcp://example.com:22000"
--addresses tcp://example.com
--addresses tcp://192.168.1.6:22000
--addresses "tcp://192.168.1.6:22000"
--addresses tcp://192.168.1.6

Please be sure to include at least:

  • Raspberry Pi 4B, raspbian lite, syncthing v1.20.4, Linux (64-bit ARM)
  • ssh to the pi via Win 10 powershell (latest)

The console output:

pi@raspberrypi:~ $ syncthing cli config devices add --device-id GYRZZQB-IRNPV4Z-T7TC52W-EQYJ3TT-FDQW6MW-DFLMU42-SSSU6EM-FBK2VAY --name MyDevice --addresses tcp://example.com:22000
panic: reflect: call of reflect.Value.Elem on slice Value

goroutine 1 [running]:
reflect.Value.Elem({0x8d3f80?, 0x400017e830?, 0x40002dbdb8?})
        reflect/value.go:1213 +0x1a8
github.com/AudriusButkevicius/recli.(*constructor).makeSliceItemBuilders.func1(0x40002a0c60)
        github.com/AudriusButkevicius/recli@v0.0.6/recli.go:391 +0x270
github.com/AudriusButkevicius/recli.expectArgs.func1(0x400027bd20?)
        github.com/AudriusButkevicius/recli@v0.0.6/utils.go:154 +0xe4
github.com/urfave/cli.HandleAction({0x91ae80?, 0x40002d47f8?}, 0x3?)
        github.com/urfave/cli@v1.22.5/app.go:522 +0xa0
github.com/urfave/cli.Command.Run({{0xa3cbb3, 0x3}, {0x0, 0x0}, {0x0, 0x0, 0x0}, {0xa5ca58, 0x1c}, {0x0, ...}, ...}, ...)
        github.com/urfave/cli@v1.22.5/command.go:173 +0x534
github.com/urfave/cli.(*App).RunAsSubcommand(0x40001a2c40, 0x40002a09a0)
        github.com/urfave/cli@v1.22.5/app.go:405 +0x6fc
github.com/urfave/cli.Command.startApp({{0x40002daff0, 0x7}, {0x0, 0x0}, {0x0, 0x0, 0x0}, {0x0, 0x0}, {0x0, ...}, ...}, ...)
        github.com/urfave/cli@v1.22.5/command.go:372 +0x668
github.com/urfave/cli.Command.Run({{0x40002daff0, 0x7}, {0x0, 0x0}, {0x0, 0x0, 0x0}, {0x0, 0x0}, {0x0, ...}, ...}, ...)
        github.com/urfave/cli@v1.22.5/command.go:102 +0x694
github.com/urfave/cli.(*App).RunAsSubcommand(0x40001a2a80, 0x40002a0840)
        github.com/urfave/cli@v1.22.5/app.go:405 +0x6fc
github.com/urfave/cli.Command.startApp({{0xa3fed8, 0x6}, {0x0, 0x0}, {0x0, 0x0, 0x0}, {0xa6b660, 0x28}, {0x0, ...}, ...}, ...)
        github.com/urfave/cli@v1.22.5/command.go:372 +0x668
github.com/urfave/cli.Command.Run({{0xa3fed8, 0x6}, {0x0, 0x0}, {0x0, 0x0, 0x0}, {0xa6b660, 0x28}, {0x0, ...}, ...}, ...)
        github.com/urfave/cli@v1.22.5/command.go:102 +0x694
github.com/urfave/cli.(*App).RunAsSubcommand(0x40001a28c0, 0x40002a06e0)
        github.com/urfave/cli@v1.22.5/app.go:405 +0x6fc
github.com/urfave/cli.Command.startApp({{0xa3cbe9, 0x3}, {0x0, 0x0}, {0x0, 0x0, 0x0}, {0xa61ccf, 0x20}, {0x0, ...}, ...}, ...)
        github.com/urfave/cli@v1.22.5/command.go:372 +0x668
github.com/urfave/cli.Command.Run({{0xa3cbe9, 0x3}, {0x0, 0x0}, {0x0, 0x0, 0x0}, {0xa61ccf, 0x20}, {0x0, ...}, ...}, ...)
        github.com/urfave/cli@v1.22.5/command.go:102 +0x694
github.com/urfave/cli.(*App).Run(0x40001a2700, {0x4000128000, 0xb, 0xb})
        github.com/urfave/cli@v1.22.5/app.go:277 +0x630
github.com/syncthing/syncthing/cmd/syncthing/cli.Run()
        github.com/syncthing/syncthing/cmd/syncthing/cli/main.go:134 +0x7f0
main.main()
        github.com/syncthing/syncthing/cmd/syncthing/main.go:216 +0x80

goroutine 34 [chan receive]:
github.com/syncthing/notify.(*nonrecursiveTree).dispatch(0x400011c480, 0x0?)
        github.com/syncthing/notify@v0.0.0-20210616190510-c6b7342338d2/tree_nonrecursive.go:36 +0x40
created by github.com/syncthing/notify.newNonrecursiveTree
        github.com/syncthing/notify@v0.0.0-20210616190510-c6b7342338d2/tree_nonrecursive.go:29 +0x158

goroutine 35 [chan receive]:
github.com/syncthing/notify.(*nonrecursiveTree).internal(0x400011c480, 0x400011c420)
        github.com/syncthing/notify@v0.0.0-20210616190510-c6b7342338d2/tree_nonrecursive.go:81 +0x3c
created by github.com/syncthing/notify.newNonrecursiveTree
        github.com/syncthing/notify@v0.0.0-20210616190510-c6b7342338d2/tree_nonrecursive.go:30 +0x1b0

goroutine 36 [sleep]:
time.Sleep(0x1dcd6500)
        runtime/time.go:194 +0x124
github.com/syncthing/syncthing/lib/dialer.init.1.func2()
        github.com/syncthing/syncthing/lib/dialer/internal.go:43 +0x28
created by github.com/syncthing/syncthing/lib/dialer.init.1
        github.com/syncthing/syncthing/lib/dialer/internal.go:42 +0xf0

goroutine 38 [IO wait]:
internal/poll.runtime_pollWait(0x7f5e7dbfe8, 0x72)
        runtime/netpoll.go:302 +0xa4
internal/poll.(*pollDesc).wait(0x400017ce80?, 0x4000291000?, 0x0)
        internal/poll/fd_poll_runtime.go:83 +0x2c
internal/poll.(*pollDesc).waitRead(...)
        internal/poll/fd_poll_runtime.go:88
internal/poll.(*FD).Read(0x400017ce80, {0x4000291000, 0x1000, 0x1000})
        internal/poll/fd_unix.go:167 +0x1ec
net.(*netFD).Read(0x400017ce80, {0x4000291000?, 0x40000a1c58?, 0x15590?})
        net/fd_posix.go:55 +0x2c
net.(*conn).Read(0x400011a268, {0x4000291000?, 0x0?, 0x400011a260?})
        net/net.go:183 +0x38
net/http.(*persistConn).Read(0x400027ac60, {0x4000291000?, 0x15640?, 0x40000a4000?})
        net/http/transport.go:1929 +0x54
bufio.(*Reader).fill(0x400029ce40)
        bufio/bufio.go:106 +0x100
bufio.(*Reader).Peek(0x400029ce40, 0x1)
        bufio/bufio.go:144 +0x6c
net/http.(*persistConn).readLoop(0x400027ac60)
        net/http/transport.go:2093 +0x160
created by net/http.(*Transport).dialConn
        net/http/transport.go:1750 +0x1214

goroutine 39 [select]:
net/http.(*persistConn).writeLoop(0x400027ac60)
        net/http/transport.go:2392 +0xa4
created by net/http.(*Transport).dialConn
        net/http/transport.go:1751 +0x1260
@fatflyingpigs fatflyingpigs added bug A problem with current functionality, as opposed to missing functionality (enhancement) needs-triage New issues needed to be validated labels Aug 16, 2022
@jonathanprl
Copy link

jonathanprl commented Aug 27, 2022

I am getting this same error on Windows Server 2019 and syncthing@1.20.4

@calmh calmh removed the needs-triage New issues needed to be validated label Aug 27, 2022
@imsodin
Copy link
Member

imsodin commented Sep 11, 2022

@AudriusButkevicius PRed a fix in recli: AudriusButkevicius/recli#1

@meenajaeiei
Copy link

meenajaeiei commented Apr 14, 2023

Hi I'm facing this issue as well on syncthing v.123.4 as well . Does it fixed yet?

@imsodin
Copy link
Member

imsodin commented Apr 14, 2023

Ah yes, it was only fixed upstream but never pulled in.

@AudriusButkevicius can you do a patch release for recli please?

@calmh
Copy link
Member

calmh commented Apr 14, 2023

diff --git a/go.mod b/go.mod
index a21cad4e3..74acc972e 100644
--- a/go.mod
+++ b/go.mod
@@ -4,7 +4,7 @@ go 1.19

 require (
        github.com/AudriusButkevicius/pfilter v0.0.11
-       github.com/AudriusButkevicius/recli v0.0.6
+       github.com/AudriusButkevicius/recli v0.0.7-0.20220911121932-d000ce8fbf0f
        github.com/alecthomas/kong v0.7.1
        github.com/calmh/incontainer v0.0.0-20221224152218-b3e71b103d7a
        github.com/calmh/xdr v1.1.0

?

imsodin added a commit to imsodin/syncthing that referenced this issue Apr 14, 2023
@imsodin
Copy link
Member

imsodin commented Apr 14, 2023

Ah right, no need to be "clean" about the version: #8871

@calmh calmh closed this as completed in c867a5f Apr 14, 2023
calmh added a commit to calmh/syncthing that referenced this issue Apr 25, 2023
* main:
  build(deps): bump github.com/quic-go/quic-go from 0.33.0 to 0.34.0 (syncthing#8877)
  gui, man, authors: Update docs, translations, and contributors
  lib/ignore: Properly handle non-existing included ignore-files (fixes syncthing#8764) (syncthing#8874)
  lib/connections: Avoid using nil lanChecker
  gui, man, authors: Update docs, translations, and contributors
  lib/config, lib/connections: Configurable protocol priority (ref syncthing#8626) (syncthing#8868)
  build: Upgrade recli (fixes syncthing#8503) (syncthing#8871)
calmh added a commit to calmh/syncthing that referenced this issue Apr 25, 2023
* main:
  gui, man, authors: Update docs, translations, and contributors
  lib/ignore: Properly handle non-existing included ignore-files (fixes syncthing#8764) (syncthing#8874)
  lib/connections: Avoid using nil lanChecker
  gui, man, authors: Update docs, translations, and contributors
  lib/config, lib/connections: Configurable protocol priority (ref syncthing#8626) (syncthing#8868)
  build: Upgrade recli (fixes syncthing#8503) (syncthing#8871)
@calmh calmh added this to the v1.23.5 milestone Apr 28, 2023
calmh added a commit to calmh/syncthing that referenced this issue May 9, 2023
* main: (42 commits)
  all: Correct various typos (syncthing#8870)
  gui, man, authors: Update docs, translations, and contributors
  lib/model: Set platform data, incl. copying ownership, for new folders w/ NoPermissions flag (syncthing#8883)
  gui: Add Thai (th) translation template. (syncthing#8887)
  build: Produce nightly release builds
  gui, man, authors: Update docs, translations, and contributors
  build: Bump actions version; fix Node 12 deprecation warning (syncthing#8881)
  build: Build Debian packages
  build: Sign for upgrades
  build: Notarize mac builds
  build(deps): bump github.com/quic-go/quic-go from 0.33.0 to 0.34.0 (syncthing#8877)
  gui, man, authors: Update docs, translations, and contributors
  lib/ignore: Properly handle non-existing included ignore-files (fixes syncthing#8764) (syncthing#8874)
  lib/connections: Avoid using nil lanChecker
  gui, man, authors: Update docs, translations, and contributors
  lib/config, lib/connections: Configurable protocol priority (ref syncthing#8626) (syncthing#8868)
  build: Upgrade recli (fixes syncthing#8503) (syncthing#8871)
  build: Update dependencies (syncthing#8869)
  lib/model: Improve path generation for auto accepted folders (fixes syncthing#8859) (syncthing#8860)
  docs: fix typo (syncthing#8857)
  ...
@st-review st-review added the frozen-due-to-age Issues closed and untouched for a long time, together with being locked for discussion label Apr 13, 2024
@syncthing syncthing locked and limited conversation to collaborators Apr 13, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug A problem with current functionality, as opposed to missing functionality (enhancement) frozen-due-to-age Issues closed and untouched for a long time, together with being locked for discussion
Projects
None yet
Development

No branches or pull requests

6 participants