Skip to content

[meraki] improve defensive checks to prevent panics#47950

Merged
gpop63 merged 6 commits intoelastic:mainfrom
gpop63:bugfix/meraki-6711
Dec 7, 2025
Merged

[meraki] improve defensive checks to prevent panics#47950
gpop63 merged 6 commits intoelastic:mainfrom
gpop63:bugfix/meraki-6711

Conversation

@gpop63
Copy link
Contributor

@gpop63 gpop63 commented Dec 5, 2025

Overview

Fix nil pointer dereference panic in getDeviceSwitchports when the Meraki API returns switch port data for devices not present in the local devices map. + more safety checks to prevent panics

Checklist

  • My code follows the style guidelines of this project
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • I have made corresponding change to the default configuration files
  • I have added tests that prove my fix is effective or that my feature works. Where relevant, I have used the stresstest.sh script to run them under stress conditions and race detector to verify their stability.
  • I have added an entry in ./changelog/fragments using the changelog tool.
@botelastic botelastic bot added the needs_team Indicates that the issue/PR needs a Team:* label label Dec 5, 2025
@github-actions
Copy link
Contributor

github-actions bot commented Dec 5, 2025

🤖 GitHub comments

Just comment with:

  • run docs-build : Re-trigger the docs validation. (use unformatted text in the comment!)
@mergify mergify bot assigned gpop63 Dec 5, 2025
@mergify
Copy link
Contributor

mergify bot commented Dec 5, 2025

This pull request does not have a backport label.
If this is a bug or security fix, could you label this PR @gpop63? 🙏.
For such, you'll need to label your PR with:

  • The upcoming major version of the Elastic Stack
  • The upcoming minor version of the Elastic Stack (if you're not pushing a breaking change)

To fixup this pull request, you need to add the backport labels for the needed
branches, such as:

  • backport-8./d is the label to automatically backport to the 8./d branch. /d is the digit
  • backport-active-all is the label that automatically backports to all active branches.
  • backport-active-8 is the label that automatically backports to all active minor branches for the 8 major.
  • backport-active-9 is the label that automatically backports to all active minor branches for the 9 major.
@gpop63
Copy link
Contributor Author

gpop63 commented Dec 6, 2025

/test

Copy link
Contributor

@tommyers-elastic tommyers-elastic left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks gabriel. does this type of assignment happen anywhere else?

@gpop63
Copy link
Contributor Author

gpop63 commented Dec 6, 2025

thanks gabriel. does this type of assignment happen anywhere else?

I've checked I only saw it here.

@gpop63 gpop63 added the backport-active-all Automated backport with mergify to all the active branches label Dec 6, 2025
@shmsr
Copy link
Member

shmsr commented Dec 6, 2025

The PR title and description need to be updated.

@shmsr shmsr marked this pull request as ready for review December 6, 2025 15:34
@shmsr shmsr requested a review from a team as a code owner December 6, 2025 15:34
@gpop63 gpop63 changed the title [meraki] check if device exists in the map Dec 7, 2025
@gpop63 gpop63 added the Team:Obs-InfraObs Label for the Observability Infrastructure Monitoring team label Dec 7, 2025
@botelastic botelastic bot removed the needs_team Indicates that the issue/PR needs a Team:* label label Dec 7, 2025
@gpop63 gpop63 merged commit 1c8215c into elastic:main Dec 7, 2025
40 checks passed
@github-actions
Copy link
Contributor

github-actions bot commented Dec 7, 2025

@Mergifyio backport 8.19 9.1 9.2

@mergify
Copy link
Contributor

mergify bot commented Dec 7, 2025

backport 8.19 9.1 9.2

✅ Backports have been created

Details
mergify bot pushed a commit that referenced this pull request Dec 7, 2025
* check if device exists in the map

* add fragment

* add more safety checks

* Fix more potential nil panic(s)

* Fix more potential nil panic(s)

* update fragment

---------

Co-authored-by: subham sarkar <subham.sarkar@elastic.co>
(cherry picked from commit 1c8215c)
mergify bot pushed a commit that referenced this pull request Dec 7, 2025
* check if device exists in the map

* add fragment

* add more safety checks

* Fix more potential nil panic(s)

* Fix more potential nil panic(s)

* update fragment

---------

Co-authored-by: subham sarkar <subham.sarkar@elastic.co>
(cherry picked from commit 1c8215c)
mergify bot pushed a commit that referenced this pull request Dec 7, 2025
* check if device exists in the map

* add fragment

* add more safety checks

* Fix more potential nil panic(s)

* Fix more potential nil panic(s)

* update fragment

---------

Co-authored-by: subham sarkar <subham.sarkar@elastic.co>
(cherry picked from commit 1c8215c)
gpop63 added a commit that referenced this pull request Dec 7, 2025
* check if device exists in the map

* add fragment

* add more safety checks

* Fix more potential nil panic(s)

* Fix more potential nil panic(s)

* update fragment

---------


(cherry picked from commit 1c8215c)

Co-authored-by: Gabriel Pop <94497545+gpop63@users.noreply.github.com>
Co-authored-by: subham sarkar <subham.sarkar@elastic.co>
gpop63 added a commit that referenced this pull request Dec 7, 2025
* check if device exists in the map

* add fragment

* add more safety checks

* Fix more potential nil panic(s)

* Fix more potential nil panic(s)

* update fragment

---------


(cherry picked from commit 1c8215c)

Co-authored-by: Gabriel Pop <94497545+gpop63@users.noreply.github.com>
Co-authored-by: subham sarkar <subham.sarkar@elastic.co>
gpop63 added a commit that referenced this pull request Dec 7, 2025
* check if device exists in the map

* add fragment

* add more safety checks

* Fix more potential nil panic(s)

* Fix more potential nil panic(s)

* update fragment

---------


(cherry picked from commit 1c8215c)

Co-authored-by: Gabriel Pop <94497545+gpop63@users.noreply.github.com>
Co-authored-by: subham sarkar <subham.sarkar@elastic.co>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport-active-all Automated backport with mergify to all the active branches Team:Obs-InfraObs Label for the Observability Infrastructure Monitoring team

3 participants