Skip to content

[8.19](backport #5069) Include base error for json decode error responses#5085

Merged
michel-laterman merged 2 commits into8.19from
mergify/bp/8.19/pr-5069
Jul 4, 2025
Merged

[8.19](backport #5069) Include base error for json decode error responses#5085
michel-laterman merged 2 commits into8.19from
mergify/bp/8.19/pr-5069

Conversation

@mergify
Copy link
Contributor

@mergify mergify bot commented Jul 3, 2025

What is the problem this PR solves?

There is no information on why request bodies fail to decode as JSON

How does this PR solve the problem?

Include the base json decode error as part of the response.

Design Checklist

  • I have ensured my design is stateless and will work when multiple fleet-server instances are behind a load balancer.
  • I have or intend to scale test my changes, ensuring it will work reliably with 100K+ agents connected.
  • I have included fail safe mechanisms to limit the load on fleet-server: rate limiting, circuit breakers, caching, load shedding, etc.

Checklist

  • 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
  • I have added an entry in ./changelog/fragments using the changelog tool

This is an automatic backport of pull request #5069 done by [Mergify](https://mergify.com).
* Include base error for json decode error responses

(cherry picked from commit 966c4f8)

# Conflicts:
#	internal/pkg/api/handleEnroll_test.go
@mergify mergify bot requested a review from a team as a code owner July 3, 2025 16:28
@mergify mergify bot added backport conflicts There is a conflict in the backported pull request labels Jul 3, 2025
@mergify mergify bot requested review from kaanyalti and ycombinator July 3, 2025 16:28
@mergify mergify bot added the backport label Jul 3, 2025
@mergify
Copy link
Contributor Author

mergify bot commented Jul 3, 2025

Cherry-pick of 966c4f8 has failed:

On branch mergify/bp/8.19/pr-5069
Your branch is up to date with 'origin/8.19'.

You are currently cherry-picking commit 966c4f8.
  (fix conflicts and run "git cherry-pick --continue")
  (use "git cherry-pick --skip" to skip this patch)
  (use "git cherry-pick --abort" to cancel the cherry-pick operation)

Changes to be committed:
	new file:   changelog/fragments/1750971846-Include-error-on-json-decode-error-responses.yaml
	modified:   internal/pkg/api/error.go
	modified:   internal/pkg/api/handleAck_test.go
	modified:   internal/pkg/api/handleAudit_test.go
	modified:   internal/pkg/api/handleCheckin_test.go

Unmerged paths:
  (use "git add <file>..." to mark resolution)
	both modified:   internal/pkg/api/handleEnroll_test.go

To fix up this pull request, you can check it out locally. See documentation: https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/reviewing-changes-in-pull-requests/checking-out-pull-requests-locally

@mergify mergify bot added the conflicts There is a conflict in the backported pull request label Jul 3, 2025
@github-actions github-actions bot added bug Something isn't working Team:Elastic-Agent-Control-Plane Label for the Agent Control Plane team labels Jul 3, 2025
@prodsecmachine
Copy link

prodsecmachine commented Jul 3, 2025

🎉 Snyk checks have passed. No issues have been found so far.

security/snyk check is complete. No issues have been found. (View Details)

license/snyk check is complete. No issues have been found. (View Details)

@michel-laterman michel-laterman merged commit 53c46dd into 8.19 Jul 4, 2025
8 of 9 checks passed
@michel-laterman michel-laterman deleted the mergify/bp/8.19/pr-5069 branch July 4, 2025 17:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport bug Something isn't working conflicts There is a conflict in the backported pull request Team:Elastic-Agent-Control-Plane Label for the Agent Control Plane team

2 participants