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

Add nil check on events dataset pagination #193

Merged

Conversation

linkous8
Copy link
Contributor

Description

Adds nil check to fsoc optimize events related datasets during pagination logic. Prevents following stack trace:

✓ Platform API call (POST /monitoring/v1/query/execute)
   ⨯ Execution of events query encountered errors. Returned data may not be complete!
   ⨯ General Error: Event data error (logged with TraceId: [3063c1ccd79d60f5d55db6b8006b196c])
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x2 addr=0x38 pc=0x102e96b34]

goroutine 1 [running]:
github.com/cisco-open/fsoc/cmd/optimize.listEvents.func1(0x140001ec300?, {0x1400032b030?, 0x0?, 0x7?})
	github.com/cisco-open/fsoc/cmd/optimize/events.go:220 +0x8e4
github.com/spf13/cobra.(*Command).execute(0x140001ec300, {0x140000b2030, 0x7, 0x7})
	github.com/spf13/cobra@v1.7.0/command.go:940 +0x5c8
github.com/spf13/cobra.(*Command).ExecuteC(0x1036ef4c0)
	github.com/spf13/cobra@v1.7.0/command.go:1068 +0x35c
github.com/spf13/cobra.(*Command).Execute(...)
	github.com/spf13/cobra@v1.7.0/command.go:992
github.com/spf13/cobra.(*Command).ExecuteContext(...)
	github.com/spf13/cobra@v1.7.0/command.go:985
github.com/cisco-open/fsoc/cmd.Execute(...)
	github.com/cisco-open/fsoc/cmd/root.go:87
main.realMain()
	github.com/cisco-open/fsoc/main.go:36 +0x114
main.main()
	github.com/cisco-open/fsoc/main.go:28 +0x1c

Type of Change

  • Bug Fix
  • New Feature
  • Breaking Change
  • Refactor
  • Documentation
  • Other (please describe)

Checklist

  • I have read the contributing guidelines
  • Existing issues have been referenced (where applicable)
  • I have verified this change is not present in other open pull requests
  • Functionality is documented
  • All code style checks pass
  • New code contribution is covered by automated tests
  • All new and existing tests pass

@pnickolov pnickolov merged commit ec2c44a into cisco-open:main Aug 16, 2023
6 checks passed
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