From eb659467ffd0efcd3f56aa177ffe1e3c015257dc Mon Sep 17 00:00:00 2001 From: BlueWinds Date: Wed, 6 Apr 2022 09:20:16 -0700 Subject: [PATCH] fix: silence dbus errors --- cli/lib/exec/spawn.js | 16 +++++++++++++++- cli/test/lib/exec/spawn_spec.js | 3 +++ 2 files changed, 18 insertions(+), 1 deletion(-) diff --git a/cli/lib/exec/spawn.js b/cli/lib/exec/spawn.js index ee903ed512..9d79f88dbd 100644 --- a/cli/lib/exec/spawn.js +++ b/cli/lib/exec/spawn.js @@ -16,7 +16,21 @@ const isXlibOrLibudevRe = /^(?:Xlib|libudev)/ const isHighSierraWarningRe = /\*\*\* WARNING/ const isRenderWorkerRe = /\.RenderWorker-/ -const GARBAGE_WARNINGS = [isXlibOrLibudevRe, isHighSierraWarningRe, isRenderWorkerRe] +// Chromium (which Electron uses) always makes several attempts to connect to the system dbus. +// This works fine in most desktop environments, but in a docker container, there is no dbus service +// and Chromium emits several error lines, similar to these: + +// [1957:0406/160550.146820: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 +// [1957:0406/160550.147994:ERROR:bus.cc(392)] Failed to connect to the bus: Address does not contain a colon + +// These warnings are absolutely harmless. Failure to connect to dbus means that electron won't be able to access the user's +// credential wallet (none exists in a docker container) and won't show up in the system tray (again, none exists). +// Failure to connect is expected and normal here, but users frequently misidentify these errors as the cause of their problems. + +// https://github.com/cypress-io/cypress/issues/19299 +const isDbusWarning = /Failed to connect to the bus:/ + +const GARBAGE_WARNINGS = [isXlibOrLibudevRe, isHighSierraWarningRe, isRenderWorkerRe, isDbusWarning] const isGarbageLineWarning = (str) => { return _.some(GARBAGE_WARNINGS, (re) => { diff --git a/cli/test/lib/exec/spawn_spec.js b/cli/test/lib/exec/spawn_spec.js index fe58325145..425123e329 100644 --- a/cli/test/lib/exec/spawn_spec.js +++ b/cli/test/lib/exec/spawn_spec.js @@ -65,6 +65,9 @@ describe('lib/exec/spawn', function () { [46454:0702/140217.292555:ERROR:gles2_cmd_decoder.cc(4439)] [.RenderWorker-0x7f8bc5815a00.GpuRasterization]GL ERROR :GL_INVALID_FRAMEBUFFER_OPERATION : glDrawElements: framebuffer incomplete [46454:0702/140217.292584:ERROR:gles2_cmd_decoder.cc(4439)] [.RenderWorker-0x7f8bc5815a00.GpuRasterization]GL ERROR :GL_INVALID_FRAMEBUFFER_OPERATION : glClear: framebuffer incomplete [46454:0702/140217.292612:ERROR:gles2_cmd_decoder.cc(4439)] [.RenderWorker-0x7f8bc5815a00.GpuRasterization]GL ERROR :GL_INVALID_FRAMEBUFFER_OPERATION : glDrawElements: framebuffer incomplete' + + [1957:0406/160550.146820: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 + [1957:0406/160550.147994:ERROR:bus.cc(392)] Failed to connect to the bus: Address does not contain a colon ` const lines = _