CircleCI-Public / CircleCI-Public/cimg-node

Bug Report: Unreliable X11 Xvfb server in `browsers` images with new images

Open
#502 21 comments 0 reactions 1 assignee Claimed by @david-montano-circleci View on GitHub
bug
Dominant language
Dockerfile
Stars
46
Forks
33
Avg merge
2h 52m
Merged PRs (30d)
5

Description

**Describe the bug**
This report is a continuation of #482, which was presumed fixed with the #501 image release. However, after upgrading to the `cimg/node:20.20.0-browsers`, we're continuing to see the error intermittently with similar frequency.

Original report:
> Using a cimg/node:*-browsers Docker image when the CircleCI step "Spin up environment" is slow, a pipeline using the image receives the X11 environment variable DISPLAY, however the Xvfb server may not have completed its start, is unavailable and causes a pipeline failure.
>
> If the Xvfb server is not running it causes a failure using the [CircleCI Cypress Orb](https://circleci.com/developer/orbs/orb/cypress-io/cypress).
>
> Cypress checks to see if the environment variable DISPLAY is defined and relies on there being an working X11 server available.
>
> If DISPLAY is not defined, then Cypress will start its own Xvfb server.
>
> The combination of DISPLAY defined and Xvfb not running, causes Cypress to fail and robs it of the chance to start its own server.

**To Reproduce**

This is a sporadic issue that occurs in approximately 5-10% of builds using the `cimg/node:20.20.0-browsers` image.

**Expected behavior**

> When a Docker container is started using a Docker image cimg:node:*-browsers, it should reliably start an Xvfb server and ensure that it is ready before allowing further instructions to be executed.
>
> It is not sufficient to just start the server in the background and hope for the best.

**Workarounds**

> Use [Automatic reruns](https://circleci.com/docs/guides/orchestrate/automatic-reruns/) with max_auto_reruns

**Screenshots and Build Links**
We are seeing similar build failures as previously shown in private org workflows using `cimg/node:20.20.0-browsers`.

```
Cypress failed to start.

This may be due to a missing library or dependency. https://on.cypress.io/required-dependencies

Please refer to the error below for more details.

----------

[1059:0115/194850.304947:ERROR:bus.cc(407)] Failed to connect to the bus: Failed to connect to socket /run/dbus/system_bus_socket: No such file or directory
[1059:0115/194850.501979:ERROR:node_bindings.cc(379)] Most NODE_OPTIONs are not supported in packaged apps. See documentation for more details.
[1059:0115/194850.906240:ERROR:ozone_platform_x11.cc(245)] Missing X server or $DISPLAY
[1059:0115/194850.906258:ERROR:env.cc(258)] The platform failed to initialize. Exiting.

----------

Platform: linux-x64 (Ubuntu - 24.04)
Cypress Version: 14.3.2

Exited with code exit status 1
```

**Additional context**
Add any other context about the problem here.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.