cypress: ERROR adm_helpers.cc Failed to query stereo recording

Current behavior:

A few of our users have encountered this message while running Cypress, yet none of them have opened an issue concerning it, so here it is!

Sep 25 2018 21:13

Anybody ever see this error [426:0925/144153.978531:ERROR:adm_helpers.cc(62)] Failed to query stereo recording. ALSA lib confmisc.c:768:(parse_card) cannot find card ‘0’ ALSA lib conf.c:4259:(_snd_config_evaluate) function snd_func_card_driver returned error: No such file or directory ALSA lib confmisc.c:392:(snd_func_concat) error evaluating strings ALSA lib conf.c:4259:(_snd_config_evaluate) function snd_func_concat returned error: No such file or directory ALSA lib confmisc.c:1251:(snd_func_refer) error evaluating name ALSA lib conf.c:4259:(_snd_config_evaluate) function snd_func_refer returned error: No such file or directory ALSA lib conf.c:4738:(snd_config_expand) Evaluate error: No such file or directory ALSA lib pcm.c:2239:(snd_pcm_open_noupdate) Unknown PCM default ALSA lib confmisc.c:768:(parse_card) cannot find card ‘0’ ALSA lib conf.c:4259:(_snd_config_evaluate) function snd_func_card_driver returned error: No such file or directory ALSA lib confmisc.c:392:(snd_func_concat) error evaluating strings ALSA lib conf.c:4259:(_snd_config_evaluate) function snd_func_concat returned error: No such file or directory ALSA lib confmisc.c:1251:(snd_func_refer) error evaluating name ALSA lib conf.c:4259:(_snd_config_evaluate) function snd_func_refer returned error: No such file or directory ALSA lib conf.c:4738:(snd_config_expand) Evaluate error: No such file or directory ALSA lib pcm.c:2239:(snd_pcm_open_noupdate) Unknown PCM default

https://gitter.im/cypress-io/cypress?at=5baa499c01fb5f4ae11e547d

Feb 13 22:19

Hello. I’m seeing error Failed to query stereo recording - any idea how to fix this?

https://gitter.im/cypress-io/cypress?at=5c643c6f8328315decea88f9

May 21 19:25

Hello. My test run stopped prematurely right after this log message: [4861:0521/124346.631077:ERROR:adm_helpers.cc(62)] Failed to query stereo recording. Can anyone tell me what this is and how to fix it? Tx

https://gitter.im/cypress-io/cypress?at=5ce3f5520ac9852a95168552

May 30

Errors while running in CI (ECS) and does not issue exit code

I’ve gone to have a look around in the logs and it seems to have blown up here:

Screenshot-2019-05-30-at-10-17-58

Desired behavior:

To issue the proper exit code while running Cypress.

Steps to reproduce: (app code and test code)

Well, this is the question that requires investigating. I don’t have more information than this error occurs sometimes.

Versions

Cypress 3.1.0+

Some relevant existing issues?

HELP NEEDED

If you are seeing this error, please help us fix it 😄

  • What OS/environment are you running this in? Is it only during cypress run? Is it only in CI?
  • Can you provide more information on what test code you ran exactly when this happened? Does it happen in the same spot each time?
  • Can you run your tests with cypress open, choose the Electron browser, open DevTools where this error occurs? What is logged here? Please provide.
  • Could you run Cypress in debug mode mode and print the logs here?

About this issue

  • Original URL
  • State: open
  • Created 5 years ago
  • Reactions: 3
  • Comments: 27 (3 by maintainers)

Commits related to this issue

Most upvoted comments

I’ve been able to reproduce the bug in a MWE here

I’ve tested some scenarios:

  1. cypress:open does not throw the error with Electron 73 on my local Ubuntu Linux machine.
  2. cypress:run does not throw the error with Electron 73 on my local Ubuntu Linux machine.
  3. cypress:run does throw the error inside the Travis CI build with the Ubuntu image.

So it seem that the issue come from an machine misconfiguration error as mentioned by @iegik and I’m really skeptical about if we can really fix it inside cypress project itself. Look more like we need to set some variables inside the CI build configuration before running the tests or maybe just silence the error.

EDIT

I’ve lightly changed the solution suggested by @amcooper inside my MWE to integrate it in a single line inside my CI build here.

Changes I’ve made are:

  1. Using .asoundrc instead of /etc/asound.conf global system file. That way, we can do the change without being the root user and just add one line before the tests inside your CI.
  2. Instead of setting the soundcard to ‘null’, I’ve used default a configuration found here.

@amcooper into my test inside MWE I do play the video (and so the sound), and still don’t see this issue appear. Could you try my fix and tell you still see the error on your last test ? If so, could you please provide some information about the player you use so I’ll be able to reproduce your error inside the MWE ?

TLDR;

# Execute this command before running cypress:run
echo -e 'pcm.!default {\n type hw\n card 0\n}\n\nctl.!default {\n type hw\n card 0\n}' > ~/.asoundrc

For GitHub Actions the workaround in the mentioned comment sort of works… but still gave a couple warnings (fewer though) such as: [5136:0411/210532.071893:ERROR:alsa_util.cc(204)] PcmOpen: default,No such file or directory [5136:0411/210532.071944:ERROR:alsa_util.cc(204)] PcmOpen: plug:default,No such file or directory

So instead of using the default configuration from here, I do use the null values suggested in here

So basically just running echo -e 'pcm.!default {\n type plug\n slave.pcm "null"\n}' > ~/.asoundrc

Before the cypress github action

I can confirm that the solution using ~/.asoundrc from https://github.com/cypress-io/cypress/issues/4351#issuecomment-559489091 works great on Jenkins. Thank you!

I think, problem is that CI runs should not have any sound device chosen by default

Same here on Gitlab:

[Tue Jun 25 2019 10:34:33 GMT+0000 (UTC)] "GET /static/example-986f22cb655629469901b31ebc890f7d.pdf" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Cypress/3.2.0 Chrome/59.0.3071.115 Electron/1.8.2 Safari/537.36"
[Tue Jun 25 2019 10:34:33 GMT+0000 (UTC)] "GET /static/d/791/path---faqs-21-a-f98-0hjVWnn8LVFg5dP1bOcUohH3U.json" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Cypress/3.2.0 Chrome/59.0.3071.115 Electron/1.8.2 Safari/537.36"
[Tue Jun 25 2019 10:34:33 GMT+0000 (UTC)] "GET /component---src-view-templates-faqs-js-de17e4cb8da2aea47ec6.js" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Cypress/3.2.0 Chrome/59.0.3071.115 Electron/1.8.2 Safari/537.36"
ALSA lib confmisc.c:767:(parse_card) cannot find card '0'
ALSA lib conf.c:4528:(_snd_config_evaluate) function snd_func_card_driver returned error: No such file or directory
ALSA lib confmisc.c:392:(snd_func_concat) error evaluating strings
ALSA lib conf.c:4528:(_snd_config_evaluate) function snd_func_concat returned error: No such file or directory
ALSA lib confmisc.c:1246:(snd_func_refer) error evaluating name
ALSA lib conf.c:4528:(_snd_config_evaluate) function snd_func_refer returned error: No such file or directory
ALSA lib conf.c:5007:(snd_config_expand) Evaluate error: No such file or directory
ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM default
[Tue Jun 25 2019 10:34:33 GMT+0000 (UTC)] "GET /static/d/764/path---accessibility-274-05e-EoYyDLJoIxBWj2YXhQL5dWFHfw.json" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Cypress/3.2.0 Chrome/59.0.3071.115 Electron/1.8.2 Safari/537.36"
ALSA lib confmisc.c:767:(parse_card) cannot find card '0'
ALSA lib conf.c:4528:(_snd_config_evaluate) function snd_func_card_driver returned error: No such file or directory
ALSA lib confmisc.c:392:(snd_func_concat) error evaluating strings
ALSA lib conf.c:4528:(_snd_config_evaluate) function snd_func_concat returned error: No such file or directory
ALSA lib confmisc.c:1246:(snd_func_refer) error evaluating name
ALSA lib conf.c:4528:(_snd_config_evaluate) function snd_func_refer returned error: No such file or directory
ALSA lib conf.c:5007:(snd_config_expand) Evaluate error: No such file or directory
ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM default
ALSA lib confmisc.c:767:(parse_card) cannot find card '0'
ALSA lib conf.c:4528:(_snd_config_evaluate) function snd_func_card_driver returned error: No such file or directory
ALSA lib confmisc.c:392:(snd_func_concat) error evaluating strings
ALSA lib conf.c:4528:(_snd_config_evaluate) function snd_func_concat returned error: No such file or directory
ALSA lib confmisc.c:1246:(snd_func_refer) error evaluating name
ALSA lib conf.c:4528:(_snd_config_evaluate) function snd_func_refer returned error: No such file or directory
ALSA lib conf.c:5007:(snd_config_expand) Evaluate error: No such file or directory
ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM default
ALSA lib confmisc.c:767:(parse_card) cannot find card '0'
ALSA lib conf.c:4528:(_snd_config_evaluate) function snd_func_card_driver returned error: No such file or directory
ALSA lib confmisc.c:392:(snd_func_concat) error evaluating strings
ALSA lib conf.c:4528:(_snd_config_evaluate) function snd_func_concat returned error: No such file or directory
ALSA lib confmisc.c:1246:(snd_func_refer) error evaluating name
ALSA lib conf.c:4528:(_snd_config_evaluate) function snd_func_refer returned error: No such file or directory
ALSA lib conf.c:5007:(snd_config_expand) Evaluate error: No such file or directory
ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM default

I’m now seeing this in my Gitlab pipeline, but I haven’t made any changes in my tests for over a week. If I go back to previous runs it wasn’t present but now is