doy / rbw

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

rbw register: failed to log in #88

Closed vyryls closed 7 months ago

vyryls commented 2 years ago

rbw register: failed to log in to bitwarden instance: failed to parse JSON: .: missing fielderrorat line 1 column 2: missing fielderrorat line 1 column 2

Using rbw 1.4.3

Added my email via rbw config set email $email

then tried to rbw register, added api keys and got this eror. Also tried rotating bw api keys

dit7ya commented 2 years ago

I am encountering this as well.

❯ rbw sync
rbw sync: failed to log in to bitwarden instance: failed to parse JSON: .: EOF while parsing a value at line 1 column 0: EOF while parsing a value at line 1 column 0
h4-n1 commented 1 year ago

I'm having the same issue with rbw register after entering the client_id and client_secret.

$ rbw register
rbw register: failed to log in to bitwarden instance: failed to parse JSON: EOF while parsing a value at line 1 column 0

$ rbw --version
rbw 1.7.1

$ rbw config show
{
  "email": "<REDACTED>",
  "base_url": null,
  "identity_url": null,
  "lock_timeout": 3600,
  "sync_interval": 3600,
  "pinentry": "pinentry",
  "client_cert_path": null
}
doy commented 1 year ago

i can't reproduce this myself, but i added some additional diagnostics to the latest release. if you run into this again, can you give me the output, and also the contents of ~/.local/share/rbw/agent.err`?

xusiai commented 1 year ago

I'm experiencing the same error now on NixOS. rbw register: failed to log in to bitwarden instance: failed to parse JSON: EOF while parsing a value at line 1 column 0

{
  "email": $email,
  "base_url": null,
  "identity_url": null,
  "lock_timeout": 10800,
  "sync_interval": 3600,
  "pinentry": "pinentry",
  "client_cert_path": null
}
$ cat ~/.local/share/rbw/agent.err
pinentry-curses: no LC_CTYPE known - assuming UTF-8

Anything else I can do to troubleshoot?

emithethief commented 10 months ago

Same issue here when trying to rbw login, the error code is as follow: rbw login: failed to log in to bitwarden instance: failed to parse JSON: EOF while parsing a value at line 1 column 0 I had the same pinentry-curses: no LC_CTYPE known - assuming UTF-8 in my ~/.local/share/rbw/agent.err, fixed it just in case, error message no longer happens but the issue persists. Deleting the config file and reconfiguring rbw doesn't seem to fix the issue. Using rbw 1.8.3

matt-snider commented 9 months ago

I have the same issue on rbw 1.7.1. The error log is empty. I'm using the standard settings with just email set.

I tried with both pinentry-curses and pinentry-gtk2. I don't think the LC_CTYPE error is relevant, but I do see it when using pinentry-curses.

Next I upgraded to rbw 1.8.3 and I can now see a different error:

rbw register: failed to log in to bitwarden instance: api request returned error: 500

Rosuavio commented 9 months ago

I am experiencing the same exact issues as @matt-snider. Both different versions, no logs in the first then same log message in the second, different pinentry programs did not do the trick, my LC_TYPE was already set. I tried every combination of settings I could.

matt-snider commented 9 months ago

Well considering that the Bitwarden server is returning a 500 error, it sounds like the error is on their side. Maybe they are having service issues or they've changed something and the way rbw is using the endpoint is unexpected

Rosuavio commented 9 months ago

Wow, @matt-snider (or anyone else experiencing this issue), try this!

When coping the client_id DO NOT double click the field on the web browser selecting all the text, it selects a single space before and after the value your selecting. So instead of getting

user.000000000000000000000000000000000000

you get

 user.000000000000000000000000000000000000 

This seems to only happen with client_id.

Now I don't get any errors when completing the register flow. I don't get much indication it worked either, other than an 0 exit code.

Rosuavio commented 9 months ago

If we can have a few others that are experiencing this issue confirm that this is the cause I am sure that would be good to know.

Not sure if the right thing to do is complain to bitwarden, strip spaces in rbw or both.

matt-snider commented 9 months ago

@Rosuavio Thanks for posting that. It might be useful to some others in this thread.

I actually do not have a button or way to copy the field on my browsers (Firefox 111 on Linux), so I don't think this was my issue. I tried register again and it worked now, so it might have just been an intermittent API issue.

But I actually now have an issue that my password keeps getting rejected as invalid when I run sync or any other command. This is probably an unrelated issue though...

xusiai commented 9 months ago

If we can have a few others that are experiencing this issue confirm that this is the cause I am sure that would be good to know.

More accurate selection of the credentials resolved the issue for me too.

rkanati commented 9 months ago

@matt-snider I'm having exactly the same problem; register works okay, but every login attempt claims my password is incorrect, and I'm quite certain it's not. If you're still having trouble I'll open an issue.

Rosuavio commented 9 months ago

@rkanati I am also having the same issue with login.

FelixSchausberger commented 9 months ago

@rkanati I am experiencing exactly the same problems.

xusiai commented 9 months ago

@rkanati I am also experiencing this now.

ggustafsson commented 9 months ago

Same here. Broken since last week for me. See https://github.com/doy/rbw/issues/32#issuecomment-1818708928

the-sun-will-rise-tomorrow commented 9 months ago

I think this issue is about an error in the rbw register flow. I created a new issue for rbw login not accepting the password: #145

doy commented 7 months ago

sorry about this! i think this should be fixed in version 1.9.0 - let me know if anyone is still having problems.