createSingleVideo() - Failed to launch the browser process
I have a batch process that uses WVC to generate a whole lot of different videos on a Ubuntu 22.04.4 LTS server. Occasionally when I make the first call to createSingleVideo() I get the following errors and it hangs:
[2024-10-17 21:48:57.336][error][ResourcePool<117,39>] Error: Failed to launch the browser process!
[1017/214857.122689:WARNING:audio_manager_linux.cc(53)] Falling back to ALSA for audio output. PulseAudio is not available or could not be initialized.
[1017/214857.156595:ERROR:angle_platform_impl.cc(44)] Display.cpp:1052 (initialize): ANGLE Display::initialize error 12289: Could not open the default X display.
ERR: Display.cpp:1052 (initialize): ANGLE Display::initialize error 12289: Could not open the default X display.
[1017/214857.156632:ERROR:gl_display.cc(520)] EGL Driver message (Critical) eglInitialize: Could not open the default X display.
[1017/214857.156648:ERROR:gl_display.cc(795)] eglInitialize Default failed with error EGL_NOT_INITIALIZED
[1017/214857.157362:ERROR:gl_display.cc(829)] Initialization of all EGL display types failed.
[1017/214857.157372:ERROR:gl_ozone_egl.cc(26)] GLDisplayEGL::Initialize failed.
[1017/214857.158393:ERROR:angle_platform_impl.cc(44)] Display.cpp:1052 (initialize): ANGLE Display::initialize error 12289: Could not open the default X display.
ERR: Display.cpp:1052 (initialize): ANGLE Display::initialize error 12289: Could not open the default X display.
[1017/214857.158416:ERROR:gl_display.cc(520)] EGL Driver message (Critical) eglInitialize: Could not open the default X display.
[1017/214857.158422:ERROR:gl_display.cc(795)] eglInitialize Default failed with error EGL_NOT_INITIALIZED
[1017/214857.158428:ERROR:gl_display.cc(829)] Initialization of all EGL display types failed.
[1017/214857.158433:ERROR:gl_ozone_egl.cc(26)] GLDisplayEGL::Initialize failed.
TROUBLESHOOTING: https://pptr.dev/troubleshooting
at ChildProcess.onClose (file:///home/genie/generator/worker/node_modules/@puppeteer/browsers/lib/esm/launch.js:258:24)
at ChildProcess.emit (node:events:529:35)
at ChildProcess._handle.onexit (node:internal/child_process:292:12)
This keeps happening occasionally and stops the batch process from running. Otherwise everything runs fine if this error doesn't occur on the first call to createSingleVideo().
I have wrapped the call to createSingleVideo() in a try catch but it doesn't seem to catch this error or return from the function call. Is there some way I can catch this error and retry?
Any idea what might be causing it or what I can do to troubleshoot it?
This is running on node v18.20.4 and web-video-creator v0.0.34
Also this is the config that I'm using.
wvc.config({
frameFormat: 'png',
numBrowserMin: 10,
numBrowserMax: 12,
numPageMax: 1,
mp4Encoder: VIDEO_ENCODER.CPU.H264
});
I'll try enabling a display device on the VM to see if that helps improve reliability.