Log error when host_script_result record is not found#40009
Merged
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #40009 +/- ##
=======================================
Coverage 66.28% 66.28%
=======================================
Files 2441 2441
Lines 195640 195646 +6
Branches 8542 8542
=======================================
+ Hits 129682 129693 +11
+ Misses 54208 54205 -3
+ Partials 11750 11748 -2
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
lucasmrod
approved these changes
Feb 18, 2026
3 tasks
nulmete
added a commit
that referenced
this pull request
Mar 9, 2026
<!-- Add the related story/sub-task/bug number, like Resolves #123, or remove if NA --> **Related issue:** Resolves #36682 - Added similar "not found" handling than the one we have when calling `getHostScriptExecutionResultDB` within the `GetHostLockWipeStatus` function for consistency => now return a 404 instead of a 500 when no rows are returned. - Applied similar changes to #33090 (PR: #40009) => logging an error instead of returning a 404, so that the Host details page does not crash. The actual fix would be to remove the `host_mdm_actions` record that contains the orphan `lock_ref` mentioned in the issue. I'm not sure what the root cause is, but I think setting up some monitoring on the logs I added should help determining that. # Checklist for submitter - [x] Changes file added for user-visible changes in `changes/`, `orbit/changes/` or `ee/fleetd-chrome/changes`. See [Changes files](https://github.com/fleetdm/fleet/blob/main/docs/Contributing/guides/committing-changes.md#changes-files) for more information. ## Testing - [x] Added/updated automated tests - [ ] QA'd all new/changed functionality manually
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.
Related issue: Resolves #33090
All the calls to getHostScriptExecutionResultDB within GetHostLockWipeStatus now log an error with the hostID and execID if no rows are found. (As agreed with @lucasmrod instead of modifying the DB as I proposed in the issue, at least for now).
Testing
QA'd all new/changed functionality manually
Set the unlock_reference to a dummy value for a host_mdm_action => reproduced 404.
Restarted the server with the fix => host details page loaded.
hsr_1.mov
hsr_2.mov