mirror of
https://github.com/dani-garcia/vaultwarden.git
synced 2026-02-05 00:29:40 +03:00
Items Taking 15 Seconds to Save with PUSH_ENABLED=true #1605
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @quexten on GitHub (Jun 13, 2023).
Subject of the issue
With the PUSH_ENABLED=true environment varibale (merged in #3304) set (and PUSH_INSTALLATION_ID and PUSH_INSTALLATION_KEY), updating an item takes 15 seconds. When disabling the flag, the request takes only ~30ms

The log shows ~100 requests to bitwarden's push servers being made in that time.
Deployment environment
Your environment (Generated via diagnostics page)
Config (Generated via diagnostics page)
Show Running Config
Environment settings which are overridden:
push_enabled is false here since I disabled the feature temporarily.
Steps to reproduce
Enable mobile push and edit/create an entry.
Expected behaviour
Take the same amount of time.
Actual behaviour
It takes >10 seconds, nearly a hundred connections are started.
Troubleshooting data
On debug mode, a lot of connections to push.bitwarden.com are opened. I have attached the relevant part of the log.
log.txt
If required I'm happy to do some network traces/debugging to further triage the issue.
@quexten commented on GitHub (Jun 13, 2023):
Ok, I have investigated my devices table in sql. Over the years (since 2020) ~100 have accumulated (from one time browser sessions and such). The number of these corresponds exactly with the amount of connections being made. The "push_uuid" field is "null" on all of these though, so I would have expected no requests to be made to the push servers for these.
@quexten commented on GitHub (Jun 13, 2023):
After manually deleting the outdated device rows from the SQLite database, it now saves in 1.7 seconds.
As far as I can tell, there are 3 steps to improve the situation:
@ShlomiD83 commented on GitHub (Jun 13, 2023):
Push didn't work for me.
Do I need to do anything else beside enabling the env variables and add ID & key?
@BlackDex commented on GitHub (Jun 13, 2023):
Check https://github.com/dani-garcia/vaultwarden/discussions/2469#discussioncomment-6159012
@ShlomiD83 commented on GitHub (Jun 13, 2023):
sorry :)
Thanks.
@kamilos956 commented on GitHub (Oct 23, 2023):
Dude, thank you for your invastigation. I was wondering why my vaultwarden takes few secs to save or modify an entry. After clearing the device table, every changes or new entry take below 1 sec. Thanks once again!
@luc-ass commented on GitHub (Oct 26, 2023):
Hey @kamilos956 or @quexten, could you elaborate on how to clear old devices? I've been experiencing sluggish performance when saving entries as well... Is there a way to just "clear all" devices?
@quexten commented on GitHub (Oct 26, 2023):
For me the easiest way was to open the sqlite database in a separate application, and deleting the rows of the old devices manually.
@stefan0xC commented on GitHub (Oct 26, 2023):
@luc-ass the easiest way to clear all devices for an affected user is to open the
/adminpanel and click onDeauthorize sessionsin the users overview.ecb31c85d6/src/api/admin.rs (L420)@kamilos956 commented on GitHub (Oct 26, 2023):
From terminal go to the directory where sqlite is stored, then run it by 'sqlite3 db.sqlite3', the run command 'delete from devices where push_uuid is null;' and that all.
@kamilos956 commented on GitHub (Nov 12, 2023):
After clearing old sessions, new ones does not contain pushid. Only mobile client has it, so always new login from device cause about 10 sec lag white edit or create new entry.