Menu

#150 register_member: confusing error when SSH password auth fails

closed
nobody
None
2026-04-23
2026-04-17
Anonymous
No

Originally created by: kumaakh

Problem

When register_member is called with auth_type: password and either the password prompt doesn't appear (terminal window failed to open on Windows) or the wrong password is entered, the error returned is:

 Failed to connect to <host>:22  All configured authentication methods failed
Member was NOT registered.

This message is identical regardless of cause:

  1. Wrong password supplied
  2. Password prompt window never appeared (silent failure — no GUI environment or window focus issue on Windows)
  3. No SSH key installed and key auth attempted
  4. Host unreachable / port closed

The user cannot distinguish "wrong password" from "prompt didn't open" from "wrong host".

Additionally: the post-register hook fires and prints the onboarding checklist even when registration fails, which implies success.

Expected behaviour

  • Distinguish auth failure from network failure: e.g. Authentication failed (wrong password?) vs Connection refused vs Timeout
  • If the out-of-band password prompt fails to open, surface it explicitly: e.g. Password prompt could not be opened — pass the password directly via thepasswordfield
  • Post-register hook should only fire on successful registration

Steps to reproduce

  1. Call register_member with a valid host/port but wrong SSH password (or with a host where the GUI prompt doesn't open)
  2. Observe: generic "All configured authentication methods failed" with no actionable hint

Related

Tickets: #169

Discussion

  • Anonymous

    Anonymous - 2026-04-23

    Originally posted by: kumaakh

    Fixed in main: PR [#177] (fix: SSH username with spaces + improved SSH error messages) added classifySshError() in src/utils/ssh-error-messages.ts which maps raw ssh2 errors to actionable messages: authentication failures, ECONNREFUSED (wrong host/port), ETIMEDOUT/ENOTFOUND (unreachable host), and OOB prompt failures. Applied in registerMember() at the connection-failure return path. The onboarding hook was also verified to only fire on successful registration (the result path).

     

    Related

    Tickets: #177

  • Anonymous

    Anonymous - 2026-04-23

    Ticket changed by: kumaakh

    • status: open --> closed
     

Log in to post a comment.

MongoDB Logo MongoDB