Skip to content

NGSM-1569 add additional error handling when there is no active session#199

Merged
jacobsalmela merged 1 commit intomainfrom
NGSM-1569
Sep 15, 2025
Merged

NGSM-1569 add additional error handling when there is no active session#199
jacobsalmela merged 1 commit intomainfrom
NGSM-1569

Conversation

@jacobsalmela
Copy link
Copy Markdown
Collaborator

No description provided.

@jacobsalmela jacobsalmela self-assigned this Sep 15, 2025
fixes a stack trace when no active session is set:

```
ncn-m001:~ # cani alpha list csm
4:47PM ERR No active session.
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x8 pc=0x1b021dc]
goroutine 1 [running]:
github.com/Cray-HPE/cani/internal/domain.(*Domain).List(...)
        /home/jenkins/workspace/Cray-HPE_cani_v0.5.0/noos/x86_64/1.20/dist/rpmbuild/BUILD/cani-0.5.0/internal/domain/misc.go:41
github.com/Cray-HPE/cani/cmd.listInventory(0x2fc2080?, {0xc00035f310, 0x1, 0x1})
        /home/jenkins/workspace/Cray-HPE_cani_v0.5.0/noos/x86_64/1.20/dist/rpmbuild/BUILD/cani-0.5.0/cmd/list.go:43 +0x5c
github.com/spf13/cobra.(*Command).execute(0x2fc2080, {0xc00035f2d0, 0x1, 0x1})
        /home/jenkins/workspace/Cray-HPE_cani_v0.5.0/noos/x86_64/1.20/dist/rpmbuild/BUILD/cani-0.5.0/vendor/github.com/spf13/cobra/command.go:940 +0x862
github.com/spf13/cobra.(*Command).ExecuteC(0x2fc0f40)
        /home/jenkins/workspace/Cray-HPE_cani_v0.5.0/noos/x86_64/1.20/dist/rpmbuild/BUILD/cani-0.5.0/vendor/github.com/spf13/cobra/command.go:1068 +0x3bd
github.com/spf13/cobra.(*Command).Execute(...)
        /home/jenkins/workspace/Cray-HPE_cani_v0.5.0/noos/x86_64/1.20/dist/rpmbuild/BUILD/cani-0.5.0/vendor/github.com/spf13/cobra/command.go:992
github.com/Cray-HPE/cani/cmd.Execute()
        /home/jenkins/workspace/Cray-HPE_cani_v0.5.0/noos/x86_64/1.20/dist/rpmbuild/BUILD/cani-0.5.0/cmd/root.go:72 +0x25
main.main()
        /home/jenkins/workspace/Cray-HPE_cani_v0.5.0/noos/x86_64/1.20/dist/rpmbuild/BUILD/cani-0.5.0/main.go:87 +0x6a
```

Signed-off-by: Jacob Salmela <jacob.salmela@hpe.com>
@jacobsalmela jacobsalmela merged commit 9beb9ec into main Sep 15, 2025
5 of 6 checks passed
@jacobsalmela jacobsalmela deleted the NGSM-1569 branch September 15, 2025 15:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants