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

fix: silence dbus errors #20939

Merged
merged 1 commit into from
Apr 7, 2022
Merged

fix: silence dbus errors #20939

merged 1 commit into from
Apr 7, 2022

Conversation

BlueWinds
Copy link
Contributor

@BlueWinds BlueWinds commented Apr 6, 2022

User facing changelog

Silences electron warnings about being unable to connect to dbus. These errors are normal and expected, and do not result in test failures. They are present when running electron inside docker containers 100% of the time.

Additional details

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
[1957:0406/160550.147994:ERROR:bus.cc(392)] Failed to connect to the bus: Address does not contain a colon
[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.

On a more technical level, chromium calls dbus_bus_get(), which is provided by libdbus. This call returns an error if dbus cannot be found or connected to for whatever reason. Chromium handles these errors correctly, internally ceasing to attempt to use the service, but it re-prints the errors to stderr while doing so.

Basically: It tries to connect, gets an error, and aborts. All very normal behavior, which is why no one has tried to 'fix' the problem. Because there is no problem.

How has the user experience changed?

Users will no longer see errors in the log when running Cypress inside docker. Instead of:

image

they'll get

image

PR Tasks

  • Have tests been added/updated?
  • Has the original issue (or this PR, if no issue exists) been tagged with a release in ZenHub? (user-facing changes only)
  • [N/A] Has a PR for user-facing changes been opened in cypress-documentation?
  • [N/A] Have API changes been updated in the type definitions?
  • [N/A] Have new configuration options been added to the cypress.schema.json?

@BlueWinds BlueWinds requested a review from a team as a code owner April 6, 2022 16:31
@cypress-bot
Copy link
Contributor

cypress-bot bot commented Apr 6, 2022

Thanks for taking the time to open a PR!

@cypress
Copy link

cypress bot commented Apr 6, 2022



Test summary

19363 0 218 0Flakiness 0


Run details

Project cypress
Status Passed
Commit eb65946
Started Apr 6, 2022 4:26 PM
Ended Apr 6, 2022 4:38 PM
Duration 11:41 💡
OS Linux Debian - 10.10
Browser Multiple

View run in Cypress Dashboard ➡️


This comment has been generated by cypress-bot as a result of this project's GitHub integration settings. You can manage this integration in this project's settings in the Cypress Dashboard

// 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
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Such a great code comment 😍

// 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:/
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you think this is an adequate Regex? I guess it's highly unlikely someone would have "Failed to connect to the bus:" as some other output that would be stripped. Feels a bit less specific than the other ones stripped though.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This regex is applied pretty narrowly: to the stdout/stderr from electron itself. This doesn't filter any user-generated messages or things coming from our server. I settled on this based on the chromium source code:

  if (!connection_) {
    LOG(ERROR) << "Failed to connect to the bus: "
               << (dbus_error_is_set(error.get()) ? error.message() : "");
    return false;
  }

https://chromium.googlesource.com/chromium/src/+/524f7d22d706ccf6264dbe0ea90a5b469f2c3379/dbus/bus.cc#392

I think it's about as specific as is reasonable here - ideally we won't need to update it as we change electron versions, so the 'technical' stuff up front ([1957:0406/160550.147994:ERROR:bus.cc(392)]) doesn't seem like a good candidate for inclusion.

Copy link
Contributor

@flotwig flotwig left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@BlueWinds When testing yarn cypress:run locally with yarn docker, there is a new Chromium stderr that looks like it will mislead folks in a similar way:

[371:0406/175035.061253:ERROR:gpu_init.cc(453)] Passthrough is not supported, GL is swiftshader, ANGLE is

Can reproduce by doing yarn docker in the monorepo and running yarn cypress:run --project packages/example.


Also, when I run the latest prod cypress open, I get two log lines:

[343988:0406/135427.824393:WARNING:vaapi_wrapper.cc(586)] VAAPI video acceleration not available for swiftshader
[343988:0406/135427.825018:ERROR:gpu_init.cc(453)] Passthrough is not supported, GL is swiftshader, ANGLE is 

Sounds like these could all be related to video acceleration? https://stackoverflow.com/questions/67501093/passthrough-is-not-supported-gl-is-disabled

Feels like these are important to address too, @BlueWinds thoughts?

@emilyrohrbough
Copy link
Member

@BlueWinds I am good with the changes, but I'm wondering if this change will satisfy closing the issue it's linked to? Quite a few people have reported issues with crashes & SIGSEGV errors immediately after seeing these dbus errors and this isn't addressing SIGSEGV errors at all.

@BlueWinds
Copy link
Contributor Author

BlueWinds commented Apr 6, 2022

@BlueWinds I am good with the changes, but I'm wondering if this change will satisfy closing the issue it's linked to? Quite a few people have reported issues with crashes & SIGSEGV errors immediately after seeing these dbus errors and this isn't addressing SIGSEGV errors at all.

I am 100% sure that these errors are not causing the crashes they're seeing.

The ticket linked to here contains people reporting half a dozen different bugs - but none of them are actually related to dbus. This is just the last output line, so they assume their problems must be related, and put it all in the same ticket. The hope is, that by hiding these misleading lines, they will open new, more focused, more helpful tickets. Or at the very least, they'll clump their error reports in more useful ways (systems, browsers, versions).

It won't address the crashes people are seeing - but a bit 'catch all' ticket ensures that we'll never be able to help them at all. It's for that reason that we need to close it - there's nothing useful in there to help us track down the various real issues people are reporting.

@BlueWinds
Copy link
Contributor Author

@BlueWinds When testing yarn cypress:run locally with yarn docker, there is a new Chromium stderr that looks like it will mislead folks in a similar way:

[371:0406/175035.061253:ERROR:gpu_init.cc(453)] Passthrough is not supported, GL is swiftshader, ANGLE is

Can reproduce by doing yarn docker in the monorepo and running yarn cypress:run --project packages/example.

Also, when I run the latest prod cypress open, I get two log lines:

[343988:0406/135427.824393:WARNING:vaapi_wrapper.cc(586)] VAAPI video acceleration not available for swiftshader
[343988:0406/135427.825018:ERROR:gpu_init.cc(453)] Passthrough is not supported, GL is swiftshader, ANGLE is 

Sounds like these could all be related to video acceleration? https://stackoverflow.com/questions/67501093/passthrough-is-not-supported-gl-is-disabled

Feels like these are important to address too, @BlueWinds thoughts?

Yes, I've seen these as well. I don't want to hide them because I don't understand them - I'd want to do another deep-dive into those log lines to see what they mean, if we can fix them, if they're genuinely harmless, etc. before deciding what to do about them. So far I've only done this with the dbus errors, not the GL ones.

Would prefer to do that in a separate effort though.

@emilyrohrbough
Copy link
Member

emilyrohrbough commented Apr 6, 2022

100% agree with your thoughts and reasoning here. Just pointing out if we link this PR as closing this issue, our bot will indicate the issue has been fixed which will be mis-leading since your intentions are close this issue with too many different issues reported and ask people to open new issues with details after upgrading with these error messages filtered out. Might be worth linking this issue, commenting your intentions on the thread when this merges and locking the issue to push towards new issue creation.

@BlueWinds
Copy link
Contributor Author

I commented on that issue already here, will do it again to clarify once this is merged + the bot comments.

@cubanx
Copy link

cubanx commented Apr 6, 2022

So I originally posted that message. Sorry it caused all the confusion, my original bug report was about SIGSEV and not about the issue this is fixing, I just pointed it out as I thought it might be related, but it turns out it isn't :)

You might want to point out to folks that I solved the SIGSEV issue by switching to Chrome from Electron. Our runs have been rock solid (well, except when we break them ;)) since.

Thanks for deep diving and hiding the errors, and tell @chrisbreiding I said 👋🏼

@BlueWinds
Copy link
Contributor Author

So I originally posted that message. Sorry it caused all the confusion, my original bug report was about SIGSEV and not about the issue this is fixing, I just pointed it out as I thought it might be related, but it turns out it isn't :)

You might want to point out to folks that I solved the SIGSEV issue by switching to Chrome from Electron. Our runs have been rock solid (well, except when we break them ;)) since.

Thanks for deep diving and hiding the errors, and tell @chrisbreiding I said 👋🏼

Yeah, absolutely nothing wrong with your original report! It just got tangled up in a dogpile of other issues, and is now the top (and almost only) result when people google the dbus error, which leads to them to pile in there and connect the two (error + SIGSEV).

Copy link
Contributor

@flotwig flotwig left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, I've seen these as well. I don't want to hide them because I don't understand them - I'd want to do another deep-dive into those log lines to see what they mean, if we can fix them, if they're genuinely harmless, etc. before deciding what to do about them. So far I've only done this with the dbus errors, not the GL ones.

Would prefer to do that in a separate effort though.

Totally understand. Is there a follow-up issue or task created for this? I don't want this to get lost, if we don't follow up with that next fix, users will be back in the same confusing place.

@BlueWinds
Copy link
Contributor Author

Yes, I've seen these as well. I don't want to hide them because I don't understand them - I'd want to do another deep-dive into those log lines to see what they mean, if we can fix them, if they're genuinely harmless, etc. before deciding what to do about them. So far I've only done this with the dbus errors, not the GL ones.
Would prefer to do that in a separate effort though.

Totally understand. Is there a follow-up issue or task created for this? I don't want this to get lost, if we don't follow up with that next fix, users will be back in the same confusing place.

#18947. It is marked as 'solved' in the title, but it's an issue specifically related to those errors which users are also finding and identifying as the source of their problems. Not quite as popular as the dbus one, but I'll bring it up for prioritization next.

@cypress-bot
Copy link
Contributor

cypress-bot bot commented Apr 11, 2022

Released in 9.5.4.

This comment thread has been locked. If you are still experiencing this issue after upgrading to
Cypress v9.5.4, please open a new issue.

@cypress-bot cypress-bot bot locked as resolved and limited conversation to collaborators Apr 11, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

"Failed to connect to the bus: Address does not contain a colon" throws a SIGSEGV error
5 participants