fleet icon indicating copy to clipboard operation
fleet copied to clipboard

Host record exists in some places but not others

Open mason-buettner opened this issue 1 year ago • 25 comments

Fleet version: 4.73.1

Web browser and operating system: Chrome 139 on macOS 26


💥  Actual behavior

customer-gispen reports that the record in Fleet for one of their offline hosts is inaccessible. This host has been offline for ~4 months, and was accessible until recently. The host is still showing up in searches, but the actual page (i.e. the equivalent of https://dogfood.fleetdm.com/hosts/1272/details for customer-gispen's host) returns a 404 . We see a series of the following error messages for this host, which are possibly related:

{"component":"http","err":"get host mdm lock/wipe status: get unlock reference script result: : HostScriptResult <result_UUID> was not found in the datastore","level":"error","method":"GET","took":"146.512973ms","ts":"2025-09-16T21:12:13.720105842Z","uri":"/api/v1/fleet/hosts/identifier/<host_UUID>","user":"<user_email>"}

🛠️ To fix

Timebox TBD at estimation

🧑‍💻  Steps to reproduce

  1. Lock and shut down host on Fleet ~4.70.
  2. Upgrade Fleet to 4.73.1.
  3. Attempt to navigate to the host's details.

🕯️ More info (optional)

Link to folder with screenshots of the error details: https://drive.google.com/drive/folders/1NrcBSrdlkTtmLv8Jh5yZiRHsvFLyGq_C?usp=sharing

mason-buettner avatar Sep 16 '25 23:09 mason-buettner

Linked to Unthread ticket:

Host showing 404 error #8493

Sampfluger88 avatar Sep 18 '25 16:09 Sampfluger88

Reviewed on standup 9/18/25.

ddribeiro avatar Sep 18 '25 16:09 ddribeiro

I will try and reproduce after we ship 4.73.2 and 4.74.0

PezHub avatar Sep 19 '25 00:09 PezHub

@PezHub This looks similar to this older issue, which contains some more info on how to potentially reproduce this state: https://github.com/fleetdm/fleet/issues/29086

mna avatar Sep 22 '25 16:09 mna

@mason-buettner A question for you if you know, would be helpful in figuring out what/how it happened, do you know what OS the host is running? I couldn't find the info in the screenshots or the unthread convo. The ticket mentions macOS but I think that's where the browser / fleet UI was running.

mna avatar Sep 24 '25 14:09 mna

@mna the host is running Ubuntu 24.10, macOS was where we observed the bug in the console.

mason-buettner avatar Sep 24 '25 17:09 mason-buettner

Seems like we're making assumptions on whether lock/wipe script results are going to stick around, and eventually those activities can age out. @mason-buettner does the customer have activity retention settings set to purge activities after X days?

iansltx avatar Sep 28 '25 02:09 iansltx

Planning poker

iansltx avatar Sep 28 '25 02:09 iansltx

@iansltx gispen has no customizations to clear activities that I'm aware of, but I will ask to make 100% sure. They're in managed cloud, so much of the configuration is managed by Fleet.

mason-buettner avatar Sep 30 '25 16:09 mason-buettner

For the record here, no activity expiration, so our initial theory on what's going on here is likely incorrect.

iansltx avatar Sep 30 '25 17:09 iansltx

I could not replicate this - see here

Perhaps this was fixed in https://github.com/fleetdm/fleet/issues/29086 ?

juan-fdz-hawa avatar Oct 10 '25 18:10 juan-fdz-hawa

I could not replicate this - see here

Perhaps this was fixed in #29086 ?

@mason-buettner

juan-fdz-hawa avatar Oct 14 '25 19:10 juan-fdz-hawa

@juan-fdz-hawa FYI for #29086 it was specifically for Windows hosts, this one seems to be for a Linux host. Also it seems it was for a lock/unlock, and resulted in a 404 on the host's page, while the other one was for a Wipe and resulted in a 500. But the underlying cause seems similar (a host_mdm_actions row with references to command uuid/ script uuid that does not exist anymore).

mna avatar Oct 14 '25 19:10 mna

Tried replicating this again but on Linux and I couldn't reproduce:

Ubuntu Fedora

juan-fdz-hawa avatar Oct 14 '25 21:10 juan-fdz-hawa

Hi @juan-fdz-hawa, I'll circle back with gispen to see if they're still observing this issue. If they are, I can see about setting up a call with their team to investigate further.

mason-buettner avatar Oct 15 '25 15:10 mason-buettner

Peer our discussion, closing this for now since is not reproducible.

juan-fdz-hawa avatar Oct 15 '25 19:10 juan-fdz-hawa

Lost host in the cloud, Fix will guide it back home, Fleet's light shines more proud.

fleet-release avatar Oct 15 '25 19:10 fleet-release

Re-opening this as the bug is still present for the host. It seems like the underlying issue is that we seem to be in a situation where the script results are missing in the datastore:

HostScriptResult <result_UUID> was not found in the datastore

rynsatterlee avatar Nov 13 '25 20:11 rynsatterlee

We'll timebox it to 3 points to root cause and fix.

lucasmrod avatar Jan 15 '26 17:01 lucasmrod

IIRC the issue was that one of the API calls on the details page failed due to missing records (like the host script result shown above) and that failure caused us to show a 404 in the frontend. This might have been the activities API trying to join to a non-existent record.

sgress454 avatar Jan 15 '26 17:01 sgress454