Skip to content

feat(FR-2898): improve SFTP session creation error feedback#7422

Open
yomybaby wants to merge 1 commit into
mainfrom
05-14-feat_fr-2898_improve_sftp_session_creation_error_feedback
Open

feat(FR-2898): improve SFTP session creation error feedback#7422
yomybaby wants to merge 1 commit into
mainfrom
05-14-feat_fr-2898_improve_sftp_session_creation_error_feedback

Conversation

@yomybaby
Copy link
Copy Markdown
Member

@yomybaby yomybaby commented May 14, 2026

Resolves #7421(FR-2898)

Summary

Improves the SFTP session creation failure UX so the modal carries enough signal for operators (and to triage VoC tickets) to distinguish a quota / policy denial from agent / storage failures. Reported on two customer sites where the misleading "upload session limit reached" message caused multi-hour debugging detours.

Background

When SFTP session creation fails, WebUI currently shows the backend-supplied message — frequently "생성 가능한 업로드 세션 개수 한도에 도달했습니다" — regardless of the actual cause:

  • NHN AICA (core 24.9.4)max_concurrent_sftp_sessions=5, actual usage 1. Real cause: agent port-pool exhaustion (123 exited SFTP containers piled up). Manager logs showed SessionEnqueuedEvent → SessionCancelledEvent(reason=FAILED_TO_START) but the modal said "limit reached".
  • SEC Mobile AI Div (core 25.5.0)max_concurrent_sftp_session=3, actual usage 0. Real cause: bad cert-mount option in agent-docker-container-opts.json preventing container creation. Modal still said "limit reached".

Changes

  1. useErrorMessageResolver — add a verbosity: 'detail' option (packages/backend.ai-ui/src/hooks/useErrorMessageResolver.ts). In detail mode, the resolver prefixes the message with the HTTP status code and backend error_code — e.g. [HTTP 500] [BAI_E0001] <message> — so operators can distinguish a 4xx policy/quota response from a 5xx agent/storage failure without server-side digging. Backwards compatible: existing callers (getErrorMessage(error), getErrorMessage(error, 'fallback')) keep their current output.

  2. SFTP error modal — classification + recovery CTA (react/src/components/SFTPServerButton.tsx, SFTPServerButtonV2.tsx). The error path now opens a modal.confirm with the resolved detail-verbosity message, a hint that lingering upload sessions may be the underlying cause, and a primary action that deep-links to the upload session list (/session?type=system) so users can clean up stale sessions themselves. The secondary action just closes.

  3. Remove orphan i18n keys. data.explorer.NumberOfSFTPSessionsExceededTitle, NumberOfSFTPSessionsExceededBody, and SFTPSessionNotAvailable exist across 21 locale files but have no consumer anywhere in the current React/TS source tree. They were a legacy Polymer leftover; the actual text users see comes through the backend response. Removed across all locales. New keys added in en.json and ko.json; remaining 19 locales will be filled by the i18n agent.

Test plan

  • bash scripts/verify.sh — Relay / Lint / Format pass. The remaining TypeScript failures (SessionLauncherPage, StorageHostSettingPage, UserCredentialsPage, etc.) are pre-existing on main and untouched by this PR; confirmed by git stash+rerun.
  • Manually trigger an SFTP session creation failure (e.g. point the SFTP scaling group at a host with port-pool full, or revoke mount-in-session):
    • Modal title now reads "Failed to create SFTP session" (localized).
    • Body shows [HTTP <code>] [<error_code>] <message> when codes are present; falls back gracefully when absent.
    • "Go to upload sessions" navigates to /session?type=system.
    • "Close" dismisses.
  • Confirm no orphan i18n keys remain: grep -rn "NumberOfSFTPSessionsExceeded\|SFTPSessionNotAvailable" resources/i18n/ returns nothing.
  • Confirm new keys resolve in English and Korean; other locales fall back to English until the i18n agent fills them in.

Out of scope

  • Session Launcher storage-host fetch failure handling (separate flow, separate issue).
  • Backend port-pool tracking / SFTP container GC (backend concern).
  • Idle indicators in the upload session list (separate UX issue).

Related

  • Originating Teams threads attached as web links on FR-2898.
  • Affected versions reported in the field: core 24.9.4 (NHN) and 25.5.0 (SEC Mobile).

Copilot AI review requested due to automatic review settings May 14, 2026 09:57
Copy link
Copy Markdown
Member Author

yomybaby commented May 14, 2026


How to use the Graphite Merge Queue

Add either label to this PR to merge it via the merge queue:

  • flow:merge-queue - adds this PR to the back of the merge queue
  • flow:hotfix - for urgent changes, fast-track this PR to the front of the merge queue

You must have a Graphite account in order to use the merge queue. Sign up using this link.

An organization admin has required the Graphite Merge Queue in this repository.

Please do not merge from GitHub as this will restart CI on PRs being processed by the merge queue.

This stack of pull requests is managed by Graphite. Learn more about stacking.

@github-actions github-actions Bot added area:ux UI / UX issue. area:i18n Localization size:L 100~500 LoC labels May 14, 2026
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 14, 2026

Coverage Report for backend-ai-ui-coverage (./packages/backend.ai-ui)

Status Category Percentage Covered / Total
🔵 Lines 8.57% 361 / 4208
🔵 Statements 7.72% 410 / 5310
🔵 Functions 9.19% 94 / 1022
🔵 Branches 6.92% 362 / 5228
File Coverage
File Stmts Branches Functions Lines Uncovered Lines
Changed Files
packages/backend.ai-ui/src/hooks/useErrorMessageResolver.ts 0% 0% 0% 0% 47-106
Generated in workflow #742 for commit f189f8f by the Vitest Coverage Report Action

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR improves SFTP session creation failure feedback by showing a richer error dialog with detailed error metadata and a shortcut to the upload/system session list.

Changes:

  • Adds detailed error formatting support to useErrorMessageResolver.
  • Updates both SFTP server button components to show a confirm-style error modal with navigation.
  • Replaces/removes older SFTP error translation keys and adds new English/Korean strings.

Reviewed changes

Copilot reviewed 24 out of 24 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
react/src/components/SFTPServerButton.tsx Shows detailed SFTP session creation failure dialog with navigation action.
react/src/components/SFTPServerButtonV2.tsx Mirrors the updated SFTP failure dialog behavior for V2.
packages/backend.ai-ui/src/hooks/useErrorMessageResolver.ts Adds options-based API and detailed error message verbosity.
resources/i18n/en.json Adds new English SFTP failure and navigation strings.
resources/i18n/ko.json Adds new Korean SFTP failure and navigation strings.
resources/i18n/de.json Removes old SFTP error strings.
resources/i18n/el.json Removes old SFTP error strings.
resources/i18n/es.json Removes old SFTP error strings.
resources/i18n/fi.json Removes old SFTP error strings.
resources/i18n/fr.json Removes old SFTP error strings.
resources/i18n/id.json Removes old SFTP error strings.
resources/i18n/it.json Removes old SFTP error strings.
resources/i18n/ja.json Removes old SFTP error strings.
resources/i18n/mn.json Removes old SFTP error strings.
resources/i18n/ms.json Removes old SFTP error strings.
resources/i18n/pl.json Removes old SFTP error strings.
resources/i18n/pt-BR.json Removes old SFTP error strings.
resources/i18n/pt.json Removes old SFTP error strings.
resources/i18n/ru.json Removes old SFTP error strings.
resources/i18n/th.json Removes old SFTP error strings.
resources/i18n/tr.json Removes old SFTP error strings.
resources/i18n/vi.json Removes old SFTP error strings.
resources/i18n/zh-CN.json Removes old SFTP error strings.
resources/i18n/zh-TW.json Removes old SFTP error strings.

Comment thread react/src/components/SFTPServerButton.tsx Outdated
Comment thread react/src/components/SFTPServerButtonV2.tsx Outdated
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 14, 2026

Coverage Report for react-coverage (./react)

Status Category Percentage Covered / Total
🔵 Lines 6.45% 1783 / 27643
🔵 Statements 5.3% 1978 / 37280
🔵 Functions 5.17% 296 / 5717
🔵 Branches 3.71% 1293 / 34799
File Coverage
File Stmts Branches Functions Lines Uncovered Lines
Changed Files
react/src/components/SFTPServerButton.tsx 0% 0% 0% 0% 40-134
react/src/components/SFTPServerButtonV2.tsx 0% 0% 0% 0% 40-134
react/src/components/sftpFailureModal.tsx 0% 100% 0% 0% 33-60
Generated in workflow #742 for commit f189f8f by the Vitest Coverage Report Action

@yomybaby yomybaby force-pushed the 05-14-feat_fr-2898_improve_sftp_session_creation_error_feedback branch from 808fb10 to 09c0465 Compare May 14, 2026 10:02
@yomybaby yomybaby force-pushed the 05-14-feat_fr-2898_improve_sftp_session_creation_error_feedback branch from 09c0465 to f189f8f Compare May 14, 2026 10:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:i18n Localization area:ux UI / UX issue. size:L 100~500 LoC

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Improve SFTP session creation error feedback in WebUI

2 participants