Skip to content

v2.338.0: steps that start a background server and poll localhost fail immediately ("Socket closed before the connection was established"); v2.337.0 is fine #4788

Closed

Description

@akash-lahane

Describe the bug
After our self-hosted runners moved from v2.337.0 to v2.338.0, jobs that start a
dev server in the background and then wait for it on localhost started failing
within about a second. The same repo code and workflow pass on v2.337.0.

The failing step uses a Cypress GitHub Action that runs
start: <dev server command> and wait-on: http://localhost:<port>. The log
shows "waiting on http://localhost:" and then immediately:

##[error]Socket closed before the connection was established

The step previously took several minutes (server start plus tests). Nothing from
the dev server is logged before the failure.

What is and isn't affected

  • Build, lint, unit-test and type-check jobs on the same runners pass.
  • Only steps that start a background server and connect to localhost fail.
  • Reproduced in two unrelated repos, using two different versions of the same
    Cypress action (v2 and v7.3.0), different package managers (yarn, pnpm) and
    different Node versions (20.20.0, 22.16.0).

To Reproduce

  1. Self-hosted Linux x64 runner, ephemeral, on v2.338.0.
  2. Run a workflow step that starts a dev server in the background and waits on
    http://localhost:<port> (we used a Cypress action with start and wait-on).
  3. The step fails in about 1 second with the error above.

Expected behavior
Same as v2.337.0: the server starts, wait-on connects, tests run.

Evidence that it's the runner version

  • Last passing run: runner 2.337.0. First failing runs: runner 2.338.0.
  • No change to the workflow or repo code between them.
  • Rolling the runner back to v2.337.0 fixed it. Re-running the same failed jobs
    now passes.

Possibly related changes in v2.338.0 (unconfirmed)

We haven't identified the mechanism. Happy to gather runner _diag logs or try
ACTIONS_RUNNER_FORCED_INTERNAL_NODE_VERSION=node20 if that helps.

Runner Version and Platform

Version of your runner? 2.338.0 (fails), 2.337.0 (works)
OS of the machine running the runner? Ubuntu 22.04 (AWS EC2, x64, ephemeral runners)

Job Log Output

waiting on "http://localhost:<port>" with timeout of 180 seconds
##[error]Socket closed before the connection was established

Activity

  1. self-assigned this
    on Oct 16, 2026
  2. salmanmkc commented on Oct 16, 2026

    @salmanmkc
    Contributor

    Thanks for the detailed report, I was able to reproduce this.

    2.338.0 bumped the bundled Node 24 from 24.19.0 to 24.21.0. Since Node 24.20.0 (nodejs/node#64847), a refused connection on localhost also surfaces ERR_SOCKET_CLOSED_BEFORE_CONNECTION, and got v11 to v15 treats that as fatal instead of retrying. The Cypress action used got 11 until v7.4.4, so wait-on gives up on the first refused connection instead of waiting for your server.

    Updating to cypress-io/github-action@v7.4.4 or later fixes it (cypress-io/github-action#1873). I tested v2, v7.3.0 and v7.4.6 on both runner versions, and only v7.4.6 works on 2.338.0.

    ACTIONS_RUNNER_FORCED_INTERNAL_NODE_VERSION won't help here, since it only affects the runner's internal Node, not the one actions run on.

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

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions