From 053539f6d90e2a692e6872d911234685e4f6b73f Mon Sep 17 00:00:00 2001 From: James Gowdy Date: Wed, 18 Dec 2024 11:23:19 +0000 Subject: [PATCH 1/3] [ML] File upload fixing inference timeout check --- .../file_data_visualizer/components/import_view/auto_deploy.ts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/x-pack/platform/plugins/private/data_visualizer/public/application/file_data_visualizer/components/import_view/auto_deploy.ts b/x-pack/platform/plugins/private/data_visualizer/public/application/file_data_visualizer/components/import_view/auto_deploy.ts index a402d203585d2..ff51cd74ef49f 100644 --- a/x-pack/platform/plugins/private/data_visualizer/public/application/file_data_visualizer/components/import_view/auto_deploy.ts +++ b/x-pack/platform/plugins/private/data_visualizer/public/application/file_data_visualizer/components/import_view/auto_deploy.ts @@ -26,6 +26,9 @@ export class AutoDeploy { // we'll know when it's ready from polling the inference endpoints // looking for num_allocations const status = e.response?.status; + // eslint-disable-next-line no-console + console.dir(e.response); + if (status === 408 || status === 504 || status === 502) { return; } From 71de07e4b4cba7e962da2165b6cb6771dfbad703 Mon Sep 17 00:00:00 2001 From: James Gowdy Date: Wed, 18 Dec 2024 12:18:19 +0000 Subject: [PATCH 2/3] more debugging --- .../file_data_visualizer/components/import_view/auto_deploy.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/x-pack/platform/plugins/private/data_visualizer/public/application/file_data_visualizer/components/import_view/auto_deploy.ts b/x-pack/platform/plugins/private/data_visualizer/public/application/file_data_visualizer/components/import_view/auto_deploy.ts index ff51cd74ef49f..8807cc006e373 100644 --- a/x-pack/platform/plugins/private/data_visualizer/public/application/file_data_visualizer/components/import_view/auto_deploy.ts +++ b/x-pack/platform/plugins/private/data_visualizer/public/application/file_data_visualizer/components/import_view/auto_deploy.ts @@ -28,6 +28,8 @@ export class AutoDeploy { const status = e.response?.status; // eslint-disable-next-line no-console console.dir(e.response); + // eslint-disable-next-line no-console + console.dir(e.response.body); if (status === 408 || status === 504 || status === 502) { return; From 7c79457ad22fd82b2ed15d4f044e87d1ffa9be4e Mon Sep 17 00:00:00 2001 From: James Gowdy Date: Wed, 18 Dec 2024 13:32:33 +0000 Subject: [PATCH 3/3] increasing timeout and ignoring 500s --- .../components/import_view/auto_deploy.ts | 7 +------ .../plugins/private/data_visualizer/server/routes.ts | 11 +++++++---- 2 files changed, 8 insertions(+), 10 deletions(-) diff --git a/x-pack/platform/plugins/private/data_visualizer/public/application/file_data_visualizer/components/import_view/auto_deploy.ts b/x-pack/platform/plugins/private/data_visualizer/public/application/file_data_visualizer/components/import_view/auto_deploy.ts index 8807cc006e373..10389f48d149e 100644 --- a/x-pack/platform/plugins/private/data_visualizer/public/application/file_data_visualizer/components/import_view/auto_deploy.ts +++ b/x-pack/platform/plugins/private/data_visualizer/public/application/file_data_visualizer/components/import_view/auto_deploy.ts @@ -26,12 +26,7 @@ export class AutoDeploy { // we'll know when it's ready from polling the inference endpoints // looking for num_allocations const status = e.response?.status; - // eslint-disable-next-line no-console - console.dir(e.response); - // eslint-disable-next-line no-console - console.dir(e.response.body); - - if (status === 408 || status === 504 || status === 502) { + if (status === 408 || status === 504 || status === 502 || status === 500) { return; } this.inferError = e; diff --git a/x-pack/platform/plugins/private/data_visualizer/server/routes.ts b/x-pack/platform/plugins/private/data_visualizer/server/routes.ts index 9d213182ad049..244c839b1e9fc 100644 --- a/x-pack/platform/plugins/private/data_visualizer/server/routes.ts +++ b/x-pack/platform/plugins/private/data_visualizer/server/routes.ts @@ -145,10 +145,13 @@ export function routes(coreSetup: CoreSetup, logger: Logger) const inferenceId = request.params.inferenceId; const input = request.body.input; const esClient = (await context.core).elasticsearch.client; - const body = await esClient.asCurrentUser.inference.inference({ - inference_id: inferenceId, - input, - }); + const body = await esClient.asCurrentUser.inference.inference( + { + inference_id: inferenceId, + input, + }, + { maxRetries: 0, requestTimeout: 10 * 60 * 1000 } + ); return response.ok({ body }); } catch (e) {