-
Notifications
You must be signed in to change notification settings - Fork 50
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
[SM-1147] Switch to try_init with pyo3_log #676
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #676 +/- ##
==========================================
- Coverage 60.61% 60.59% -0.02%
==========================================
Files 170 170
Lines 10387 10390 +3
==========================================
Hits 6296 6296
- Misses 4091 4094 +3 ☔ View full report in Codecov by Sentry. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, we're already doing the same thing for the c and napi bindings, seems like we forgot this one.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
4c5b926
Added a comment and |
I'm sorry for the dumb question, but how to implement this fix on my side? I'm using Bitwarden Secrets with the ansible lookup plugin. I did |
@mittkkoo, I'm facing the same issue as you with the Ansible integration. If you followed the directions for setup in the Bitwarden Documentation, I believe it doesn't use the I think we must wait until a new version of |
Tagging you because you're the PR author and I'm not sure who else to ask, but feel free to delegate. This still appears to be unresolved for users following the official documentation I linked in my above reply for the same reason - no new PyPI package pushed. When can the community expect this to be resolved (or how can I help us get there)? |
@mittkkoo & @jacobfelknor thanks for asking & reaching out, sorry for the delay on this. We have an internal ticket on deck to fix the Python issue, we will be investigating soon! |
Great, thank you! |
Any news on this? The ansible plugin is not usable if you use more then one secret lookup… |
@coltonhurst Would be great of you could give us an ETA for a new release. @betermieux In the meantime, I created a dirty little fix for this: - name: Deploy and configure Prometheus
hosts: service_APP001_Prometheus
become: true
pre_tasks:
- set_fact:
netbox_api_url: "{{ lookup('bitwarden.secrets.lookup', 'xxx' )}}"
- set_fact:
netbox_api_token: "{{ lookup('bitwarden.secrets.lookup', 'xxx' )}}"
roles:
- prometheus.prometheus.prometheus TL;DR: Put all lookups in it's own (!) set_fact task for now, until we have a release. |
Sorry for not replying earlier, I commented my findings at bitwardens forum: It basically works if you build a current version of this SDK and replace the packages in your ansible installation. Now someone just needs to publish a current version to the pip repository. |
## 🎟️ Tracking <!-- Paste the link to the Jira or GitHub issue or otherwise describe / point to where this change is coming from. --> https://bitwarden.atlassian.net/browse/SM-1384 ## 📔 Objective <!-- Describe what the purpose of this PR is, for example what bug you're fixing or new feature you're adding. --> When creating multiple WASM clients, a panic occurs `failed to initialize logger: SetLoggerError())`. Looks to be the same thing we fixed: #181 #676 ## ⏰ Reminders before review - Contributor guidelines followed - All formatters and local linters executed and passed - Written new unit and / or integration tests where applicable - Protected functional changes with optionality (feature flags) - Used internationalization (i18n) for all UI strings - CI builds passed - Communicated to DevOps any deployment requirements - Updated any necessary documentation (Confluence, contributing docs) or informed the documentation team ## 🦮 Reviewer guidelines <!-- Suggested interactions but feel free to use (or not) as you desire! --> - 👍 (`:+1:`) or similar for great changes - 📝 (`:memo:`) or ℹ️ (`:information_source:`) for notes or general info - ❓ (`:question:`) for questions - 🤔 (`:thinking:`) or 💭 (`:thought_balloon:`) for more open inquiry that's not quite a confirmed issue and could potentially benefit from discussion - 🎨 (`:art:`) for suggestions / improvements - ❌ (`:x:`) or⚠️ (`:warning:`) for more significant problems or concerns needing attention - 🌱 (`:seedling:`) or ♻️ (`:recycle:`) for future improvements or indications of technical debt - ⛏ (`:pick:`) for minor or nitpick changes
Type of change
Objective
When running the
ansible-playbook
command, we needed to export the following variable:export OBJC_DISABLE_INITIALIZE_FORK_SAFETY=YES
. This suppresses fork safety warnings on Mac OS. With this set, you can safely query for individual secrets. However, if you query for secrets within an Ansible loop or with a Jinja2 template, we receive an error that is caused by setting up a logger more than once. (This error comes from thepyo3_log
crate.)If we switch to using the
pyo3_log::try_init
function, we ignore the case where a logger is already set up if the attempt fails. This happens because thepyo3_log::init
function can panic. This also introduces panic safety.Code changes
try_init
Before you submit