Skip to content

fcli aviator: Fail fast with clear messages when commands cannot connect - #1145

Draft
kireetivar wants to merge 12 commits into
fortify:dev/v3.xfrom
kireetivar:p/cdatla/aviator-connectivity-failure-handling
Draft

kireetivar wants to merge 12 commits into
fortify:dev/v3.xfrom
kireetivar:p/cdatla/aviator-connectivity-failure-handling

Conversation

@kireetivar

Copy link
Copy Markdown
Contributor

Ordinary Aviator admin, user-login, and admin-config commands no longer wait for the gRPC channel to become ready. A refused connection fails when the operating system reports the refusal. The 30-second request deadline is unchanged.

Audit, correlation, diagnostics, and the existing public createClient(url) constructors still wait. A new ordinary command gets fail-fast only when it uses createGrpcClient or passes AviatorRequestPolicy.FAIL_FAST.

The two-line "was refused" message is used for known English JDK and Netty refusal reasons. Other transport failures get a short unavailable, timeout, DNS, or proxy message. Terminal output and DEBUG logs omit URL userinfo and proxy credentials. DEBUG records the failure kind, the safe message, and cause class names.

A failed Aviator user-login or admin-config validation leaves the existing session or admin config in place. SSC and FoD login behavior is unchanged.

feat: `fcli aviator`: Fail fast with clear messages when ordinary commands cannot connect
fix: `fcli aviator`: Keep the existing user session and admin config when validation fails
fix: `fcli aviator`: Do not show credentials from the Aviator URL in messages and logs

kireetivar and others added 9 commits October 22, 2026 12:41
…ails

AbstractSessionLoginCommand destroyed an existing session before login() ran. If Aviator token or admin-config validation then failed (for example because the server could not be reached), the previous valid session or configuration was lost.

Add the isReplaceExistingSessionBeforeLogin() hook. The default keeps the current behavior for all other modules. The Aviator user session login and admin-config create commands opt out, so they validate first and only replace the stored descriptor after validation succeeds.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Add AbstractFcliException.getSafeDiagnosticString(). The default returns null, so FcliExecutionExceptionHandler keeps logging the full throwable at DEBUG level. An exception whose causes can hold sensitive text can return a safe description instead; the handler then logs only that description.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Add the types for consistent Aviator connectivity failure reporting:

- AviatorRequestPolicy: ORDINARY (fail fast, shared messages) or UNCHANGED (current behavior)
- AviatorConnectionContext/AviatorEndpoint: safe route summary without URLs or credentials
- AviatorConnectivityFailureKind: one message per failure kind
- AviatorConnectivityFailureClassifier: maps UNAVAILABLE/DEADLINE_EXCEEDED to a kind using only exception types, never status descriptions or messages; TLS failures (SSLException, CertificateException) keep their current handling
- AviatorConnectivityException: prints only the user message and supplies a safe DEBUG description

The grpc package does not depend on the diagnose package. The types are not used yet.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
GrpcUtil.executeGrpcCall() now accepts an AviatorRequestPolicy and a connection context. With the ORDINARY policy, unary calls run without wait-for-ready (through a per-call interceptor, because gRPC 1.76 stubs have no withoutWaitForReady()), and UNAVAILABLE/DEADLINE_EXCEEDED failures become AviatorConnectivityException. The 30-second deadline, the shared stubs, and streaming calls do not change.

AviatorGrpcClient and AviatorGrpcClientHelper get overloads that accept the policy. All existing constructors and createClient() methods keep the UNCHANGED policy, so no caller changes behavior yet. The existing status mapping is extracted into toAviatorException() without changes to messages or logging.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Aviator app, token, and entitlement commands, 'aviator session login', and 'aviator admin-config create' now use the ORDINARY request policy. When the Aviator server or the configured proxy refuses the connection, these commands now fail at once instead of waiting until the 30-second request deadline, and print a short message, for example:

  Connection to proxy localhost:33444 was refused
  Check that the proxy is running and that its host and port are correct

All admin commands get the policy through AbstractAviatorAdminSessionOutputCommand.createGrpcClient(). AviatorUserSessionHelper.validateToken() and AviatorAdminConfigHelper.validateConfig() get overloads with a policy; the existing overloads keep the UNCHANGED policy, so connection diagnostics, audit, and correlation commands keep their current behavior.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
parseTarget() and normalizeUrl() included the raw Aviator URL in error messages, in a WARN log entry, and in UnsupportedAviatorUrlSchemeException (which connection diagnostics copy into their evidence). A URL with user info, such as https://user:password@host, exposed the password. These places now show the URL with the user-info part replaced by ***. URLs without user info are shown unchanged.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Consolidate classification and inline messages, retain the existing connection timeout, and recognize Windows connection refusals. Protect sensitive causes in terminal output and malformed URL errors.

Add TLS CONNECT proxy and address-fallback coverage with focused test helpers. Validation: 927 tests passed across common-core, aviator-common, and aviator; git diff --check passed.
@kireetivar kireetivar self-assigned this Oct 23, 2026
kireetivar and others added 3 commits October 23, 2026 11:16
The message is safe to show, so the standard fcli simple exception output is enough. Remove the cause-sensitive and safe-diagnostic hooks from AbstractFcliException, and log only cause types at DEBUG level.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Name the failing proxy or Aviator server, give one remediation, and state the 30-second request limit. Add a TLS failure kind for non-certificate TLS errors; certificate failures keep the fcli PKIX trust-store guidance.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
The generic message no longer blames the server for failures that can be client-side, names the gRPC status, and tells the user how to log details.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant