TheThingsNetwork / lorawan-stack

The Things Stack, an Open Source LoRaWAN Network Server
https://www.thethingsindustries.com/stack/
Apache License 2.0
980 stars 309 forks source link

Error with "ttn-lw-cli end-devices get" command #5034

Closed alanmitchell closed 2 years ago

alanmitchell commented 2 years ago

Summary

I am receiving an error when executing the ttn-lw-cli end-devices get CLI command. ...

Steps to Reproduce

  1. Execute the ttn-lw-cli login command.
  2. Execute a ttn-lw-cli end-devices get command such as ttn-lw-cli end-devices get bmon-an lsn50-alder-boiler-95f4 --formatters.up-formatter
  3. Observe an error message.

config.txt

What do you see now?

panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x0 pc=0x14e12e6]

goroutine 1 [running]:
go.thethings.network/lorawan-stack/v3/cmd/ttn-lw-cli/commands.getEndDevice(0xc0000ca6c0, {0xc00028c9b0, 0x0, 0x0}, {0xc00028c9c0, 0xc00059bd08, 0x97afe5}, {0xc00028c9d0, 0x0, 0x1}, ...)
        /home/runner/work/lorawan-stack/lorawan-stack/cmd/ttn-lw-cli/commands/end_devices_split.go:135 +0x9a6
go.thethings.network/lorawan-stack/v3/cmd/ttn-lw-cli/commands.glob..func83(0x2a2b160, {0xc00061d8f0, 0x2, 0x3})
        /home/runner/work/lorawan-stack/lorawan-stack/cmd/ttn-lw-cli/commands/end_devices.go:328 +0x9c7
github.com/spf13/cobra.(*Command).execute(0x2a2b160, {0xc00061d8c0, 0x3, 0x3})
        /home/runner/go/pkg/mod/github.com/spf13/cobra@v1.1.3/command.go:852 +0x60e
github.com/spf13/cobra.(*Command).ExecuteC(0x2a38360)
        /home/runner/go/pkg/mod/github.com/spf13/cobra@v1.1.3/command.go:960 +0x3ad
main.main()
        /home/runner/work/lorawan-stack/lorawan-stack/cmd/ttn-lw-cli/main.go:27 +0x25

What do you want to see instead?

I would like to see the results from the end-devices get command.

Environment

Version:             3.16.2
Build date:          2021-12-17T08:44:20Z
Git commit:          ff220a318
Go version:          go1.17.5
OS/Arch:             linux/amd64

How do you propose to implement this?

I have no experience with Go or the development of this application.

How do you propose to test this?

I will test by re-executing the end-devices get command and observing the results.

Can you do this yourself and submit a Pull Request?

No.

KrishnaIyer commented 2 years ago

Thanks for filing this.

This is already fixed by https://github.com/TheThingsNetwork/lorawan-stack/pull/5024 and https://github.com/TheThingsNetwork/lorawan-stack/pull/5033 and will land in the next release.