Skip to content

[BUG] Remote Agent Access: quick tunnel dies seconds after QR appears (cloudflared child exits) #593

Description

@anasubaid19

Will you contribute a fix?

No — reporting for maintainers to handle

Bug Summary

Remote Agent Access uses a cloudflared quick tunnel to expose the local
server via an ephemeral https://*.trycloudflare.com URL (shown as a QR).
The URL appears successfully, but ~2–5 s later the tunnel drops and the app
shows "Tunnel disconnected". The local server keeps listening, but the
cloudflared child process that Termul spawned has exited.

This makes Remote Agent Access unusable (blocker).

Reproduced on macOS (Apple Silicon) with Termul Manager v0.4.10 and
cloudflared 2026.7.3 (Homebrew). A manual cloudflared tunnel --url http://127.0.0.1:<port> against the same live server port stays healthy
indefinitely, so the server, binary, and network are fine — only the
app-spawned child dies. Root cause traced to spawn_line_scanner in
src-tauri/src/remote/cloudflared.rs (stops draining the pipe after the URL
is found → EPIPE/SIGPIPE kills cloudflared seconds later).

Steps to Reproduce

  1. Install cloudflared via Homebrew (brew install cloudflared) — the
    binary is not bundled in Termul Manager v0.4.10.
  2. Make the binary visible to the app (GUI apps don't read the shell PATH on
    macOS; /opt/homebrew/bin is not in /etc/paths):
    launchctl setenv TERMUL_CLOUDFLARED_PATH /opt/homebrew/bin/cloudflared
    then relaunch the app.
  3. Open Termul Manager → enable Remote Agent Access.
  4. Wait for the QR code / https://*.trycloudflare.com URL to appear.
  5. Observe for ~2–5 seconds.

Environment

  • Termul Manager: v0.4.10

  • OS: macOS, Apple Silicon (aarch64)

  • cloudflared: 2026.7.3 — installed via Homebrew (/opt/homebrew/bin/cloudflared), not bundled by the app

  • Binary resolution: TERMUL_CLOUDFLARED_PATH=/opt/homebrew/bin/cloudflared env override (GUI apps on macOS don't read the shell PATH)

Logs, Errors, or Screenshots

Additional Context

termul.log

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions