NGSM-1569 add additional error handling when there is no active session#199
Merged
jacobsalmela merged 1 commit intomainfrom Sep 15, 2025
Merged
NGSM-1569 add additional error handling when there is no active session#199jacobsalmela merged 1 commit intomainfrom
jacobsalmela merged 1 commit intomainfrom
Conversation
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>
10c15d4 to
d40cd51
Compare
shunr-hpe
approved these changes
Sep 15, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.