{"record":{"id":"668bc2d78d035152","repo":"hashicorp/nomad","slug":"actual-resource-usage-not-present","errorCode":null,"errorMessage":"actual resource usage not present","messagePattern":"actual resource usage not present","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"command/node_status.go","lineNumber":1026,"sourceCode":"\t\t\tmem += stats.ResourceUsage.MemoryStats.RSS\n\t\t}\n\t}\n\n\tresources := make([]string, 2)\n\tresources[0] = \"CPU|Memory\"\n\tresources[1] = fmt.Sprintf(\"%v/%d MHz|%v/%v\",\n\t\tmath.Floor(cpu),\n\t\t*total.CPU,\n\t\thumanize.IBytes(mem),\n\t\thumanize.IBytes(uint64(*total.MemoryMB*bytesPerMegabyte)))\n\n\treturn resources, nil\n}\n\n// getHostResources returns the actual resource usage of the node.\nfunc getHostResources(hostStats *api.HostStats, node *api.Node) ([]string, error) {\n\tif hostStats == nil {\n\t\treturn nil, fmt.Errorf(\"actual resource usage not present\")\n\t}\n\tvar resources []string\n\n\t// calculate disk usage\n\tstorageDevice := node.Attributes[\"unique.storage.volume\"]\n\tvar diskUsed, diskSize uint64\n\tvar physical bool\n\tfor _, disk := range hostStats.DiskStats {\n\t\tif disk.Device == storageDevice {\n\t\t\tdiskUsed = disk.Used\n\t\t\tdiskSize = disk.Size\n\t\t\tphysical = true\n\t\t}\n\t}\n\n\tresources = make([]string, 2)\n\tresources[0] = \"CPU|Memory|Disk\"\n\tif physical {","sourceCodeStart":1008,"sourceCodeEnd":1044,"githubUrl":"https://github.com/hashicorp/nomad/blob/482b49bf1aec006f089bcfc7e632d8f6ac303e5e/command/node_status.go#L1008-L1044","documentation":"getHostResources builds the actual-usage portion of `nomad node status` output from api.HostStats, which is only populated when querying a live agent's local client stats endpoint. If hostStats is nil (stats unavailable, e.g. the node is down or the data came from a non-agent endpoint), it errors with \"actual resource usage not present\" instead of printing fabricated numbers.","triggerScenarios":"`nomad node status <id>` calls formatNode → getHostResources; if the Nodes().Stats call fails or was skipped (node down, unreachable client, stats endpoint disabled) the nil HostStats reaches getHostResources.","commonSituations":"Statusing a down or draining client whose agent cannot be reached; remote region query where only the server-side node record is available; client telemetry/stats collection disabled; firewall blocking the client's HTTP port.","solutions":["Check whether the node's Nomad agent is up and reachable (the error is informational about missing live stats).","Run `nomad node status` from a network location that can reach the client HTTP API.","Verify client config doesn't disable the stats endpoint and that `client.options`/telemetry settings are sane.","Use `nomad node status -verbose`/allocation-level output for what is still available."],"exampleFix":"// before (shell)\nnomad node status dead-node-1   # agent down, no live stats\n// after\nsystemctl status nomad          # restart client agent\nnomad node status dead-node-1","handlingStrategy":"fallback","validationCode":"// shell: only expect live stats if the client is reachable\nagent_up=$(curl -fsS \"http://$CLIENT:4646/v1/agent/health\" >/dev/null 2>&1 && echo yes || echo no)\necho \"live stats available: $agent_up\"","typeGuard":null,"tryCatchPattern":"// bash: degrade gracefully when stats are missing\nif ! out=$(nomad node status \"$ID\" 2>&1); then\n  case \"$out\" in\n    *\"actual resource usage not present\"*) nomad node status -verbose \"$ID\" || true ;;\n  esac\nfi","preventionTips":["Monitor client agent health so down nodes are known before querying stats.","Keep telemetry/stats endpoints enabled in client config.","Don't treat missing host stats as a command failure — fall back to allocation-level data."],"tags":["cli","nomad","node-status","stats","client-unreachable"],"backgroundTag":"stats-unavailable","analyzedSha":"482b49bf1aec006f089bcfc7e632d8f6ac303e5e","analyzedAt":"2026-09-04T07:54:14.808Z","contentChangedAt":"2026-09-04T07:54:14.808Z","schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}