Skip to content

Mount: distinct exit codes for credential timeout vs network errors#6

Closed
tyrielv wants to merge 1 commit into
tyrielv/mount-timeoutfrom
tyrielv/mount-auth-exit-codes
Closed

Mount: distinct exit codes for credential timeout vs network errors#6
tyrielv wants to merge 1 commit into
tyrielv/mount-timeoutfrom
tyrielv/mount-auth-exit-codes

Conversation

@tyrielv

@tyrielv tyrielv commented Jun 20, 2026

Copy link
Copy Markdown
Owner

Stacked on microsoft#2030 (tyrielv/mount-timeout).

Problem

During mount startup, when \TryInitializeAndQueryGVFSConfig\ fails, all failure modes mapped to either \GenericError (3)\ or \AuthenticationError (9). This made it impossible to distinguish:

  • GCM hung waiting for interactive auth (common on headless servers)
  • Credentials provided but rejected by the server
  • Network/server unreachable

Additionally, when a cache server was already configured locally, mount would still retry the config query up to 7 times before falling back — blocking mount for up to 30+ seconds on retries whose results would be discarded anyway.

Changes

New exit codes:

Code Name Meaning
10 \CredentialTimeout\ \git credential fill\ did not respond within 30s
11 \NetworkError\ Non-auth server failure (timeout, DNS, 5xx)

Skip retries with cache server: When a cache server URL is already in local git config, \TryInitializeAndQueryGVFSConfig\ uses \maxRetries: 0\ (single attempt). If it fails, mount proceeds immediately with the fallback cache server.

Credential timeout: \git credential fill\ now has a 30-second timeout during mount startup (other credential paths retain infinite wait). If GCM doesn't respond in time, the error message says \Credential manager did not respond within 30 seconds\ and the exit code is 10.

Context

Observed in telemetry: user \sprabhu\ on \SPRABHU-SERVER\ hit repeated mount timeouts because GCM was blocking on interactive auth that nobody was answering. The mount process was alive but stuck in \git credential fill, and MountVerb's 60s pipe connect expired with a misleading 'GVFS.Mount process is not responding' error.

During mount startup, TryInitializeAndQueryGVFSConfig now
distinguishes three failure modes with unique process exit codes:

- CredentialTimeout (10): git credential fill did not respond within
  30 seconds — GCM is likely blocked waiting for interactive auth
  that nobody is answering (common on headless server machines).
- AuthenticationError (9): credentials were provided but the server
  rejected them (expired PAT, insufficient permissions).
- NetworkError (11): non-auth failure contacting the server (timeout,
  DNS, 5xx errors).

Previously all three cases mapped to GenericError (3) or
AuthenticationError (9), making it impossible for callers to
distinguish 'GCM is hung' from 'bad credentials'.

Also skip config query retries when a cache server is already
configured locally. The mount will proceed with the fallback cache
server on first failure rather than blocking on retries whose
results would be discarded anyway.

Signed-off-by: Tyrie Vella <tyrielv@gmail.com>

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@tyrielv tyrielv closed this Jun 20, 2026
@tyrielv tyrielv deleted the tyrielv/mount-auth-exit-codes branch June 20, 2026 00:55
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