qutebrowser / qutebrowser

A keyboard-driven, vim-like browser based on Python and Qt.
https://www.qutebrowser.org/
GNU General Public License v3.0
9.45k stars 1.01k forks source link

Bitwarden userscript sudenly quit working #8198

Closed chelmi00 closed 1 month ago

chelmi00 commented 1 month ago

Version info: qutebrowser v2.5.4 Git commit: Backend: QtWebEngine 5.15.15, based on Chromium 87.0.4280.144 Qt: 5.15.10

CPython: 3.11.6 PyQt: 5.15.9

sip: 6.7.10 colorama: 0.4.6 jinja2: 3.1.2 pygments: 2.15.1 yaml: 6.0.1 adblock: no PyQt5.QtWebEngineWidgets: yes PyQt5.QtWebEngine: 5.15.6 PyQt5.QtWebKitWidgets: no pdf.js: no sqlite: 3.42.0 QtNetwork SSL: OpenSSL 3.0.10 1 Aug 2023

Style: Qt5CTProxyStyle Platform plugin: xcb OpenGL: Intel, 4.6 (Compatibility Profile) Mesa 23.2.1-1ubuntu3.1 Platform: Linux-6.5.0-28-generic-x86_64-with-glibc2.38, 64bit Linux distribution: Ubuntu 23.10 (ubuntu) Frozen: False Imported from /usr/lib/python3/dist-packages/qutebrowser Using Python from /usr/bin/python3 Qt library executable path: /usr/lib/x86_64-linux-gnu/qt5/libexec, data path: /usr/share/qt5

Paths: cache: /home/chelmi/.cache/qutebrowser config: /home/chelmi/.config/qutebrowser data: /home/chelmi/.local/share/qutebrowser runtime: /run/user/1000/qutebrowser system data: /usr/share/qutebrowser

Autoconfig loaded: no Config.py: /home/chelmi/.config/qutebrowser/config.py has been loaded Uptime: 0:05:35

Does the bug happen if you start with --temp-basedir?: Can't say, as I binded it to 'pg'

Description After upgrading my ubuntu to the lts version it stopped working. The code stops running (when I debug it) at process = subprocess.run( ['bw', 'list', 'items', '--session', session_key, '--url', domain], capture_output=True, ) but on my pc, running the bash command, it outputs the correct info.

How to reproduce At any URL, when I want to insert my password, I press 'pg', rofi prompts the password and after some seconds, it exits with status 1.

Process error: `Standard output No output.

Standard error Bitwarden CLI returned for accounts.google.com - ? Master password: [input is hidden]  Traceback (most recent call last): File "/usr/share/qutebrowser/userscripts/qute-bitwarden", line 307, in sys.exit(main(arguments)) ^^^^^^^^^^^^^^^ File "/usr/share/qutebrowser/userscripts/qute-bitwarden", line 220, in main target_candidates = json.loads( ^^^^^^^^^^^ File "/usr/lib/python3.11/json/init.py", line 346, in loads return _default_decoder.decode(s) ^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3.11/json/decoder.py", line 337, in decode obj, end = self.raw_decode(s, idx=_w(s, 0).end()) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3.11/json/decoder.py", line 355, in raw_decode raise JSONDecodeError("Expecting value", s, err.value) from None json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)`

chelmi00 commented 1 month ago

I haven't made any changes to the qute-bitwarden script

The-Compiler commented 1 month ago

It looks like it fails because the CLI asks for your master password.

I never used the userscript, but here's how I'd go about debugging this:

Also knowing the version of your bw CLI would be good...

chelmi00 commented 1 month ago

You found my problem, when running bw list items --session SESSION_KEY_FROM_ABOVE --url https://example.org, it asked for my password once again.

$ bw --version mac failed. 2024.4.0

I don't know what is up with "mac failed.", it appears every time I use bw

chelmi00 commented 1 month ago

I got the lastest version of bw from the github repo (bitwarden/clients), and it started working again.