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-1553756 use forked version 99design/keyring without kwallet/secretservice to avoid dbus issue #1296

Draft
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

sfc-gh-dszmolka
Copy link
Contributor

@sfc-gh-dszmolka sfc-gh-dszmolka commented Jan 30, 2025

#1183 for the full story

Description

99designs/keyring has a long outstanding bug (99designs/keyring#103) which on certain Linux distros, results in runaway dbus-daemon processes. It seems to originate from kwallet/secretservice modules of the said library, which we in gosnowflake do not even use; we use a JSON file for temporal credential storage on Linux.

Yet, suffering from the issue originating from the bug, because the modules are of course initialized (= bug happens) even when not used.

A long term and nice solution will be entirely replacing 99design/keyring with a different implementation, but given the priorities so far and the foreseeable near future, it's not realistic to expect it will happen very soon.

Thus: workaround; use a fork of keyring as many other people to, which simply nukes kwallet and secretservice where the bug is coming from. 👌

Checklist

  • Created tests which fail without the change (if possible)
  • Extended the README / documentation, if necessary

* use forked keyring from 99designs/keyring#103 (comment) which eliminates Linux kwallet/secretservice, which we don't use anyways but causes headache with dbus upon keyring init()
@sfc-gh-dszmolka sfc-gh-dszmolka changed the title SNOW-1553756 SNOW-1553756 use forked version 99design/keyring without kwallet/secretservice to avoid dbus issue Jan 30, 2025
@@ -2,6 +2,8 @@ module github.com/snowflakedb/gosnowflake

go 1.21

replace github.com/99designs/keyring => github.com/Jeffail/keyring v1.2.3
Copy link
Collaborator

Choose a reason for hiding this comment

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

Why using replace? It was required in hashicorp, because it was a transitive dependency for them (their direct dependency was gosnowflake). For us it is a direct dependency, so we can use it directly.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

hmm did not consider it but you're right, lets fix that

Copy link
Contributor Author

Choose a reason for hiding this comment

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

as we discussed: since the fork declares itself as 99design/keyring, cannot import it directly due to

go: github.com/snowflakedb/gosnowflake imports
        github.com/99designs/keyring: github.com/Jeffail/[email protected]: parsing go.mod:
        module declares its path as: github.com/99designs/keyring
                but was required as: github.com/Jeffail/keyring

Copy link

codecov bot commented Jan 30, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 82.27%. Comparing base (e5ae90f) to head (dc2ad03).

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1296      +/-   ##
==========================================
- Coverage   82.30%   82.27%   -0.03%     
==========================================
  Files          55       55              
  Lines       13600    13600              
==========================================
- Hits        11193    11190       -3     
- Misses       2407     2410       +3     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

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

Successfully merging this pull request may close these issues.

2 participants