Skip to content

action: point at the tailscaled log when the daemon fails to start - #331

Open
shoemoney wants to merge 1 commit into
tailscale:mainfrom
shoemoney:fix/surface-tailscaled-log
Open

shoemoney wants to merge 1 commit into
tailscale:mainfrom
shoemoney:fix/surface-tailscaled-log

Conversation

@shoemoney

Copy link
Copy Markdown

When tailscaled exits at startup, the action times out with "failed to connect to local tailscaled" and the real cause sits in ~/tailscaled.log, which nobody can read on a hosted runner. #140, #226 and #286 are all people hitting this.

In #154 oxtoacart asked that tailscaled output only be shown when debug logging is enabled, so this follows that:

  • With debug logging on, the timeout error includes the last 20 lines of the log. user:pass@ in URLs is redacted, since tailscaled logs proxy URLs.
  • Otherwise the error gets one extra line saying to re-run with debug logging.

Not done: no special-case hints for known causes such as a missing /dev/net/tun.

The repo has no unit tests, so I ran the helper against a sample log:

--- debug logging off ---
tailscaled daemon did not become ready within timeout, last error: failed to connect to local tailscaled
Re-run with debug logging enabled to include the tailscaled log in this error.
--- debug logging on ---
tailscaled daemon did not become ready within timeout, last error: failed to connect to local tailscaled
tailscaled log (last 4 lines of /home/runner/tailscaled.log):
logtail started
using proxy "http://REDACTED@proxy.internal:3128" for logs
wgengine.NewUserspaceEngine(tun "tailscale0") ...
CreateTUN("tailscale0") failed; /dev/net/tun does not exist

dist/ is rebuilt and prettier --check passes. The stdio array reformat is prettier's doing now that the line fits.

Updates #140

tailscaled's stderr goes to ~/tailscaled.log, so when the daemon exits
at startup the job only reports that the local socket is unreachable.
The cause, such as a missing /dev/net/tun, stays in a file that goes
away with the runner.

When debug logging is enabled, append the last 20 lines of that log to
the timeout error, with credentials in URLs redacted. Otherwise say
that re-running with debug logging will include it.

Updates tailscale#140

Signed-off-by: Jeremy Schoemaker <jeremy@shoemoney.com>
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