Trying to get Cypress running (without tyler36/ddev-cypress): Missing X server or $DISPLAY #6472
-
tl;dr: I'm creating a DDEV add-on at https://github.com/TravisCarden/ddev-drupal-xb-dev for configuring a Drupal site for contribution to the Experience Builder initiative. Its major feature is adding interactive Cypress support. I have it working on my machine, but everyone else who has tested it has gotten an X Server error.
Okay, please don't hate me. 😛 I know this is supposed to be a solved problem, but https://github.com/tyler36/ddev-cypress doesn't seem to fit my use case, because I need my setup to match the Experience Builder module's Drupal.org GitLab CI implementation. That means that I need to run the Cypress binary it specifies from a directory in the module--not something included in an image. I'm sure I could make it work, but it seems like I would have to override more than I would use. So here's my problem: I have a complete solution that works perfectly... on my machine. 🤦♂️ I can install it via the same instructions as others do, at https://github.com/TravisCarden/ddev-drupal-xb-dev, and it works for me. But they get the following error: Error
I assume the difference is on our host machines--since the whole point of Docker is to remove the problem of inconsistencies in the container. 🤷♂️ I've tried to think of anything I've done to my host that could be significant--different XQuartz configuration, Cypress cache directories outside the container, environment variables, global node packages--and I can't find it. Does anyone have any ideas? Related issue: tyler36/ddev-cypress#38 |
Beta Was this translation helpful? Give feedback.
Replies: 7 comments 6 replies
-
Is your machine Intel and the one that doesn't work Apple silicon? |
Beta Was this translation helpful? Give feedback.
-
@TravisCarden |
Beta Was this translation helpful? Give feedback.
-
Thank you, both. @rfay, I believe all the machine's we've tested on have been Apple Silicon--both mine, which works, and everyone else's, which fail. @tyler36, I've written up a script that performs the steps directly, without using the addon-itself, which I've asked some people to test. The script, with instructions, is here: https://github.com/TravisCarden/ddev-drupal-xb-dev/blob/36b0d6f/tests/debug.sh. It, too, works for me. We'll see if it works for other people, too. |
Beta Was this translation helpful? Give feedback.
-
Jumping in just to try and help by being a total outsider to this process. First thing I noticed:
Progress thus far: got rid of the dbus error by starting dbus in the web container (ddev ssh, and then 'sudo service start dbus'). Still complains that there's no X display (so I tried installing xorg inside the web container, but that didn't help). It seems like what it really needs is "DISPLAY=0 " or some way to set that environment var? According to this SO - maybe it needs to be set to the host IP? https://stackoverflow.com/questions/73725613/electron-missing-x-server-or-display I'm guessing there's some other piece you have that's related to X11 forwarding - maybe your own XQuartz config, etc - something you did that you forgot about?? |
Beta Was this translation helpful? Give feedback.
-
Thanks, @chrisfromredfin! A total outsider's help is super appreciated. 😛 I saw the |
Beta Was this translation helpful? Give feedback.
-
Thanks for the help everyone! We've got everything working now. 🙂 |
Beta Was this translation helpful? Give feedback.
-
Glad to hear you got everything working. If there's anything in tyler36/ddev-cypress that we can improve on, PRs are alway welcome. Updates to the docs, like troubleshooting or decoding an error message, are espcially helpful for new developers. |
Beta Was this translation helpful? Give feedback.
For several people, it was a case of accidentally skipping some of the documented instructions--specifically, allowing connections from network clients in XQuartz security settings. For one person, we needed to
sleep
for a couple of seconds after opening XQuartz to let it fully start before running Cypress. One person had to change their$DISPLAY
fromhost.docker.internal:0
tohost.orb.internal:0
. (You indicated at tyler36/ddev-cypress#38 (comment) that they should work the same, but one of our testers reported that he had to change it. 🤷♂️)Our complete, working solution can be found at https://github.com/TravisCarden/ddev-drupal-xb-dev, documented as well as I could in the README. They…