Skip to content

retry transient tunnel login failures on startup instead of exiting - #810

Open
kcoopermiller wants to merge 3 commits into
mainfrom
improvement/tunnel-startup-login-retries
Open

retry transient tunnel login failures on startup instead of exiting#810
kcoopermiller wants to merge 3 commits into
mainfrom
improvement/tunnel-startup-login-retries

Conversation

@kcoopermiller

@kcoopermiller kcoopermiller commented Jul 28, 2026

Copy link
Copy Markdown
Member

the frpc config leaves loginFailExit at its default (true) and the SDK's startup watcher treats the first login to the server failed / connect to server error line in frpc output as fatal. So a single transient failure during tunnel startup kills frpc and the SDK then deletes the tunnel registration. Anything already holding that tunnel URL 404s permanently. This is one of the amplifiers behind the "404 Tunnel not found" errors


Note

Medium Risk
Changes core tunnel connect/cleanup behavior on startup; misclassified log lines could delay failure or abort too early, but scope is limited to prime-tunnel with solid test coverage.

Overview
Tunnel startup no longer tears down registration on the first transient frpc login/connect error, addressing a path where a brief network blip caused frpc to exit, the SDK to run cleanup (including deleting the tunnel), and clients to see permanent 404 Tunnel not found.

Generated frpc config now sets loginFailExit = false so frpc keeps retrying instead of exiting on the first login failure. Startup log handling uses _scan_startup_line to treat "start proxy success" as connected, only fail fast when login/connect errors match known fatal server reasons (inactive tunnel, bad token/binding secret, etc.), and ignore other login/connect lines until success or connection_timeout.

Tests cover line classification, config output, riding out transient errors, fast-fail on rejections, and timeout on endless transient failures.

Reviewed by Cursor Bugbot for commit 71804a7. Bugbot is set up for automated code reviews on this repo. Configure here.

@kcoopermiller

Copy link
Copy Markdown
Member Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Already looking forward to the next diff.

Reviewed commit: f7934151f2

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

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