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

SNOW-1552759: Super annoying warning message from gosnowflake every invocation of Hashicorp vault cli under sudo #1182

Closed
DrDaveD opened this issue Jul 23, 2024 · 5 comments
Assignees
Labels
bug Erroneous or unexpected behaviour status-fixed_awaiting_release The issue has been fixed, its PR merged, and now awaiting the next release cycle of the connector. status-triage_done Initial triage done, will be further handled by the driver team

Comments

@DrDaveD
Copy link

DrDaveD commented Jul 23, 2024

This message is displayed every time the Hashicorp vault-1.17.2 cli is invoked under sudo to root, at least on RHEL8:

WARN[0000]log.go:244 gosnowflake.(*defaultLogger).Warn DBUS_SESSION_BUS_ADDRESS envvar looks to be not set, this can lead to runaway dbus-daemon processes. To avoid this, set envvar DBUS_SESSION_BUS_ADDRESS=$XDG_RUNTIME_DIR/bus (if it exists) or DBUS_SESSION_BUS_ADDRESS=/dev/null.

This message comes from gosnowflake and was reported in vault at hashicorp/vault#22560 but that issue was closed saying to report here instead. Most of the questions in the standard gosnowflake issue template aren't relevant, but this was compiled with go version 1.22.5, and the go.mod for vault-1.17.2 says it is using github.com/snowflakedb/gosnowflake v1.10.0.

When logged in with ssh to a RHEL8 linux server, DBUS_SESSION_BUS_ADDRESS is set so the warning is not emitted, but the variable does not carry over to sudo -s so it is emitted there. However I have never seen any evidence of extra dbus-daemon processes when running vault from sudo -s on Rocky8 or Alma8. There is a dbus-daemon process running on the system as the dbus user and that gets detected by the code added in #1058 so the message is emitted. I tried to reproduce the original problem by unsetting DBUS_SESSION_BUS_ADDRESS and removing $XDG_RUNTIME_DIR/bus but I did not get any extra dbus-daemon processes with either vault or by running select1.go as suggested in #773. Maybe I'm not running the latter test right; it required setting values for SNOWFLAKE_TEST_{ACCOUNT|USER|PASSWORD} which I set to arbitrary values and it just seemed to hang then when I did go run cmd/select1/select1.go in a clone of this git repository.

So the message is warning about a non-existent problem as far as I can see, and very annoying. I build an rpm for vault that is used by about a half-dozen other people and I'd rather not have to explain all this to all of them. I guess I will need to add a patch to vault to add DBUS_SESSION_BUS_ADDRESS=/dev/null into its environment when the variable isn't set, but I didn't want to do that without reporting the issue here at least, as was suggested in the vault issue. Maybe this warning should be avoided when running as root, but on the other hand since I can't reproduce the runaway dbus problem at all I'm not sure whether it might happen in some situations as root for some people too.

@DrDaveD DrDaveD added the bug Erroneous or unexpected behaviour label Jul 23, 2024
@github-actions github-actions bot changed the title Super annoying warning message from gosnowflake every invocation of Hashicorp vault cli under sudo SNOW-1552759: Super annoying warning message from gosnowflake every invocation of Hashicorp vault cli under sudo Jul 23, 2024
@sfc-gh-dszmolka sfc-gh-dszmolka added the status-triage Issue is under initial triage label Jul 24, 2024
@sfc-gh-dszmolka sfc-gh-dszmolka self-assigned this Jul 24, 2024
@sfc-gh-dszmolka
Copy link
Contributor

hey - thanks for reporting the issue here and sharing the details. Indeed this is nothing but a single logline emitted, nothing else happens. Will look into this.

@sfc-gh-dszmolka sfc-gh-dszmolka added status-pr_pending_merge A PR is made and is under review status-triage_done Initial triage done, will be further handled by the driver team and removed status-triage Issue is under initial triage labels Jul 24, 2024
@DrDaveD
Copy link
Author

DrDaveD commented Jul 24, 2024

For now my workaround is to put an sh wrapper around vault in my rpm to set DBUS_SESSION_BUS_ADDRESS=/dev/null if the variable isn't set. I first tried a go patch but failed to figure out how to get the workaround code to run before the gosnowflake warning.

@sfc-gh-dszmolka sfc-gh-dszmolka added status-fixed_awaiting_release The issue has been fixed, its PR merged, and now awaiting the next release cycle of the connector. and removed status-pr_pending_merge A PR is made and is under review labels Jul 25, 2024
@sfc-gh-dszmolka
Copy link
Contributor

sfc-gh-dszmolka commented Jul 25, 2024

change at #1184 is merged and will be part of the next gosnowflake release

@sfc-gh-dszmolka
Copy link
Contributor

released with gosnowflake v1.11.0 in July 2024

jefferbrecht added a commit to GoogleCloudPlatform/opentelemetry-operations-collector that referenced this issue Aug 30, 2024
Should address a log noise issue; see snowflakedb/gosnowflake#1182.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Erroneous or unexpected behaviour status-fixed_awaiting_release The issue has been fixed, its PR merged, and now awaiting the next release cycle of the connector. status-triage_done Initial triage done, will be further handled by the driver team
Projects
None yet
Development

No branches or pull requests

2 participants