Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

5.5.0 regression of 'We failed to record the video' error in Firefox when running 2 spec files #9128

Closed
nicohartto opened this issue Nov 9, 2020 · 48 comments

Comments

@nicohartto
Copy link

nicohartto commented Nov 9, 2020

Regression of this fix #6408

Current behavior

We are running Cypress via Docker in our Gitlab CI/CD and it seems that the video recording issue is back with 5.5.0, reported here #6408 for Cypress 4.x. The specific image we are using is cypress/included:5.5.0@sha256:1bade581de1f7ea02b8a000f4526ded862e020adfd5f5b95cf58eb884cb344d3

Note this only affects Firefox, not Chrome.

Warning: We failed processing this video.
This error will not alter the exit code.
TimeoutError: operation timed out
    at afterTimeout (/root/.cache/Cypress/5.5.0/Cypress/resources/app/packages/server/node_modules/bluebird/js/release/timers.js:46:19)
    at Timeout.timeoutTimeout [as _onTimeout] (/root/.cache/Cypress/5.5.0/Cypress/resources/app/packages/server/node_modules/bluebird/js/release/timers.js:76:13)
    at listOnTimeout (internal/timers.js:549:17)
    at processTimers (internal/timers.js:492:7)
Warning: We failed to record the video.
This error will not alter the exit code.
Error: ffmpeg exited with code 1: pipe:0: Function not implemented
    at ChildProcess.<anonymous> (/root/.cache/Cypress/5.5.0/Cypress/resources/app/packages/server/node_modules/fluent-ffmpeg/lib/processor.js:182:22)
    at ChildProcess.emit (events.js:310:20)
    at Process.ChildProcess._handle.onexit (internal/child_process.js:275:12)
Error: ffmpeg exited with code 1: pipe:0: Function not implemented
    at ChildProcess.<anonymous> (/root/.cache/Cypress/5.5.0/Cypress/resources/app/packages/server/node_modules/fluent-ffmpeg/lib/processor.js:182:22)
    at ChildProcess.emit (events.js:310:20)
    at Process.ChildProcess._handle.onexit (internal/child_process.js:275:12)
Error: ffmpeg exited with code 1: pipe:0: Function not implemented
    at ChildProcess.<anonymous> (/root/.cache/Cypress/5.5.0/Cypress/resources/app/packages/server/node_modules/fluent-ffmpeg/lib/processor.js:182:22)
    at ChildProcess.emit (events.js:310:20)
    at Process.ChildProcess._handle.onexit (internal/child_process.js:275:12)

Desired behavior

  • Firefox video-recording should work.
  • Tests should run and pass, even if video-recording fails.

Test code to reproduce

Code from here, running on Cypress 5.5.0 replicates this: #6408

Versions

  • Cypress 5.5.0 cypress/included:5.5.0@sha256:1bade581de1f7ea02b8a000f4526ded862e020adfd5f5b95cf58eb884cb344d3
  • Gitlab 13.4.3-ee
@bahmutov
Copy link
Contributor

bahmutov commented Nov 13, 2020

Another reproducible example https://app.circleci.com/pipelines/github/cypress-io/cypress-docker-images/365/workflows/45962043-b650-4df3-8edf-fc3da95ad8f7/jobs/22074

Using Docker image cypress/browsers:node14.15.0-chrome86-ff82

@MartinKei
Copy link

MartinKei commented Nov 19, 2020

Same outcome, with similar error happens here in some cases when running tests in parallel.

Using

  • Cypress 5.6.0
  • Jenkins as CI
  • Electron as browser

BTW: Problem disappears as soon as I enable debug output...

For now running with debug output, but hoping this will be resolved.

Warning: We failed to record the video.

This error will not alter the exit code.

Error: ffmpeg exited with code 1: <path>/<to>/<spec>.ts.mp4: No such file or directory

    at ChildProcess.<anonymous> (/home/doozer/.cache/Cypress/5.6.0/Cypress/resources/app/packages/server/node_modules/fluent-ffmpeg/lib/processor.js:182:22)
    at ChildProcess.emit (events.js:310:20)
    at Process.ChildProcess._handle.onexit (internal/child_process.js:275:12)

Error: ffmpeg exited with code 1: <path>/<to>/<spec>.ts.mp4: No such file or directory

    at ChildProcess.<anonymous> (/home/doozer/.cache/Cypress/5.6.0/Cypress/resources/app/packages/server/node_modules/fluent-ffmpeg/lib/processor.js:182:22)
    at ChildProcess.emit (events.js:310:20)
    at Process.ChildProcess._handle.onexit (internal/child_process.js:275:12)

Error: ffmpeg exited with code 1: <path>/<to>/<spec>.ts.mp4: No such file or directory

    at ChildProcess.<anonymous> (/home/doozer/.cache/Cypress/5.6.0/Cypress/resources/app/packages/server/node_modules/fluent-ffmpeg/lib/processor.js:182:22)
    at ChildProcess.emit (events.js:310:20)
    at Process.ChildProcess._handle.onexit (internal/child_process.js:275:12)

The Test Runner unexpectedly exited via a exit event with signal SIGILL

Please search Cypress documentation for possible solutions:

https://on.cypress.io

Check if there is a GitHub issue describing this crash:

https://github.com/cypress-io/cypress/issues

Consider opening a new issue.

@megawebmaster
Copy link

I have the same issue. I tried updating Firefox to 84.0.1, but it didn't help. Downgrading to 79.0 did help - Cypress forces a GC there, causing additional time to make everything work (I assume).

@ThatGuyHS
Copy link

I'm also seeing this issue on version 5.6

@ghost
Copy link

ghost commented Jan 25, 2021

I have the same issue with version 6.3

@ghost
Copy link

ghost commented Jan 26, 2021

I have the same issue running when running in parallel with docker cypress/base:ubuntu16-12.13.1

@felippepuhle
Copy link

felippepuhle commented Feb 17, 2021

Having a similar issue on 6.5.0 + cypress-io/github-action@v2

  My Profile 
Warning: We failed to record the video.

This error will not alter the exit code.

Error: ffmpeg exited with code 1: pipe:0: Function not implemented

    at ChildProcess.<anonymous> (/home/runner/.cache/Cypress/6.5.0/Cypress/resources/app/packages/server/node_modules/fluent-ffmpeg/lib/processor.js:182:22)
    at ChildProcess.emit (events.js:315:20)
    at Process.ChildProcess._handle.onexit (internal/child_process.js:275:12)

Error: ffmpeg exited with code 1: pipe:0: Function not implemented

    at ChildProcess.<anonymous> (/home/runner/.cache/Cypress/6.5.0/Cypress/resources/app/packages/server/node_modules/fluent-ffmpeg/lib/processor.js:182:22)
    at ChildProcess.emit (events.js:315:20)
    at Process.ChildProcess._handle.onexit (internal/child_process.js:275:12)

Error: ffmpeg exited with code 1: pipe:0: Function not implemented

    at ChildProcess.<anonymous> (/home/runner/.cache/Cypress/6.5.0/Cypress/resources/app/packages/server/node_modules/fluent-ffmpeg/lib/processor.js:182:22)
    at ChildProcess.emit (events.js:315:20)
    at Process.ChildProcess._handle.onexit (internal/child_process.js:275:12)

Test run failed, code 1
Could not find Cypress test run results
Error: Could not find Cypress test run results

@EtienneBruines
Copy link

Also occuring on 6.5.0 on Firefox.

Warning: We failed to record the video.
This error will not alter the exit code.
Error: ffmpeg exited with code 1: pipe:0: Function not implemented
    at ChildProcess.<anonymous> (/builds/mossaino/mossaino/cache/Cypress/6.5.0/Cypress/resources/app/packages/server/node_modules/fluent-ffmpeg/lib/processor.js:182:22)
    at ChildProcess.emit (events.js:315:20)
    at Process.ChildProcess._handle.onexit (internal/child_process.js:275:12)
Error: ffmpeg exited with code 1: pipe:0: Function not implemented
    at ChildProcess.<anonymous> (/builds/mossaino/mossaino/cache/Cypress/6.5.0/Cypress/resources/app/packages/server/node_modules/fluent-ffmpeg/lib/processor.js:182:22)
    at ChildProcess.emit (events.js:315:20)
    at Process.ChildProcess._handle.onexit (internal/child_process.js:275:12)
Error: ffmpeg exited with code 1: pipe:0: Function not implemented
    at ChildProcess.<anonymous> (/builds/mossaino/mossaino/cache/Cypress/6.5.0/Cypress/resources/app/packages/server/node_modules/fluent-ffmpeg/lib/processor.js:182:22)
    at ChildProcess.emit (events.js:315:20)
    at Process.ChildProcess._handle.onexit (internal/child_process.js:275:12)

@elio-maggini
Copy link

Also occurs with Chrome on 6.5.0

@ismailcherri
Copy link

ismailcherri commented Mar 3, 2021

Started to happen with Chrome 89, was working fine with Chrome 88

Error: ffmpeg exited with code 1: Error initializing output stream 0:0 -- Error while opening encoder for output stream #0:0 - maybe incorrect parameters such as bit_rate, rate, width or height

Conversion failed!
    at ChildProcess.<anonymous> (/home/builder/.cache/Cypress/6.6.0/Cypress/resources/app/packages/server/node_modules/fluent-ffmpeg/lib/processor.js:182:22)
    at ChildProcess.emit (events.js:315:20)
    at Process.ChildProcess._handle.onexit (internal/child_process.js:275:12)

@wrotson
Copy link

wrotson commented Mar 4, 2021

Also occurs on Cypress 6.2.1, Chrome 89.
Any1 have a working link to Chrome v88 ..._amd64.deb?

@ismailcherri
Copy link

@wrotson

http://dl.google.com/linux/chrome/deb/pool/main/g/google-chrome-stable/google-chrome-stable_88.0.4324.182-1_amd64.deb

@ahoad
Copy link

ahoad commented Mar 9, 2021

Have the same problem with Chrome 89.

Found a quick temp fix is to add the below to the cypress config:
"video": false

@Mas2112
Copy link

Mas2112 commented Mar 10, 2021

I am experiencing the same problem on Edge 89 with Cypress 6.2.1.

@jpita
Copy link

jpita commented Mar 10, 2021

also getting it on firefox 86 with cypress 6.6.0, on circleci using
- image: cimg/node:15.9.0-browsers.

it no longer fails the runs so that's nice.

@jpita
Copy link

jpita commented Mar 10, 2021

Have the same problem with Chrome 89.

Found a quick temp fix is to add the below to the cypress config:
"video": false

@ahoad did u play with video compression options?
https://docs.cypress.io/guides/guides/screenshots-and-videos.html#Video-encoding

I would try myself but my builds don't always have that issue, seems a bit random :(

@jpita
Copy link

jpita commented Mar 10, 2021

humm, it did fail the build now :(

https://app.circleci.com/pipelines/github/wikimedia/wikipedia-kaios/1761/workflows/96ea6801-d7f3-490d-812b-936f25daa768/jobs/2009


[2021-03-10T13:55:49.540Z]  "GET /" "Mozilla/5.0 (X11; Linux x86_64; rv:86.0) Gecko/20100101 Firefox/86.0"
Warning: We failed to record the video.

This error will not alter the exit code.

Error: ffmpeg exited with code 1: pipe:0: Function not implemented

    at ChildProcess.<anonymous> (/home/circleci/.cache/Cypress/6.6.0/Cypress/resources/app/packages/server/node_modules/fluent-ffmpeg/lib/processor.js:182:22)
    at ChildProcess.emit (events.js:315:20)
    at Process.ChildProcess._handle.onexit (internal/child_process.js:275:12)

Error: ffmpeg exited with code 1: pipe:0: Function not implemented

    at ChildProcess.<anonymous> (/home/circleci/.cache/Cypress/6.6.0/Cypress/resources/app/packages/server/node_modules/fluent-ffmpeg/lib/processor.js:182:22)
    at ChildProcess.emit (events.js:315:20)
    at Process.ChildProcess._handle.onexit (internal/child_process.js:275:12)

Error: ffmpeg exited with code 1: pipe:0: Function not implemented

    at ChildProcess.<anonymous> (/home/circleci/.cache/Cypress/6.6.0/Cypress/resources/app/packages/server/node_modules/fluent-ffmpeg/lib/processor.js:182:22)
    at ChildProcess.emit (events.js:315:20)
    at Process.ChildProcess._handle.onexit (internal/child_process.js:275:12)
    ```

@VickyLund
Copy link

VickyLund commented Mar 10, 2021

This might help someone.
We used to face a similar issue with chrome and cypress 6.3.0.
Then we came to know with the Cypress team's support that this happens because we were running 3 parallel processes of cypress run on the same server using Jenkins.
Next, we tried running a single process on the same server and purposely failing some of the tests, in that case, it worked perfectly fine(videos were recorded properly). The root cause was either the parallelization not being handled properly or high usage of the server resources.
Though we are sceptical it's the latter because all the time while running 3 processes, server resources were underutilized.
Now we are trying to dockerize the cypress run.

[2021-01-14T07:54:36.098Z] Warning: We failed to record the video.
[2021-01-14T07:54:36.098Z] 
[2021-01-14T07:54:36.098Z] This error will not alter the exit code.
[2021-01-14T07:54:36.098Z] 
[2021-01-14T07:54:36.098Z] Error: ffmpeg exited with code 1: /var/lib/jenkins/workspace/xxxxxxxx-web-sonar-CBXDY/Automation_Tests/cypress/videos/UI/xxxxxx/xxxxxxxxx.desktop.spec.js.mp4: No such file or directory
[2021-01-14T07:54:36.098Z] 
[2021-01-14T07:54:36.098Z]     at ChildProcess.<anonymous> (/home/consul/.cache/Cypress/6.2.1/Cypress/resources/app/packages/server/node_modules/fluent-ffmpeg/lib/processor.js:182:22)
[2021-01-14T07:54:36.098Z]     at ChildProcess.emit (events.js:315:20)
[2021-01-14T07:54:36.098Z]     at Process.ChildProcess._handle.onexit (internal/child_process.js:275:12)

@jpita
Copy link

jpita commented Mar 10, 2021

@VickyLund I saw something similar today: we don't have parallel tests but the error appeared after a very short suit of tests after a long one, making me think that ffmpeg is still working on the previous video and when it's called again the error appears

@jarretmoses
Copy link

jarretmoses commented Mar 10, 2021

I just started having this issue as well. I am using cypress-io/github-action@v2 cypress 6.6.0 and have my browser set to chrome. I have not touched this set up in a long time and tests ran fine yesterday. The difference I see between yesterday and today is the browser version chrome: 88 (yesterday) vs chrome: 89 (today)

@jpita
Copy link

jpita commented Mar 10, 2021

@jarretmoses adding "video" : false to your config file should fix it (not 100% sure since some people say it still happens with that).
You'll lose video recordings though

@jarretmoses
Copy link

jarretmoses commented Mar 10, 2021

@jpita Im saving that as a last resort as the recordings are important for debugging.

@jpita
Copy link

jpita commented Mar 10, 2021

If the issue is the chrome version you can force the version in CI, right?

@kpittman-securus
Copy link

We are experiencing this issue using Electron when trying to run in parallel on Jenkins. Cypress v6.5.0

@ismailcherri
Copy link

If the issue is the chrome version you can force the version in CI, right?

@jpita Yes, you can change the version you're using/downloading during setup e.g. from stable to a specific version according to the OS you're using

@megawebmaster
Copy link

@VickyLund - that's an interesting idea. I'm running Cypress fully dockerized and I'm having trouble with Firefox newer than 79. I didn't try Chrome 89 yet, but I can see that it has some issues. Maybe there is a bug in handling FFMPEG in Cypress?

@jpita
Copy link

jpita commented Mar 11, 2021

@meganwebmaster yeah that's my theory as well.
I'm actually trying to always have the issue on my local and then move all my test to a single file to avoid more than one video.
This should avoid the ffmpeg issue if it's only called once

@megawebmaster
Copy link

@jpita - I think FFMPEG is called after every test to process the video, not after a processed file.

@jpita
Copy link

jpita commented Mar 11, 2021

@megawebmaster I see it in the command line being called after each spec.js file, but I might be wrong

@jpita
Copy link

jpita commented Mar 11, 2021

this seems to have fixed it for me (still testing but 10 clean runs so far):

  • moving all the tests to one file instead of multiple spec files
  • this is how my cypress.json file looks like
"videoUploadOnPasses": false,
"video": true,
"videoCompression": false,

@Johannes-Berggren
Copy link

Johannes-Berggren commented Mar 15, 2021

Got the same problem when the workflow started using Chrome 89.

I had to disable recordings for it to work, which is more than a little bit annoying. Thanks @jpita!

@jpita
Copy link

jpita commented Mar 15, 2021

even with "videoCompression": false it fails.
had to disable recordings as well 😢

jpita referenced this issue in wikimedia/wikipedia-kaios Mar 15, 2021
@KadeejaBai
Copy link

KadeejaBai commented Jun 18, 2021

I'm facing ffmpeg error with Cypress version : 7.5.0 . Do we have a fix were we can have parallel support + video recording ??
I had to disable video.

Below are the debug logs from cypress

cypress:server:video capture errored: { error: 'ffmpeg exited with code 1: /tmp/build/123/codebase/cypress/videos/test.spec.js.mp4: No such file or directory\n', stdout: '', stderr: 'ffmpeg version N-47683-g0e8eb07980-static https://johnvansickle.com/ffmpeg/ Copyright (c) 2000-2018 the FFmpeg developers\n' + ' built with gcc 6.3.0 (Debian 6.3.0-18+deb9u1) 20170516\n' + ' configuration: --enable-gpl --enable-version3 --enable-static --disable-debug --disable-ffplay --disable-indev=sndio --disable-outdev=sndio --cc=gcc-6 --enable-fontconfig --enable-frei0r --enable-gnutls --enable-gray --enable-libaom --enable-libfribidi --enable-libass --enable-libvmaf --enable-libfreetype --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-librubberband --enable-libsoxr --enable-libspeex --enable-libvorbis --enable-libopus --enable-libtheora --enable-libvidstab --enable-libvo-amrwbenc --enable-libvpx --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxml2 --enable-libxvid --enable-libzimg\n' + ' libavutil 56. 24.101 / 56. 24.101\n' + ' libavcodec 58. 42.100 / 58. 42.100\n' + ' libavformat 58. 24.100 / 58. 24.100\n' + ' libavdevice 58. 6.101 / 58. 6.101\n' + ' libavfilter 7. 46.101 / 7. 46.101\n' + ' libswscale 5. 4.100 / 5. 4.100\n' + ' libswresample 3. 4.100 / 3. 4.100\n' + ' libpostproc 55. 4.100 / 55. 4.100\n' + '[mjpeg @ 0x678c140] EOI missing, emulating\n' + "Input #0, image2pipe, from 'pipe:0':\n" + ' Duration: N/A, start: 1624006383.640000, bitrate: N/A\n' + ' Stream #0:0: Video: mjpeg (Baseline), yuvj420p(pc, bt470bg/unknown/unknown), 1920x1080 [SAR 1:1 DAR 16:9], 25 fps, 25 tbr, 25 tbn, 25 tbc\n' + '/tmp/build/123/codebase/cypress/videos/test.spec.js.mp4: No such file or directory\n' }

@jennifer-shehane
Copy link
Member

So, this issue has become a bit of a catchall for ffmpeg errors in general, but there is at least one case that may have an explanation with a hint from #9128 (comment)

Theory on some of these ffmpeg errors

Cypress trashes the video and screenshot folder by default before each run when run via cypress run. If tests are run in parallel in Cypress, where there are multiple calls of cypress run being run at the same time, the video folder will be deleted at the start of each call to cypress run. If another parallel run is trying to access the video folder after this directory has been deleted, this could cause the errors about " No such file or directory" or also possibly the compression errors like "compression errored".

We haven't verified this completely but this seems like a scenario that could happen.

Suggestion

Set the Cypress config property trashAssetsBeforeRuns to false. This will not delete the video, screenshots, and download folders whenever cypress run is called.

Please let us know if this resolved any of your issues and we can come up with a larger solution.

@marcinczenko
Copy link

marcinczenko commented Aug 10, 2021

@jennifer-shehane This does not seem to fix the issue for me on Cypress 8.2.0 on GitHub actions with browser Firefox. The video processing still fails (and I am running them sequentially). The timeout would suggest that cypress gets killed before the video is finished processing.

UPDATE:
What is interesting is that the videos are actually generated. I do store them as artifact and I can download them and although they seem to be missing some frames, they seem to be fine.

The full error text (after each test run) is:

Warning: We failed processing this video.

This error will not alter the exit code.

TimeoutError: operation timed out
    at afterTimeout (/github/home/.cache/Cypress/8.2.0/Cypress/resources/app/packages/server/node_modules/bluebird/js/release/timers.js:46:19)
    at Timeout.timeoutTimeout [as _onTimeout] (/github/home/.cache/Cypress/8.2.0/Cypress/resources/app/packages/server/node_modules/bluebird/js/release/timers.js:76:13)
    at listOnTimeout (internal/timers.js:554:17)
    at processTimers (internal/timers.js:497:7)

@davidungio
Copy link

@jennifer-shehane - I'm running into the issue still with that flag in Jenkins

Cypress package version: 6.9.1
Cypress binary version: 6.9.1
Electron version: 11.3.0
Bundled Node version: 12.18.3
Done in 0.27s.
+ export CYPRESS_trashAssetsBeforeRun=false
+ export XDG_CONFIG_HOME=/tmp/##
+ export NO_COLOR=1
+ xvfb-run --auto-servernum --server-num=1 yarn cypress run --project /opt/src/cypress/ui --group chrome --headless --browser chrome --parallel --tag stage --ci-build-id jenkins-# --record --key ******** --env grep=smoke --config-file cypress.stage.json
error Command failed with exit code 1.
[Pipeline] sh (Test result)
+ cd /opt
+ cat #_output.txt
yarn run v1.22.10
$ /opt/node_modules/.bin/cypress run --project /opt/src/cypress/ui --group chrome --headless --browser chrome --parallel --tag stage --ci-build-id jenkins-# --record --key ******** --env grep=smoke --config-file cypress.stage.json

====================================================================================================

  (Run Starting)

  ┌────────────────────────────────────────────────────────────────────────────────────────────────┐
  │ Cypress:    6.9.1                                                                              │
  │ Browser:    Chrome 92 (headless)                                                               │
  │ Specs:      16 found (#/#/#.spec.js, #.spec.js, ...                                            |
  │ Params:     Tag: stage, Group: chrome, Parallel: true                                          │
  │ Run URL:    https://dashboard.cypress.io/projects/#/runs/#                                     │
  └────────────────────────────────────────────────────────────────────────────────────────────────┘


────────────────────────────────────────────────────────────────────────────────────────────────────
                                                                                                    
  Running:  #/#/#-#-#.spec.js               (3 of 16)
  Estimated: 1 minute, 17 seconds
	Just tests tagged with: smoke


  # # # Tests
#.spec.js                           (1 of 16)
	Just tests tagged with: smoke
Warning: We failed to record the video.

This error will not alter the exit code.

Error: ffmpeg exited with code 1: /opt/src/cypress/ui/cypress/videos/Manage#/#.spec.js.mp4: No such file or directory

    at ChildProcess.<anonymous> (/opt/cypress/6.9.1/Cypress/resources/app/packages/server/node_modules/fluent-ffmpeg/lib/processor.js:182:22)
    at ChildProcess.emit (events.js:315:20)
    at Process.ChildProcess._handle.onexit (internal/child_process.js:275:12)

hoelzro added a commit to hoelzro/tiddlywiki-first-class-urls that referenced this issue Aug 20, 2021
Otherwise we try running it as an integration test - which *seems*
harmless, but appears to run afoul of a weird bug with video recording
[1]

[1] cypress-io/cypress#9128
@wusgarden
Copy link

We are also seeing this problem pop up in our gitlab pipelines with 8.3.0.
Warning: We failed processing this video. This error will not alter the exit code. TimeoutError: operation timed out at afterTimeout (/root/.cache/Cypress/8.3.0/Cypress/resources/app/packages/server/node_modules/bluebird/js/release/timers.js:46:19) at Timeout.timeoutTimeout [as _onTimeout] (/root/.cache/Cypress/8.3.0/Cypress/resources/app/packages/server/node_modules/bluebird/js/release/timers.js:76:13) at listOnTimeout (internal/timers.js:554:17) at processTimers (internal/timers.js:497:7)

We are using Electron 91 and only have videos set to save upon failure: videoUploadOnPasses=false

@rodybothebynder
Copy link

rodybothebynder commented Nov 2, 2021

For me the same happens for 8.6.0 in combination with Jenkins & Kubernetespods.

` Warning: We failed to record the video.

[2021-11-02T20:12:32.810Z] 

[2021-11-02T20:12:32.810Z] This error will not alter the exit code.

[2021-11-02T20:12:32.810Z] 

[2021-11-02T20:12:32.810Z] Error: ffmpeg exited with code 1: /home/jenkins/agent/workspace/ui-tests/cypress/videos/UI/Authentication/001.loginFail.js.mp4: No such file or directory

[2021-11-02T20:12:32.810Z] 

[2021-11-02T20:12:32.810Z]     at ChildProcess.<anonymous> (/root/.cache/Cypress/8.6.0/Cypress/resources/app/packages/server/node_modules/fluent-ffmpeg/lib/processor.js:182:22)

[2021-11-02T20:12:32.810Z]     at ChildProcess.emit (events.js:376:20)

[2021-11-02T20:12:32.810Z]     at Process.ChildProcess._handle.onexit (internal/child_process.js:277:12)`

@romankhomitskyi
Copy link

romankhomitskyi commented Nov 11, 2021

trashAssests to false helped

@kjohnson-rocket
Copy link

kjohnson-rocket commented Nov 11, 2021

Also running into a similar issue on Cypress 8.6 / Firefox 94 / Jenkins 2.316


[2021-11-11T17:56:08.856Z]   cypress:server:util:process_profiler │ (index) │       group       │ processCount │                         pids                          │ cpuPercent │ meanCpuPercent │ memRssMb │ meanMemRssMb │ maxMemRssMb │

[2021-11-11T17:56:08.856Z]   cypress:server:util:process_profiler ├─────────┼───────────────────┼──────────────┼───────────────────────────────────────────────────────┼────────────┼────────────────┼──────────┼──────────────┼─────────────┤

[2021-11-11T17:56:08.856Z]   cypress:server:util:process_profiler │    0    │     'Firefox'     │      4       │               '4443, 4546, 4592, 4635'                │     0      │      4.39      │  605.62  │    727.91    │   1086.97   │

[2021-11-11T17:56:08.856Z]   cypress:server:util:process_profiler │    1    │     'cypress'     │      1       │                         '647'                         │    2.02    │      3.38      │  250.66  │    224.09    │   250.66    │

[2021-11-11T17:56:08.856Z]   cypress:server:util:process_profiler │    2    │ 'electron-shared' │      4       │                 '687, 878, 688, 922'                  │     0      │       0        │  181.3   │    178.46    │    181.3    │

[2021-11-11T17:56:08.856Z]   cypress:server:util:process_profiler │    3    │     'plugin'      │      1       │                        '1023'                         │    0.91    │      0.18      │  162.66  │    118.69    │   162.66    │

[2021-11-11T17:56:08.856Z]   cypress:server:util:process_profiler │    4    │     'ffmpeg'      │      8       │ '1036, 1456, 1930, 3290, 3639, 3930 ... 2 more items' │     0      │       0        │  66.46   │    26.44     │    66.46    │

[2021-11-11T17:56:08.856Z]   cypress:server:util:process_profiler │    5    │      'other'      │      2       │                     '4667, 4668'                      │     0      │       0        │   3.4    │    16.47     │   443.51    │

[2021-11-11T17:56:08.856Z]   cypress:server:util:process_profiler │    6    │      'TOTAL'      │      20      │                          '-'                          │    2.94    │      7.56      │  1270.1  │   1223.57    │   1635.53   │

[2021-11-11T17:56:08.857Z]   cypress:server:util:process_profiler └─────────┴───────────────────┴──────────────┴───────────────────────────────────────────────────────┴────────────┴────────────────┴──────────┴──────────────┴─────────────┘ +10s

[2021-11-11T17:56:13.034Z] Warning: We failed processing this video.

[2021-11-11T17:56:13.034Z] 

[2021-11-11T17:56:13.034Z] This error will not alter the exit code.

[2021-11-11T17:56:13.034Z] 

[2021-11-11T17:56:13.034Z] TimeoutError: operation timed out

[2021-11-11T17:56:13.034Z]     at afterTimeout (/home/jenkins/.cache/Cypress/8.6.0/Cypress/resources/app/packages/server/node_modules/bluebird/js/release/timers.js:46:19)

[2021-11-11T17:56:13.034Z]     at Timeout.timeoutTimeout [as _onTimeout] (/home/jenkins/.cache/Cypress/8.6.0/Cypress/resources/app/packages/server/node_modules/bluebird/js/release/timers.js:76:13)

[2021-11-11T17:56:13.034Z]     at listOnTimeout (internal/timers.js:555:17)

[2021-11-11T17:56:13.034Z]     at processTimers (internal/timers.js:498:7)

@adamdicarlo
Copy link

Reproduces for me on the official cypress/included:9.0.0 docker image.

Recording and uploading work in Chrome, but not in Firefox.

Various facts:

  • Docker host is an Ubuntu 20.04 Focal VirtualBox VM.
  • I'm recording the videos and screenshots to folders in /tmp, created via mktemp
  • There is a docker volume mount on $HOME/.cache
  • There are no /tmp volume mounts
  • I'm just running one Cypress container at a time

A sample invocation command:

yarn --cwd=/home/dev/REDACTED/code/js cy:run:record --config=screenshotsFolder=/tmp/cypress-screens.2MZT.862B,videosFolder=/tmp/cypress-videos.2MZT.WV0Z --browser=firefox

The cy:run:record yarn script is defined as

       "cy:run:record": "NODE_ENV=test yarn cypress run --record --key=REDACTED",

Here's a sample of the output for the error:

[cypress]   1 passing (17s)
[cypress] 
[cypress] Warning: We failed processing this video.
[cypress] 
[cypress] This error will not alter the exit code.
[cypress] 
[cypress] TimeoutError: operation timed out
[cypress]     at afterTimeout (/home/dev/.cache/Cypress/9.0.0/Cypress/resources/app/packages/server/node_modules/bluebird/js/release/timers.js:46:19)
[cypress]     at Timeout.timeoutTimeout [as _onTimeout] (/home/dev/.cache/Cypress/9.0.0/Cypress/resources/app/packages/server/node_modules/bluebird/js/release/timers.js:76:13)
[cypress]     at listOnTimeout (node:internal/timers:557:17)
[cypress]     at processTimers (node:internal/timers:500:7)

With DEBUG=cypress:*, I see this possible clue -- stderr output from ffmpeg:

[cypress]   cypress:server:video capture stderr log { message: 'ffmpeg version N-47683-g0e8eb07980-static https://johnvansickle.com/ffmpeg/  Copyright (c) 2000-2018 the FFmpeg developers' } +7ms
[cypress]   cypress:server:video capture stderr log { message: '  built with gcc 6.3.0 (Debian 6.3.0-18+deb9u1) 20170516' } +1ms
[cypress]   cypress:server:video capture stderr log { message: '  configuration: --enable-gpl --enable-version3 --enable-static --disable-debug --disable-ffplay --disable-indev=sndio --disable-outdev=sndio --cc=gcc-6 --enable-fontconfig --enable-frei0r --enable-gnutls --enable-gray --enable-libaom --enable-libfribidi --enable-libass --enable-libvmaf --enable-libfreetype --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-librubberband --enable-libsoxr --enable-libspeex --enable-libvorbis --enable-libopus --enable-libtheora --enable-libvidstab --enable-libvo-amrwbenc --enable-libvpx --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxml2 --enable-libxvid --enable-libzimg' } +0ms
[cypress]   cypress:server:video capture stderr log { message: '  libavutil      56. 24.101 / 56. 24.101' } +0ms
[cypress]   cypress:server:video capture stderr log { message: '  libavcodec     58. 42.100 / 58. 42.100' } +0ms
[cypress]   cypress:server:video capture stderr log { message: '  libavformat    58. 24.100 / 58. 24.100' } +0ms
[cypress]   cypress:server:video capture stderr log { message: '  libavdevice    58.  6.101 / 58.  6.101' } +0ms
[cypress]   cypress:server:video capture stderr log { message: '  libavfilter     7. 46.101 /  7. 46.101' } +0ms
[cypress]   cypress:server:video capture stderr log { message: '  libswscale      5.  4.100 /  5.  4.100' } +1ms
[cypress]   cypress:server:video capture stderr log { message: '  libswresample   3.  4.100 /  3.  4.100' } +0ms
[cypress]   cypress:server:video capture stderr log { message: '  libpostproc    55.  4.100 / 55.  4.100' } +0ms
[cypress]   cypress:server:browsers:firefox available ports: { foxdriverPort: 35911, marionettePort: 35935 } +3ms

@adamdicarlo
Copy link

OK, that output from ffmpeg is normal. However, the fact that the is no more output from ffmpeg is not.

Looks like Firefox/Cypress is never outputting any video data into the input file/pipe that ffmpeg is reading from.

Maybe something in Firefox's remote-control APIs changed?

@laerteneto
Copy link

laerteneto commented Dec 7, 2021

The same issue over here on Firefox 94 and not in parallel (Cypress 9.1.1) in both Windows 10 and Linux machines
image

@pranavj1001
Copy link

Found this issue today, I had posted a similar issue on 8th October here - #18415 . I've also added steps to reproduce this.

@rubencodes
Copy link

rubencodes commented Jan 14, 2022

Also having the above^ issue. Running Cypress 9.2.1 in GitLab CI/CD, on Firefox, with the cypress/browsers:node16.5.0-chrome94-ff93 image, I get the output:

Warning: We failed processing this video.
273 This error will not alter the exit code.
274 TimeoutError: operation timed out
275    at afterTimeout (/<gitlab-path>/cache/Cypress/9.2.1/Cypress/resources/app/packages/server/node_modules/bluebird/js/release/timers.js:46:19)
276    at Timeout.timeoutTimeout [as _onTimeout] (/<gitlab-path>/cache/Cypress/9.2.1/Cypress/resources/app/packages/server/node_modules/bluebird/js/release/timers.js:76:13)
277    at listOnTimeout (node:internal/timers:557:17)
278    at processTimers (node:internal/timers:500:7)

I ran with DEBUG=cypress:server:video, and see the following output towards the start of my test run:

cypress:server:video capture started { command: "ffmpeg -n 20 /<gitlab-path>/cache/Cypress/9.2.1/Cypress/resources/app/node_modules/@ffmpeg-installer/linux-x64/ffmpeg -f webm -r 18 -i pipe:0 -y -vcodec libx264 -filter:v crop='floor(in_w/2)*2:floor(in_h/2)*2' -preset ultrafast /<gitlab-path>/cypress/videos/login.spec.ts.mp4" } +1s
63  cypress:server:video capture stderr log { message: 'ffmpeg version N-47683-g0e8eb07980-static https://johnvansickle.com/ffmpeg/  Copyright (c) 2000-2018 the FFmpeg developers' } +2ms
64  cypress:server:video capture stderr log { message: '  built with gcc 6.3.0 (Debian 6.3.0-18+deb9u1) 20170516' } +1ms
65  cypress:server:video capture stderr log { message: '  configuration: --enable-gpl --enable-version3 --enable-static --disable-debug --disable-ffplay --disable-indev=sndio --disable-outdev=sndio --cc=gcc-6 --enable-fontconfig --enable-frei0r --enable-gnutls --enable-gray --enable-libaom --enable-libfribidi --enable-libass --enable-libvmaf --enable-libfreetype --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-librubberband --enable-libsoxr --enable-libspeex --enable-libvorbis --enable-libopus --enable-libtheora --enable-libvidstab --enable-libvo-amrwbenc --enable-libvpx --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxml2 --enable-libxvid --enable-libzimg' } +0ms
66  cypress:server:video capture stderr log { message: '  libavutil      56. 24.101 / 56. 24.101' } +0ms
67  cypress:server:video capture stderr log { message: '  libavcodec     58. 42.100 / 58. 42.100' } +0ms
68  cypress:server:video capture stderr log { message: '  libavformat    58. 24.100 / 58. 24.100' } +0ms
69  cypress:server:video capture stderr log { message: '  libavdevice    58.  6.101 / 58.  6.101' } +0ms
70  cypress:server:video capture stderr log { message: '  libavfilter     7. 46.101 /  7. 46.101' } +1ms
71  cypress:server:video capture stderr log { message: '  libswscale      5.  4.100 /  5.  4.100' } +0ms
72  cypress:server:video capture stderr log { message: '  libswresample   3.  4.100 /  3.  4.100' } +0ms
73  cypress:server:video capture stderr log { message: '  libpostproc    55.  4.100 / 55.  4.100' } +0ms

(No additional cypress:server:video output after that.)

I have video set to true and trashAssetsBeforeRuns set to false in my cypress.json file. I should note, I'm not running tests in parallel.

Potentially unrelated, but I see the following output at the start of my run as well:

[272:0113/225017.388353:ERROR:bus.cc(392)] Failed to connect to the bus: Failed to connect to socket /var/run/dbus/system_bus_socket: No such file or directory
53[272:0113/225017.389761:ERROR:bus.cc(392)] Failed to connect to the bus: Address does not contain a colon
54[272:0113/225017.389784:ERROR:bus.cc(392)] Failed to connect to the bus: Address does not contain a colon
55[443:0113/225017.426331:ERROR:gpu_init.cc(453)] Passthrough is not supported, GL is swiftshader, ANGLE is 

@ViniciusResende
Copy link

I'm also having the same problem as mentioned above. Running Cypress 9.4.1 at CircleCI, using Firefox. I'm having this warning output pasted below:

Warning: We failed processing this video.

This error will not alter the exit code.

TimeoutError: operation timed out
    at endVideoCapture (/root/.cache/Cypress/9.4.1/Cypress/resources/app/packages/server/lib/video_capture.js:118:18)
    at /root/.cache/Cypress/9.4.1/Cypress/resources/app/packages/server/lib/modes/run.js:1202:15
    at listOnTimeout (node:internal/timers:557:17)
    at processTimers (node:internal/timers:500:7)
From previous event:
    at Object.waitForTestsToFinishRunning (/root/.cache/Cypress/9.4.1/Cypress/resources/app/packages/server/lib/modes/run.js:1167:6)
    at /root/.cache/Cypress/9.4.1/Cypress/resources/app/packages/server/lib/modes/run.js:1452:23
From previous event:
    at Object.runSpec (/root/.cache/Cypress/9.4.1/Cypress/resources/app/packages/server/lib/modes/run.js:1450:6)
    at runEachSpec (/root/.cache/Cypress/9.4.1/Cypress/resources/app/packages/server/lib/modes/run.js:1321:19)
From previous event:
    at serial (/root/.cache/Cypress/9.4.1/Cypress/resources/app/packages/server/lib/modes/run.js:401:20)
    at iterateThroughSpecs (/root/.cache/Cypress/9.4.1/Cypress/resources/app/packages/server/lib/modes/run.js:461:10)
    at /root/.cache/Cypress/9.4.1/Cypress/resources/app/packages/server/lib/modes/run.js:1346:14
    at processImmediate (node:internal/timers:464:21)
From previous event:
    at Object.runSpecs (/root/.cache/Cypress/9.4.1/Cypress/resources/app/packages/server/lib/modes/run.js:1345:6)
    at runAllSpecs (/root/.cache/Cypress/9.4.1/Cypress/resources/app/packages/server/lib/modes/run.js:1590:25)
    at /root/.cache/Cypress/9.4.1/Cypress/resources/app/packages/server/lib/modes/run.js:1648:18
    at /root/.cache/Cypress/9.4.1/Cypress/resources/app/node_modules/getos/index.js:65:18
    at releasefile (/root/.cache/Cypress/9.4.1/Cypress/resources/app/node_modules/getos/logic/debian.js:25:3)
    at /root/.cache/Cypress/9.4.1/Cypress/resources/app/node_modules/getos/logic/debian.js:13:19
    at ChildProcess.exithandler (node:child_process:413:5)
    at ChildProcess.emit (node:events:394:28)
    at maybeClose (node:internal/child_process:1067:16)
    at Socket.<anonymous> (node:internal/child_process:453:11)
    at Socket.emit (node:events:394:28)
    at Pipe.<anonymous> (node:net:672:12)
From previous event:
    at /root/.cache/Cypress/9.4.1/Cypress/resources/app/packages/server/lib/modes/run.js:1559:10

I've tried to use the DEBUG env variable intending to get more information about the problem, but nothing that I could attach to. Using DEBUG=cypress:server:video I had the same output than the comment that is right above mine.

I've also tried to set up trashAssetsBeforeRuns to false as said by @jennifer-shehane as a possible suggestion. Although, it didn't solve for me. Not running in parallel too.

So, there I'll add something that could be valuable for someone facing the same problem or for Cypress team investigation. My problem is directly related to Firefox and its version .

There are the images that I've used and the result that I've obtained in the matter of eliminating the video problem.

With those images mentioned, I've faced the problem with recording the videos:


With those images mentioned, I've not faced the same problem:


I may find important to add, that when using Chrome instead of Firefox I don't face the video problem in any of those Docker images. For the Cypress version that I'm using, I can't run using a Firefox version below 86, so, for now, that is what I have to add. And, as long as this problem continues to happen, I'll have to continue running my Cypress on Firefox 89.

@BlueWinds
Copy link
Contributor

BlueWinds commented Feb 15, 2022

@laerteneto, @rubencodes, @ViniciusResende - It's an unfortunate state of affairs, but video in Cypress is just plain broken in FF93+. Pranajv1001 has created #18415, and I've started looking into the problem over there.

I'm going to suggest we move conversation to that issue, just so we have one bug for tracking the problem. Closing this issue does not reflect a belief that this isn't a real issue, or a lack of interest in fixing it! It is both real and important. Just trying to consolidate the conversation into one place.

@aartyszko9
Copy link

In my case changing docker image to cypress/browsers:node-18.16.0-chrome-113.0.5672.92-1-ff-113.0-edge-113.0.1774.35-1 resolved this issue

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

No branches or pull requests