Skip to content

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

Closed

Description

@fatflyingpigs

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/[email protected]/recli.go:391 +0x270
github.com/AudriusButkevicius/recli.expectArgs.func1(0x400027bd20?)
        github.com/AudriusButkevicius/[email protected]/utils.go:154 +0xe4
github.com/urfave/cli.HandleAction({0x91ae80?, 0x40002d47f8?}, 0x3?)
        github.com/urfave/[email protected]/app.go:522 +0xa0
github.com/urfave/cli.Command.Run({{0xa3cbb3, 0x3}, {0x0, 0x0}, {0x0, 0x0, 0x0}, {0xa5ca58, 0x1c}, {0x0, ...}, ...}, ...)
        github.com/urfave/[email protected]/command.go:173 +0x534
github.com/urfave/cli.(*App).RunAsSubcommand(0x40001a2c40, 0x40002a09a0)
        github.com/urfave/[email protected]/app.go:405 +0x6fc
github.com/urfave/cli.Command.startApp({{0x40002daff0, 0x7}, {0x0, 0x0}, {0x0, 0x0, 0x0}, {0x0, 0x0}, {0x0, ...}, ...}, ...)
        github.com/urfave/[email protected]/command.go:372 +0x668
github.com/urfave/cli.Command.Run({{0x40002daff0, 0x7}, {0x0, 0x0}, {0x0, 0x0, 0x0}, {0x0, 0x0}, {0x0, ...}, ...}, ...)
        github.com/urfave/[email protected]/command.go:102 +0x694
github.com/urfave/cli.(*App).RunAsSubcommand(0x40001a2a80, 0x40002a0840)
        github.com/urfave/[email protected]/app.go:405 +0x6fc
github.com/urfave/cli.Command.startApp({{0xa3fed8, 0x6}, {0x0, 0x0}, {0x0, 0x0, 0x0}, {0xa6b660, 0x28}, {0x0, ...}, ...}, ...)
        github.com/urfave/[email protected]/command.go:372 +0x668
github.com/urfave/cli.Command.Run({{0xa3fed8, 0x6}, {0x0, 0x0}, {0x0, 0x0, 0x0}, {0xa6b660, 0x28}, {0x0, ...}, ...}, ...)
        github.com/urfave/[email protected]/command.go:102 +0x694
github.com/urfave/cli.(*App).RunAsSubcommand(0x40001a28c0, 0x40002a06e0)
        github.com/urfave/[email protected]/app.go:405 +0x6fc
github.com/urfave/cli.Command.startApp({{0xa3cbe9, 0x3}, {0x0, 0x0}, {0x0, 0x0, 0x0}, {0xa61ccf, 0x20}, {0x0, ...}, ...}, ...)
        github.com/urfave/[email protected]/command.go:372 +0x668
github.com/urfave/cli.Command.Run({{0xa3cbe9, 0x3}, {0x0, 0x0}, {0x0, 0x0, 0x0}, {0xa61ccf, 0x20}, {0x0, ...}, ...}, ...)
        github.com/urfave/[email protected]/command.go:102 +0x694
github.com/urfave/cli.(*App).Run(0x40001a2700, {0x4000128000, 0xb, 0xb})
        github.com/urfave/[email protected]/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/[email protected]/tree_nonrecursive.go:36 +0x40
created by github.com/syncthing/notify.newNonrecursiveTree
        github.com/syncthing/[email protected]/tree_nonrecursive.go:29 +0x158

goroutine 35 [chan receive]:
github.com/syncthing/notify.(*nonrecursiveTree).internal(0x400011c480, 0x400011c420)
        github.com/syncthing/[email protected]/tree_nonrecursive.go:81 +0x3c
created by github.com/syncthing/notify.newNonrecursiveTree
        github.com/syncthing/[email protected]/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

Activity

  1. added
    bug
    needs-triage
    on Aug 16, 2022
  2. jonathanprl commented on Aug 27, 2022

    @jonathanprl

    I am getting this same error on Windows Server 2019 and [email protected]

  3. removed
    needs-triage
    on Aug 27, 2022
  4. imsodin commented on Sep 11, 2022

    @imsodin
    Member
  5. meenajaeiei commented on Apr 14, 2023

    @meenajaeiei

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

  6. imsodin commented on Apr 14, 2023

    @imsodin
    Member

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

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

  7. calmh commented on Apr 14, 2023

    @calmh
    Member
    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
    

    ?

  8. added a commit that references this issue on Apr 14, 2023
    8b0f1c0
  9. imsodin commented on Apr 14, 2023

    @imsodin
    Member

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

  10. added 2 commits that reference this issue on Apr 25, 2023
    5280c4e
    2a8dff6
  11. added this to the v1.23.5 milestone on Apr 28, 2023
  12. added a commit that references this issue on May 9, 2023
    8c282de
  13. added a commit that references this issue on Jan 28, 2024
    c867a5f
  14. added
    frozen-due-to-age
    on Apr 13, 2024
  15. locked and limited conversation to collaborators on Apr 13, 2024
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

    bugfrozen-due-to-age

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions