doy / rbw

unofficial bitwarden cli
https://git.tozt.net/rbw
Other
671 stars 89 forks source link

Agent crashes when attempting to login #143

Open the-sun-will-rise-tomorrow opened 1 year ago

the-sun-will-rise-tomorrow commented 1 year ago

rbw login fails with rbw login: failed to parse message from agent: EOF while parsing a value at line 1 column 0.

With RUST_BACKTRACE=1 rbw login, in .local/share/rbw/agent.err:

[2023-10-18T20:47:02Z WARN  rbw_agent::agent] couldn't create clipboard context: XCB - couldn't establish conection: DisplayParsingError
thread 'tokio-runtime-worker' panicked at 'called `Result::unwrap()` on an `Err` value: SystemCall(Os { code: 1, kind: PermissionDenied, message: "Operation not permitted" })', src/locked.rs:15:65
stack backtrace:
Warning: using insecure memory!
pinentry-curses: no LC_CTYPE known - assuming UTF-8
   0: rust_begin_unwind
   1: core::panicking::panic_fmt
   2: core::result::unwrap_failed
   3: <rbw::locked::Vec as core::default::Default>::default
   4: rbw::locked::Vec::new
   5: rbw::pinentry::getpin::{{closure}}
   6: rbw_agent::agent::handle_request::{{closure}}
   7: rbw_agent::agent::Agent::run::{{closure}}::{{closure}}
   8: tokio::loom::std::unsafe_cell::UnsafeCell<T>::with_mut
   9: tokio::runtime::task::core::Core<T,S>::poll
  10: tokio::runtime::task::harness::Harness<T,S>::poll
  11: tokio::runtime::scheduler::multi_thread::worker::Context::run_task
  12: tokio::runtime::scheduler::multi_thread::worker::Context::run
  13: tokio::runtime::context::scoped::Scoped<T>::set
  14: tokio::runtime::context::runtime::enter_runtime
  15: tokio::runtime::scheduler::multi_thread::worker::run
  16: tokio::loom::std::unsafe_cell::UnsafeCell<T>::with_mut
  17: tokio::runtime::task::core::Core<T,S>::poll
  18: tokio::runtime::task::harness::Harness<T,S>::poll
  19: tokio::runtime::blocking::pool::Inner::run
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.
n-hass commented 1 year ago

Same issue here on macOS.

xusiai commented 1 year ago

Experiencing this as well on NixOS, regardless of whether I manage rbw's config via nix or not.

Samasaur1 commented 10 months ago

I get this same issue on macOS with rbw installed via Nix, though setting RUST_BACKTRACE=1 doesn't give me any more information

doy commented 7 months ago

can you give this a try with version 1.10.0? i updated the dependency in use here, which may help.

Samasaur1 commented 7 months ago

@doy I still see the same error

Samasaur1 commented 7 months ago

and the only entry in agent.err is

WARN  rbw_agent] failed to disable PTRACE_ATTACH, agent memory may be dumpable by other processes: unimplemented on this platform
doy commented 7 months ago

did this just start happening recently? or has it always crashed?

Samasaur1 commented 7 months ago

For me at least, this has always happened

doy commented 7 months ago

can you give me the output of ulimit -l and du -sh ~/.cache/rbw (or du -sh ~/Library/Caches/rbw if you're on macos)?

Samasaur1 commented 7 months ago
[sam](~)$ ulimit -l
unlimited
[sam](~)$ du -sh ~/Library/Caches/rbw
  0B    /Users/sam/Library/Caches/rbw
Samasaur1 commented 6 months ago

@doy I noticed that there were some new commits after v1.10.0, so I tried building that version, but still no luck (with the same error)

doy commented 4 months ago

i'm not sure what is actually going on here, but i've made this functionality optional in version 1.12 - let me know if this fixes the issue

Samasaur1 commented 4 months ago

Still no luck on v1.12.0:

[sam](/tmp)$ clear
[sam](/tmp)$ rm ~/Library/Application\ Support/rbw/agent.*
[sam](/tmp)$ rbw --version
rbw 1.12.0
[sam](/tmp)$ rbw login
rbw login: failed to parse message from agent: EOF while parsing a value at line 1 column 0
[sam](/tmp)$ c ~/Library/Application\ Support/rbw/agent.*
───────┬────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
       │ File: /Users/sam/Library/Application Support/rbw/agent.err
───────┼────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
   1   │ [2024-07-28T20:04:50Z WARN  rbw_agent] failed to disable PTRACE_ATTACH, agent memory may be dumpable by other processes: unimplemented on this platform
───────┴────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
───────┬────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
       │ File: /Users/sam/Library/Application Support/rbw/agent.out   <EMPTY>
───────┴────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
[sam](/tmp)$
Samasaur1 commented 4 months ago

For the record, v1.11.1 works fine on Linux