Skip to content

Workspace git clones fail because egress waits on the /readyz wakeup probe #482

Done

Description

@zlareb1

Workspace git clones never work on Substrate with egress enabled. The task still comes up Ready, just without its repo.

Why

Substrate turns on an actor's egress only after its wakeup probe passes (ateom-gvisor calls tunnel.Activate after wakeupprobe.WaitAll). AX sets the wakeup probe to /readyz, which returns 503 until workspace setup is done, and setup is what clones the repos. So the clone always runs before the actor has any network. atunnel closes the connection and git fails:

fatal: unable to access 'https://github.com/chalk/chalk.git/': GnuTLS, handshake failed: The TLS connection was non-properly terminated.

After five retries SetupWorkspace gives up but returns nil, so the runner marks the workspace ready anyway. The probe passes, egress comes up, and the command starts. ax describe shows WorkspaceReady=True with nothing checked out. A git ls-remote from ax ssh a few seconds later works with the same egress policy, so it's not the policy.

Repro

kind with Substrate f6a1dc72 (the version in go.mod), a Workspace with any public repo in spec.git, and an egress policy on the task's actor allowing github.com (tlsPassthrough, port 443). Resume the task and check the runner logs for git fetch error (continuing setup).

Fix

I have a fix on my fork: zlareb1@1daf54a (branch fix-workspace-egress). It's small:

  • the wakeup probe uses /healthz, so egress is up during setup. The reconciler already polls /readyz itself for WorkspaceReady, so that condition is unchanged;
  • SetupWorkspace returns an error when a repo fails to fetch, so a failed clone isn't reported ready. The marker is still skipped, so the next boot retries;
  • the readyz poll in Reconcile stops 2s before the caller's deadline. Without this, resuming a task whose workspace stays unready fails with updating task status: getting task from redis: context deadline exceeded, since the poll takes the full 15s ax resume allows.

With it, the repo clones on the first try and the task is Ready. A repo that doesn't exist leaves WorkspaceReady=False (the command still starts), and ax resume returns normally in both cases. go test ./... passes and each new test fails without its fix.

I'd have opened a PR, but external PRs aren't accepted right now (#448), so I'm raising it here instead. Happy to open the PR once contributions are open, or feel free to pick up the commit directly.

Activity

  1. mayawang commented on Oct 15, 2026

    @mayawang
    Collaborator

    Thanks @zlareb1. This looks like the same root cause as #427 (workspace clones run before egress is allowed), so I'll link them. It's part of the workspace setup work on the roadmap.

  2. mayawang commented on Oct 15, 2026

    @mayawang
    Collaborator

    Correction to my earlier note: same symptom as #427, but a different cause. Here egress waits on the wakeup probe, and /readyz waits on setup. Both are part of the workspace setup work, and #449 (AX never creates an egress policy) is needed alongside either fix.

  3. added
    devx
    on Oct 15, 2026
  4. zlareb1 commented on Oct 16, 2026

    @zlareb1
    Author

    @mayawang would it be possible to apply my merge my commit or you would take it up separately later?

  5. mayawang commented on Oct 16, 2026

    @mayawang
    Collaborator

    Thanks @zlareb1. PRs are limited to collaborators for now (see #448). If you link the branch on your fork here, we can open the PR from it with your commit, alongside the egress policy work in #449.

  6. zlareb1 commented on Oct 16, 2026

    @zlareb1
    Author
  7. added 2 commits that reference this issue on Oct 20, 2026
    cdee693
    02f3d5c
  8. rakyll commented on Nov 25, 2026

    @rakyll
    Member

    Fixed: with the push model, /readyz passes while the runner waits, so egress is up before setup runs (#688).

    We are closing this as part of a cleanup after the significant changes in v0.4.0, because it is probably obsolete or out of scope now. If you think this is a mistake, please reopen it (or leave a comment if you can't reopen it).

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    devx

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions