diff --git a/x-pack/plugins/fleet/common/types/models/agent.ts b/x-pack/plugins/fleet/common/types/models/agent.ts index b3beb3d6cdec7..fb7c513762784 100644 --- a/x-pack/plugins/fleet/common/types/models/agent.ts +++ b/x-pack/plugins/fleet/common/types/models/agent.ts @@ -161,7 +161,7 @@ export interface AgentDiagnostics { name: string; createTime: string; filePath: string; - status: 'READY' | 'AWAITING_UPLOAD' | 'DELETED' | 'IN_PROGRESS'; + status: 'READY' | 'AWAITING_UPLOAD' | 'DELETED' | 'IN_PROGRESS' | 'FAILED'; actionId: string; } diff --git a/x-pack/plugins/fleet/public/applications/fleet/sections/agents/agent_details_page/components/agent_diagnostics/index.tsx b/x-pack/plugins/fleet/public/applications/fleet/sections/agents/agent_details_page/components/agent_diagnostics/index.tsx index 72b0bd18a555d..b0a588a1d12c4 100644 --- a/x-pack/plugins/fleet/public/applications/fleet/sections/agents/agent_details_page/components/agent_diagnostics/index.tsx +++ b/x-pack/plugins/fleet/public/applications/fleet/sections/agents/agent_details_page/components/agent_diagnostics/index.tsx @@ -132,7 +132,7 @@ export const AgentDiagnosticsTab: React.FunctionComponent ) : ( - +   diff --git a/x-pack/plugins/fleet/server/services/agents/uploads.ts b/x-pack/plugins/fleet/server/services/agents/uploads.ts index a73525d7efc4a..6085ef1e5b801 100644 --- a/x-pack/plugins/fleet/server/services/agents/uploads.ts +++ b/x-pack/plugins/fleet/server/services/agents/uploads.ts @@ -72,7 +72,7 @@ export async function getAgentUploads( const result = { actionId: action.actionId, id: file?.id ?? action.actionId, - status: file?.Status ?? 'IN_PROGRESS', + status: file?.Status ?? (action.error ? 'FAILED' : 'IN_PROGRESS'), name: fileName, createTime: action.timestamp!, filePath, @@ -86,7 +86,7 @@ export async function getAgentUploads( async function _getRequestDiagnosticsActions( esClient: ElasticsearchClient, agentId: string -): Promise> { +): Promise> { const agentActionRes = await esClient.search({ index: AGENT_ACTIONS_INDEX, ignore_unavailable: true, @@ -144,6 +144,7 @@ async function _getRequestDiagnosticsActions( actionId: hit._source?.action_id as string, timestamp: hit._source?.['@timestamp'], fileId: hit._source?.data?.file_id as string, + error: hit._source?.error, })); return agentActions.map((action) => { const actionResult = actionResults.find((result) => result.actionId === action.actionId); @@ -151,6 +152,7 @@ async function _getRequestDiagnosticsActions( actionId: action.actionId, timestamp: actionResult?.timestamp ?? action.timestamp, fileId: actionResult?.fileId, + error: actionResult?.error, }; }); } catch (err) {