bitwarden / clients

Bitwarden client apps (web, browser extension, desktop, and cli).
https://bitwarden.com
Other
9.31k stars 1.25k forks source link

Ubuntu Snap version nuked itself this week (will not boot) #11044

Open mcclure opened 2 months ago

mcclure commented 2 months ago

Steps To Reproduce

BitWarden was working on my laptop 3 days ago. 2 days ago Ubuntu announced that the Bitwarden snap was updating and I should quit it to get the update. I told it to go ahead. Bitwarden never came back. Now when I click the Bitwarden button in my dock nothing happens. When I type "bitwarden" in a terminal I get an error message. This state has persisted across at least 1 reboot.

Expected Result

Bitwarden opens

Actual Result

$ bitwarden
A JavaScript error occurred in the main process
Uncaught Exception:
SyntaxError: Unexpected end of JSON input
    at JSON.parse (<anonymous>)
    at Conf._deserialize (/snap/bitwarden/119/resources/app.asar/main.js:8930:43)
    at get store (/snap/bitwarden/119/resources/app.asar/main.js:9141:43)
    at new Conf (/snap/bitwarden/119/resources/app.asar/main.js:8994:32)
    at new ElectronStore (/snap/bitwarden/119/resources/app.asar/main.js:13371:3)
    at new ElectronStorageService (/snap/bitwarden/119/resources/app.asar/main.js:87226:22)
    at new Main (/snap/bitwarden/119/resources/app.asar/main.js:87834:31)
    at 72509 (/snap/bitwarden/119/resources/app.asar/main.js:75983:18)
    at __webpack_require__ (/snap/bitwarden/119/resources/app.asar/main.js:91975:42)
    at /snap/bitwarden/119/resources/app.asar/main.js:92031:37

(bitwarden-app:181614): Gtk-WARNING **: 00:00:31.743: Theme parsing error: gtk.css:1422:23: 'font-feature-settings' is not a valid property name

(bitwarden-app:181614): Gtk-WARNING **: 00:00:31.755: Theme parsing error: gtk.css:3308:25: 'font-feature-settings' is not a valid property name

(bitwarden-app:181614): Gtk-WARNING **: 00:00:31.757: Theme parsing error: gtk.css:3770:23: 'font-feature-settings' is not a valid property name

(bitwarden-app:181614): Gtk-WARNING **: 00:00:31.924: Theme parsing error: gtk.css:1422:23: 'font-feature-settings' is not a valid property name

(bitwarden-app:181614): Gtk-WARNING **: 00:00:31.932: Theme parsing error: gtk.css:3308:25: 'font-feature-settings' is not a valid property name

(bitwarden-app:181614): Gtk-WARNING **: 00:00:31.934: Theme parsing error: gtk.css:3770:23: 'font-feature-settings' is not a valid property name
libGL error: MESA-LOADER: failed to open radeonsi (search paths /snap/bitwarden/119/gnome-platform/usr/lib/x86_64-linux-gnu/dri)
libGL error: failed to load driver: radeonsi
libGL error: MESA-LOADER: failed to open radeonsi (search paths /snap/bitwarden/119/gnome-platform/usr/lib/x86_64-linux-gnu/dri)
libGL error: failed to load driver: radeonsi
libGL error: MESA-LOADER: failed to open swrast (search paths /snap/bitwarden/119/gnome-platform/usr/lib/x86_64-linux-gnu/dri)
libGL error: failed to load driver: swrast
[181654:0914/000031.995026:ERROR:angle_platform_impl.cc(44)] Display.cpp:1086 (initialize): ANGLE Display::initialize error 12289: Could not create a backing OpenGL context.
ERR: Display.cpp:1086 (initialize): ANGLE Display::initialize error 12289: Could not create a backing OpenGL context.
[181654:0914/000031.995285:ERROR:gl_display.cc(497)] EGL Driver message (Critical) eglInitialize: Could not create a backing OpenGL context.
[181654:0914/000031.995393:ERROR:gl_display.cc(767)] eglInitialize OpenGL failed with error EGL_NOT_INITIALIZED, trying next display type
[181654:0914/000031.998564:ERROR:angle_platform_impl.cc(44)] Display.cpp:1086 (initialize): ANGLE Display::initialize error 12289: Could not create a backing OpenGL context.
ERR: Display.cpp:1086 (initialize): ANGLE Display::initialize error 12289: Could not create a backing OpenGL context.
[181654:0914/000031.998674:ERROR:gl_display.cc(497)] EGL Driver message (Critical) eglInitialize: Could not create a backing OpenGL context.
[181654:0914/000031.998746:ERROR:gl_display.cc(767)] eglInitialize OpenGLES failed with error EGL_NOT_INITIALIZED
[181654:0914/000031.998809:ERROR:gl_display.cc(801)] Initialization of all EGL display types failed.
[181654:0914/000031.998883:ERROR:gl_ozone_egl.cc(26)] GLDisplayEGL::Initialize failed.
[181654:0914/000032.005925:ERROR:angle_platform_impl.cc(44)] Display.cpp:1086 (initialize): ANGLE Display::initialize error 12289: Could not create a backing OpenGL context.
ERR: Display.cpp:1086 (initialize): ANGLE Display::initialize error 12289: Could not create a backing OpenGL context.
[181654:0914/000032.006064:ERROR:gl_display.cc(497)] EGL Driver message (Critical) eglInitialize: Could not create a backing OpenGL context.
[181654:0914/000032.006172:ERROR:gl_display.cc(767)] eglInitialize OpenGL failed with error EGL_NOT_INITIALIZED, trying next display type
[181654:0914/000032.008858:ERROR:angle_platform_impl.cc(44)] Display.cpp:1086 (initialize): ANGLE Display::initialize error 12289: Could not create a backing OpenGL context.
ERR: Display.cpp:1086 (initialize): ANGLE Display::initialize error 12289: Could not create a backing OpenGL context.
[181654:0914/000032.009038:ERROR:gl_display.cc(497)] EGL Driver message (Critical) eglInitialize: Could not create a backing OpenGL context.
[181654:0914/000032.009131:ERROR:gl_display.cc(767)] eglInitialize OpenGLES failed with error EGL_NOT_INITIALIZED
[181654:0914/000032.009206:ERROR:gl_display.cc(801)] Initialization of all EGL display types failed.
[181654:0914/000032.009267:ERROR:gl_ozone_egl.cc(26)] GLDisplayEGL::Initialize failed.
[181654:0914/000032.012221:ERROR:viz_main_impl.cc(166)] Exiting GPU process due to errors during initialization
MESA-LOADER: failed to open radeonsi (search paths /snap/bitwarden/119/gnome-platform/usr/lib/x86_64-linux-gnu/dri)
failed to load driver: radeonsi
MESA-LOADER: failed to open kms_swrast (search paths /snap/bitwarden/119/gnome-platform/usr/lib/x86_64-linux-gnu/dri)
failed to load driver: kms_swrast
MESA-LOADER: failed to open swrast (search paths /snap/bitwarden/119/gnome-platform/usr/lib/x86_64-linux-gnu/dri)
failed to load swrast driver

Screenshots or Videos

No response

Additional Context

AMD integrated GPU "AMD Ryzen™ 5 PRO 6650U with Radeon™ Graphics × 12"

Operating System

Linux

Operating System Version

Ubuntu 24.04

Installation method

Snap

Build Version

"latest/stable 2024.8.2" published sep 5 2024

Issue Tracking Info

SergeantConfused commented 2 months ago

Hi @mcclure,

Thank you for this report. Could you please turn Hardware Acceleration off via the Help menu, and let me know if that changes anything?

Thank you in advance,

xnm3YQNfEx commented 2 months ago

Weird, I wonder if this may be related to the issue I opened about the appimage version in linux:

https://github.com/bitwarden/clients/issues/11030

Just based off of the JSON error in your error message. I'd suggest trying the workaround that worked for me, just rename the /.config/Bitwarden directory to something else if you want to keep a backup of the corrupted data (assuming its the same issue). Afterwards, try running it again

mcclure commented 2 months ago

@xnm3YQNfEx Thank you, I tried moving aside ~/snap/bitwarden and it fixed the problem instantly.

Although I no longer have a problem, I think this is a real bug because I think bitwarden should be more resilient to config file errors (especially because in this case it appears bitwarden nuked its own config file, i did not edit it). My "expected behavior" is a better error message such as a dialog box, fingering the configuration files as the problem.

@SergeantConfused , I'm sorry, if you mean the Help menu in Bitwarden, I was not able to access the help menu because Bitwarden would not boot. Now that I have moved aside the snap/bitwarden directory and re-logged-in, I no longer have the problem so I am not going to try the hardware acceleration troubleshooting.

xnm3YQNfEx commented 1 month ago

I agree, this is very much still an issue that should be resolved. The behaviour of... "nothing" happening is a terrible experience for non technical users.

First off, the json being truncated is the root issue that must be resolved. Second, There should be better error handling around cases like this that fail "gracefully", ideally prompting the user with an error dialog when they run the program and the json fails to parse. Something to the effect of: "Error with local data, offline mode will be unavailable. Ensure you are online to have the client refresh the local copy of the data".

xnm3YQNfEx commented 1 month ago

And, if the json fails to parse.... the desktop client should rename to back it up just in case... and then download a new copy after the user logs in

mcclure commented 1 month ago

PS, I now believe this is a dupe of #11030