bitwarden / sdk

Bitwarden SDK
Other
227 stars 36 forks source link

Cargo installed bws crash #888

Closed Vi-Robitaille closed 1 month ago

Vi-Robitaille commented 1 month ago

Steps To Reproduce

  1. cargo install bws
  2. add path and completion info
  3. Run just about any bws command ex: bws project list

Expected Result

I expected to get a list of projects/secrets/get some secret data back

Actual Result

RUST_BACKTRACE=full bws project list
The application panicked (crashed).
Message:  Build should not fail: reqwest::Error { kind: Builder, source: "Unknown TLS backend passed to `use_preconfigured_tls`" }
Location: /home/vi/.cargo/registry/src/index.crates.io-6f17d22bba15001f/bitwarden-0.5.0/src/client/client.rs:112

  ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ BACKTRACE ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
                                ⋮ 8 frames hidden ⋮                               
   9: bitwarden::client::client::Client::new::hff8127ad7468c3cf
      at <unknown source file>:<unknown line>
  10: bws::process_commands::{{closure}}::h3ebec32d06c5e46e
      at <unknown source file>:<unknown line>
  11: <core::pin::Pin<P> as core::future::future::Future>::poll::hc80cc5469997dee0
      at <unknown source file>:<unknown line>
  12: tokio::runtime::scheduler::current_thread::CoreGuard::block_on::hc4d17793a48e4e42
      at <unknown source file>:<unknown line>
  13: tokio::runtime::context::runtime::enter_runtime::ha71f313766929076
      at <unknown source file>:<unknown line>
  14: tokio::runtime::runtime::Runtime::block_on::h4860af124c9b15f2
      at <unknown source file>:<unknown line>
  15: bws::main::hfe799f6923a2ad16
      at <unknown source file>:<unknown line>
  16: std::sys_common::backtrace::__rust_begin_short_backtrace::h2563bc78e9b64864
      at <unknown source file>:<unknown line>
  17: std::rt::lang_start::{{closure}}::h51afc8548a22e3ef
      at <unknown source file>:<unknown line>
  18: std::rt::lang_start_internal::h3ed4fe7b2f419135
      at <unknown source file>:<unknown line>
  19: main<unknown>
      at <unknown source file>:<unknown line>
  20: __libc_start_main<unknown>
      at <unknown source file>:<unknown line>
  21: _start<unknown>
      at <unknown source file>:<unknown line>

Screenshots or Videos

No response

Additional Context

cargo --version
cargo 1.79.0 (ffa9cf99a 2024-06-03)
rustup check
stable-x86_64-unknown-linux-gnu - Up to date : 1.79.0 (129f3b996 2024-06-10)
rustup - Up to date : 1.27.1

I did the same install process on another laptop (also linux, basically the same in every way aside from a weaker cpu and less ram) that version is also failing

Operating System

Linux

Operating System Version

No response

Shell

Zsh

Build Version

0.5.0

Issue Tracking Info

Vi-Robitaille commented 1 month ago

I did some digging and I found a fix for myself. Since there's other platforms that this would need to work with idk how good this is for you. Removing the default_features = false on this line then rebuilding works for me.

dani-garcia commented 1 month ago

Hey @Vi-Robitaille!

It seems a minor update to reqwest is being pulled, which was not compatible with bws 0.5.0. You can instead use cargo install bws --locked to make sure it pulls the same versions as our lockfiles. I'll update the docs to mention that as the recommended installation path.

The version mismatch has been solved in the main branch already, you can check that out too using cargo install bws --git https://github.com/bitwarden/sdk

Thanks for the report!

Hinton commented 1 month ago

Since the docs are updated, I'm going to close this issue. Please let us know if you run into any other issues.