Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Vault loading issues (attachments?) #2484

Closed
Decicus opened this issue May 23, 2022 · 35 comments
Closed

Vault loading issues (attachments?) #2484

Decicus opened this issue May 23, 2022 · 35 comments
Labels
Third party Needs an update from the third party library wontfix This will not be worked on

Comments

@Decicus
Copy link

Decicus commented May 23, 2022

Subject of the issue

After updating from 1.24.0 to 1.25.0, I am having issues loading my vault.
Error messages indicate issues with attachments (included error logs under "Troubleshooting data").

Other account settings seem to work fine (changing equivalent domains or updating 2FA settings still worked), so it seems to only affect the vault data.

No issues on 1.24.0. In fact, I could revert Vaultwarden back to 1.24.0 without restoring my database from backups and the vault seems to load just fine again. Syncing from the browser extension works fine too.

Deployment environment

  • vaultwarden version: 1.25.0
  • Install method: Docker

  • Clients used: Web vault & official browser extension

  • MySQL/MariaDB or PostgreSQL version: 10.5.15-MariaDB-1:10.5.15+maria~focal

Steps to reproduce

Docker Compose with the latest tag, upgrade from 1.24.0 (pull, down, up)
No other changes were done, except using 1.24.0 instead of latest when reverting back.

Log into web vault / sync with browser extension.

Actual behaviour

Web vault was empty with no entries. Browser extension (where previously logged in & synced) just returned a sync error.

Troubleshooting data

vaultwarden    | 2022-05-23T19:45:16.513924114Z [2022-05-23 19:45:16.513][panic][ERROR] thread 'rocket-worker-thread' panicked at 'Error loading attachments: DatabaseError(__Unknown, "Commands out of sync; you can't run this command now")': src/db/models/attachment.rs:196
vaultwarden    | 2022-05-23T19:45:16.516877999Z    0: vaultwarden::init_logging::{{closure}}
vaultwarden    | 2022-05-23T19:45:16.516917724Z    1: std::panicking::rust_panic_with_hook
vaultwarden    | 2022-05-23T19:45:16.516969010Z    2: std::panicking::begin_panic_handler::{{closure}}
vaultwarden    | 2022-05-23T19:45:16.516997363Z    3: std::sys_common::backtrace::__rust_end_short_backtrace
vaultwarden    | 2022-05-23T19:45:16.517034252Z    4: rust_begin_unwind
vaultwarden    | 2022-05-23T19:45:16.517048589Z    5: core::panicking::panic_fmt
vaultwarden    | 2022-05-23T19:45:16.517079778Z    6: core::result::unwrap_failed
vaultwarden    | 2022-05-23T19:45:16.517093013Z    7: tokio::runtime::enter::exit
vaultwarden    | 2022-05-23T19:45:16.517123690Z    8: tokio::runtime::thread_pool::worker::block_in_place
vaultwarden    | 2022-05-23T19:45:16.517135091Z    9: <core::future::from_generator::GenFuture<T> as core::future::future::Future>::poll
vaultwarden    | 2022-05-23T19:45:16.517161912Z   10: <core::future::from_generator::GenFuture<T> as core::future::future::Future>::poll
vaultwarden    | 2022-05-23T19:45:16.517174946Z   11: <core::future::from_generator::GenFuture<T> as core::future::future::Future>::poll
vaultwarden    | 2022-05-23T19:45:16.517209531Z   12: <core::future::from_generator::GenFuture<T> as core::future::future::Future>::poll
vaultwarden    | 2022-05-23T19:45:16.517224429Z   13: tokio::runtime::task::harness::poll_future
vaultwarden    | 2022-05-23T19:45:16.517266849Z   14: tokio::runtime::task::harness::Harness<T,S>::poll
vaultwarden    | 2022-05-23T19:45:16.517280976Z   15: std::thread::local::LocalKey<T>::with
vaultwarden    | 2022-05-23T19:45:16.517307125Z   16: tokio::runtime::thread_pool::worker::Context::run_task
vaultwarden    | 2022-05-23T19:45:16.517318657Z   17: tokio::runtime::thread_pool::worker::Context::run
vaultwarden    | 2022-05-23T19:45:16.517350286Z   18: tokio::macros::scoped_tls::ScopedKey<T>::set
vaultwarden    | 2022-05-23T19:45:16.517365504Z   19: tokio::runtime::thread_pool::worker::run
vaultwarden    | 2022-05-23T19:45:16.517397605Z   20: <tokio::runtime::blocking::task::BlockingTask<T> as core::future::future::Future>::poll
vaultwarden    | 2022-05-23T19:45:16.517412883Z   21: tokio::runtime::task::harness::Harness<T,S>::poll
vaultwarden    | 2022-05-23T19:45:16.517460072Z   22: tokio::runtime::blocking::pool::Inner::run
vaultwarden    | 2022-05-23T19:45:16.517476022Z   23: std::sys_common::backtrace::__rust_begin_short_backtrace
vaultwarden    | 2022-05-23T19:45:16.517518501Z   24: core::ops::function::FnOnce::call_once{{vtable.shim}}
vaultwarden    | 2022-05-23T19:45:16.517536144Z   25: std::sys::unix::thread::Thread::new::thread_start
vaultwarden    | 2022-05-23T19:45:16.517572913Z   26: start_thread
vaultwarden    | 2022-05-23T19:45:16.517588172Z   27: clone
vaultwarden    | 2022-05-23T19:45:16.517619471Z
@tophers

This comment was marked as off-topic.

@BlackDex
Copy link
Collaborator

Strange, that doesn't happen at all for me.
Does this happen on all accounts? On all clients?
Could you also post your Support String please?

@BlackDex
Copy link
Collaborator

BlackDex commented May 24, 2022

@tophers that looks more like a ROCKET_ configuration issue, and not in any way related to this.
Please create a new item regarding this.

@Decicus
Copy link
Author

Decicus commented May 24, 2022

Strange, that doesn't happen at all for me. Does this happen on all accounts? On all clients? Could you also post your Support String please?

I only have one account on my instance, otherwise I would've tested that yesterday.
I was going to test that now, but when I tried to change to latest again and restarting all the containers... it now seems fine? None of the errors I got yesterday and the vault loads again (I definitely tested restarting the containers yesterday, so not sure what exactly is different now).

I'll be closing this, since I can't even reproduce it myself.

@Decicus Decicus closed this as completed May 24, 2022
@jzahraoui
Copy link

hello, I have the same issue. I understand completely, but it would be good to keep this issue opened until a solution is found.

for myself, after the upgrade from 1.24 to 1.25 the container won't start because of ROCKET_CLI_COLORS variable value.
details: https://github.com/SergioBenitez/Rocket/issues/1923
don't know if this help to reproduce.

after fixing that, the container start well, no errors into the log file. but when I try to access to url "/#/vault", the error message "Commands out of sync; you can't run this command now" appear into the log and no items is displayed on the web page.
IOS and android application not able to synchronize.

My log :

[2022-05-24 12:31:09.692][parity_ws][INFO] Listening for new connections on 0.0.0.0:3012.
[2022-05-24 12:31:09.693][start][INFO] Rocket has launched from http://0.0.0.0:80
[2022-05-24 12:31:28.005][request][INFO] POST /api/accounts/prelogin
[2022-05-24 12:31:28.009][response][INFO] (prelogin) POST /api/accounts/prelogin => 200 OK
[2022-05-24 12:31:28.047][request][INFO] POST /identity/connect/token
[2022-05-24 12:31:28.111][vaultwarden::api::identity][INFO] User ****@**** logged in successfully. IP: ***
[2022-05-24 12:31:28.111][response][INFO] (login) POST /identity/connect/token => 200 OK
[2022-05-24 12:31:28.138][request][INFO] POST /identity/connect/token
[2022-05-24 12:31:28.140][response][INFO] (login) POST /identity/connect/token => 200 OK
[2022-05-24 12:31:28.153][request][INFO] GET /api/sync?excludeDomains=true
[2022-05-24 12:31:28.210][panic][ERROR] thread 'rocket-worker-thread' panicked at 'Error loading attachments: DatabaseError(__Unknown, "Commands out of sync; you can't run this command now")': src/db/models/attachment.rs:196
   0: vaultwarden::init_logging::{{closure}}
   1: std::panicking::rust_panic_with_hook
   2: std::panicking::begin_panic_handler::{{closure}}
   3: std::sys_common::backtrace::__rust_end_short_backtrace
   4: rust_begin_unwind
   5: core::panicking::panic_fmt
   6: core::result::unwrap_failed
   7: tokio::runtime::enter::exit
   8: tokio::runtime::thread_pool::worker::block_in_place
   9: <core::future::from_generator::GenFuture<T> as core::future::future::Future>::poll
  10: <core::future::from_generator::GenFuture<T> as core::future::future::Future>::poll
  11: <core::future::from_generator::GenFuture<T> as core::future::future::Future>::poll
  12: <core::future::from_generator::GenFuture<T> as core::future::future::Future>::poll
  13: tokio::runtime::task::harness::poll_future
  14: tokio::runtime::task::harness::Harness<T,S>::poll
  15: std::thread::local::LocalKey<T>::with
  16: tokio::runtime::thread_pool::worker::Context::run_task
  17: tokio::runtime::thread_pool::worker::Context::run
  18: tokio::macros::scoped_tls::ScopedKey<T>::set
  19: tokio::runtime::thread_pool::worker::run
  20: <tokio::runtime::blocking::task::BlockingTask<T> as core::future::future::Future>::poll
  21: tokio::runtime::task::harness::Harness<T,S>::poll
  22: tokio::runtime::blocking::pool::Inner::run
  23: std::sys_common::backtrace::__rust_begin_short_backtrace
  24: core::ops::function::FnOnce::call_once{{vtable.shim}}
  25: std::sys::unix::thread::Thread::new::thread_start
  26: start_thread
  27: clone

[2022-05-24 12:31:28.210][response][INFO] (sync) GET /api/sync?<data..> => 500 Internal Server Error
[2022-05-24 12:31:29.150][parity_ws::io][INFO] Accepted a new tcp connection from 172.17.0.1:57734.

@BlackDex
Copy link
Collaborator

@jzahraoui could you post your Support String please?

@sunny5055
Copy link

I have exactly the same issue. reverting 1.24 resolved for now. Below is the support string.

Your environment (Generated via diagnostics page)

  • Vaultwarden version: v1.25.0
  • Web-vault version: v2.28.1
  • Running within Docker: true (Base: Debian)
  • Environment settings overridden: false
  • Uses a reverse proxy: false
  • Internet access: true
  • Internet access via a proxy: false
  • DNS Check: true
  • Time Check: true
  • Domain Configuration Check: false
  • HTTPS Check: true
  • Database type: MySQL
  • Database version: 10.5.15-MariaDB-0+deb11u1
  • Clients used:
  • Reverse proxy and version:
  • Other relevant information:

Config (Generated via diagnostics page)

Show Running Config

Environment settings which are overridden:

{
  "_duo_akey": null,
  "_enable_duo": false,
  "_enable_email_2fa": true,
  "_enable_smtp": true,
  "_enable_yubico": true,
  "_ip_header_enabled": true,
  "admin_ratelimit_max_burst": 3,
  "admin_ratelimit_seconds": 300,
  "admin_token": "***",
  "allowed_iframe_ancestors": "",
  "attachments_folder": "data/attachments",
  "authenticator_disable_time_drift": false,
  "data_folder": "data",
  "database_conn_init": "",
  "database_max_conns": 10,
  "database_timeout": 30,
  "database_url": "*****://************:*********@***@**.*.*.*:****/*********",
  "db_connection_retries": 15,
  "disable_2fa_remember": false,
  "disable_admin_token": false,
  "disable_icon_download": false,
  "domain": "*****://*********.****.***/",
  "domain_origin": "*****://*********.****.***",
  "domain_path": "",
  "domain_set": true,
  "duo_host": null,
  "duo_ikey": null,
  "duo_skey": null,
  "email_attempts_limit": 3,
  "email_expiration_time": 600,
  "email_token_size": 6,
  "emergency_access_allowed": true,
  "emergency_notification_reminder_schedule": "0 5 * * * *",
  "emergency_request_timeout_schedule": "0 5 * * * *",
  "enable_db_wal": true,
  "extended_logging": true,
  "helo_name": null,
  "hibp_api_key": null,
  "icon_blacklist_non_global_ips": true,
  "icon_blacklist_regex": null,
  "icon_cache_folder": "data/icon_cache",
  "icon_cache_negttl": 259200,
  "icon_cache_ttl": 2592000,
  "icon_download_timeout": 10,
  "icon_redirect_code": 302,
  "icon_service": "internal",
  "incomplete_2fa_schedule": "30 * * * * *",
  "incomplete_2fa_time_limit": 3,
  "invitation_org_name": "Vaultwarden",
  "invitations_allowed": true,
  "ip_header": "X-Real-IP",
  "job_poll_interval_ms": 30000,
  "log_file": "/data/vaultwarden.log",
  "log_level": "Info",
  "log_timestamp_format": "%Y-%m-%d %H:%M:%S.%3f",
  "login_ratelimit_max_burst": 10,
  "login_ratelimit_seconds": 60,
  "org_attachment_limit": null,
  "org_creation_users": "",
  "password_iterations": 100000,
  "reload_templates": false,
  "require_device_email": false,
  "rsa_key_filename": "data/rsa_key",
  "send_purge_schedule": "0 5 * * * *",
  "sends_allowed": true,
  "sends_folder": "data/sends",
  "show_password_hint": false,
  "signups_allowed": true,
  "signups_domains_whitelist": "",
  "signups_verify": false,
  "signups_verify_resend_limit": 6,
  "signups_verify_resend_time": 3600,
  "smtp_accept_invalid_certs": false,
  "smtp_accept_invalid_hostnames": false,
  "smtp_auth_mechanism": null,
  "smtp_debug": false,
  "smtp_explicit_tls": null,
  "smtp_from": "*****.***@*******.***",
  "smtp_from_name": "Vaultwarden",
  "smtp_host": "****.*********.***",
  "smtp_password": "***",
  "smtp_port": 587,
  "smtp_security": "starttls",
  "smtp_ssl": true,
  "smtp_timeout": 15,
  "smtp_username": "*****.***@*******.***",
  "templates_folder": "data/templates",
  "tmp_folder": "data/tmp",
  "trash_auto_delete_days": null,
  "trash_purge_schedule": "0 5 0 * * *",
  "use_syslog": false,
  "user_attachment_limit": null,
  "web_vault_enabled": true,
  "web_vault_folder": "web-vault/",
  "websocket_address": "0.0.0.0",
  "websocket_enabled": true,
  "websocket_port": 3012,
  "yubico_client_id": null,
  "yubico_secret_key": null,
  "yubico_server": null
}

@jzahraoui
Copy link

Hello I revert back to 1.24, but here is the support string. let me know if you want the support string for the 1.25

Your environment (Generated via diagnostics page)

  • Vaultwarden version: v1.24.0
  • Web-vault version: v2.25.1
  • Running within Docker: true (Base: Debian)
  • Environment settings overridden: false
  • Uses a reverse proxy: true
  • IP Header check: true (X-Real-IP)
  • Internet access: true
  • Internet access via a proxy: false
  • DNS Check: true
  • Time Check: true
  • Domain Configuration Check: true
  • HTTPS Check: true
  • Database type: MySQL
  • Database version: 10.5.15-MariaDB-0+deb11u1-log
  • Clients used:
  • Reverse proxy and version:
  • Other relevant information:

Config (Generated via diagnostics page)

Show Running Config

Environment settings which are overridden:

{
  "_duo_akey": null,
  "_enable_duo": false,
  "_enable_email_2fa": true,
  "_enable_smtp": true,
  "_enable_yubico": true,
  "_ip_header_enabled": true,
  "admin_ratelimit_max_burst": 3,
  "admin_ratelimit_seconds": 300,
  "admin_token": "***",
  "allowed_iframe_ancestors": "",
  "attachments_folder": "data/attachments",
  "authenticator_disable_time_drift": false,
  "data_folder": "data",
  "database_max_conns": 10,
  "database_url": "*****://************:********************************@***.***.*.***/************",
  "db_connection_retries": 15,
  "disable_2fa_remember": false,
  "disable_admin_token": false,
  "disable_icon_download": false,
  "domain": "*****://****.**********.***/",
  "domain_origin": "*****://****.**********.***",
  "domain_path": "",
  "domain_set": true,
  "duo_host": null,
  "duo_ikey": null,
  "duo_skey": null,
  "email_attempts_limit": 3,
  "email_expiration_time": 600,
  "email_token_size": 6,
  "emergency_access_allowed": true,
  "emergency_notification_reminder_schedule": "0 5 * * * *",
  "emergency_request_timeout_schedule": "0 5 * * * *",
  "enable_db_wal": true,
  "extended_logging": true,
  "helo_name": null,
  "hibp_api_key": null,
  "icon_blacklist_non_global_ips": true,
  "icon_blacklist_regex": null,
  "icon_cache_folder": "data/icon_cache",
  "icon_cache_negttl": 259200,
  "icon_cache_ttl": 2592000,
  "icon_download_timeout": 10,
  "icon_redirect_code": 302,
  "icon_service": "internal",
  "incomplete_2fa_schedule": "30 * * * * *",
  "incomplete_2fa_time_limit": 3,
  "invitation_org_name": "Bitwarden",
  "invitations_allowed": true,
  "ip_header": "X-Real-IP",
  "job_poll_interval_ms": 30000,
  "log_file": "/var/log/bitwarden/bitwarden.log",
  "log_level": "info",
  "log_timestamp_format": "%Y-%m-%d %H:%M:%S.%3f",
  "login_ratelimit_max_burst": 10,
  "login_ratelimit_seconds": 60,
  "org_attachment_limit": null,
  "org_creation_users": "",
  "password_iterations": 100000,
  "reload_templates": false,
  "require_device_email": false,
  "rsa_key_filename": "data/rsa_key",
  "send_purge_schedule": "0 5 * * * *",
  "sends_allowed": true,
  "sends_folder": "data/sends",
  "show_password_hint": true,
  "signups_allowed": false,
  "signups_domains_whitelist": "",
  "signups_verify": true,
  "signups_verify_resend_limit": 6,
  "signups_verify_resend_time": 3600,
  "smtp_accept_invalid_certs": false,
  "smtp_accept_invalid_hostnames": false,
  "smtp_auth_mechanism": null,
  "smtp_debug": false,
  "smtp_explicit_tls": false,
  "smtp_from": "*********@**********.***",
  "smtp_from_name": "Bitwarden_RS",
  "smtp_host": "***.***.*.***",
  "smtp_password": null,
  "smtp_port": 25,
  "smtp_ssl": true,
  "smtp_timeout": 15,
  "smtp_username": null,
  "templates_folder": "data/templates",
  "trash_auto_delete_days": null,
  "trash_purge_schedule": "0 5 0 * * *",
  "use_syslog": false,
  "user_attachment_limit": null,
  "web_vault_enabled": true,
  "web_vault_folder": "web-vault/",
  "websocket_address": "0.0.0.0",
  "websocket_enabled": true,
  "websocket_port": 3012,
  "yubico_client_id": null,
  "yubico_secret_key": null,
  "yubico_server": null
}

@BlackDex BlackDex reopened this May 25, 2022
@BlackDex BlackDex added bug Something isn't working troubleshooting There might be bug or it could be user error, more info needed labels May 25, 2022
@BlackDex
Copy link
Collaborator

BlackDex commented May 26, 2022

Ok, it looks like you all at running MariaDB.
Could you run the following and post the full output of the following queries on your databases.

Change vaultwarden to the database name you used.

SHOW CREATE TABLE `attachments`; 
--- And also run
SHOW CREATE DATABASE `vaultwarden`;

@PeterRob
Copy link

MariaDB [vaultwarden]> SHOW CREATE TABLE attachments;
+-------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| Table | Create Table |
+-------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| attachments | CREATE TABLE attachments (
id char(36) NOT NULL,
cipher_uuid char(36) NOT NULL,
file_name text NOT NULL,
file_size int(11) NOT NULL,
akey text DEFAULT NULL,
PRIMARY KEY (id)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 |
+-------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
1 row in set (0.001 sec)

MariaDB [vaultwarden]> SHOW CREATE DATABASE vaultwarden;
+-------------+-------------------------------------------------------------------------+
| Database | Create Database |
+-------------+-------------------------------------------------------------------------+
| vaultwarden | CREATE DATABASE vaultwarden /*!40100 DEFAULT CHARACTER SET utf8mb4 */ |
+-------------+-------------------------------------------------------------------------+
1 row in set (0.009 sec)

@BlackDex
Copy link
Collaborator

I tried several times to cause this exact same issue on my environment but I'm not able to.
In my search to this issue i came across this issue: https://dba.stackexchange.com/a/183010.
So, it could be the database needs some repair/rebuild. That maybe could resolve the issue.
The answer above (https://dba.stackexchange.com/posts/285664/edit) is mentioning a memory issue, not sure if that could also be the case here.

Could you try to repair at least the attachment table, and maybe also the others if that isn't fixing it?

@PeterRob
Copy link

I ran mysqlcheck on the vaultwarden database, the problem remains.

@BlackDex
Copy link
Collaborator

BlackDex commented May 26, 2022

@PeterRob what did you exactly run?
Did you run mysqlcheck --all-databases --optimize for example. Because that will rebuild/recreate innodb tables.
Any other command will not do that.

@PeterRob
Copy link

  1. I ran mysqlcheck -c vaultwarden -u root -p and tested
  2. Ran mysqlcheck -u root -p -o vaultwarden

@BlackDex
Copy link
Collaborator

So, did you tested after the optimize?
Also, can you tell me how many attachments you have?
That is visible in the admin interface for both the users and the organizations.

@PeterRob
Copy link

Yes I tested after optimisation

There are no attachments - both users and organizations.

@BlackDex
Copy link
Collaborator

Strange. I'm really unable to reproduce this at all.

@BlackDex
Copy link
Collaborator

Could you provide a bit more info on the host where this is running?
What kind of hardware, how many CPU cores, how much memory.

Because i tried using the exact same MariaDB, but that isn't causing an issue for me at all.

Also, what happens if you create a new user, does it happen for that user also?
What if you export the vault, import it into the new user and test the new Vaultwarden version again.

If i could cause this my self i wouldn't need to ask these questions, but unfortunately that is not the case.

@jzahraoui
Copy link

is this can help : rwf2/Rocket#400 ?

@BlackDex
Copy link
Collaborator

is this can help : SergioBenitez/Rocket#400 ?

That is very very old, and both Rocket and Diesel are updated to newer version already.
I rather think it could have something to do with async, but that would also be a bit strange, also that is happens at the exact same spot for two different reports.

@jzahraoui
Copy link

tried to investigate.
I've logged the query send to the database :

220526 20:51:20     80 Query    SELECT 1
                80 Execute      SELECT `devices`.`uuid`, `devices`.`created_at`, `devices`.`updated_at`, `devices`.`user_uuid`, `devices`.`name`, `devices`.`atype`, `devices`.`push_token`, `devices`.`refresh_token`, `devices`.`twofactor_remember` FROM `devices` WHERE `devices`.`refresh_token` = '***-***==' LIMIT 1
                80 Execute      SELECT `users`.`uuid`, `users`.`enabled`, `users`.`created_at`, `users`.`updated_at`, `users`.`verified_at`, `users`.`last_verifying_at`, `users`.`login_verify_count`, `users`.`email`, `users`.`email_new`, `users`.`email_new_token`, `users`.`name`, `users`.`password_hash`, `users`.`salt`, `users`.`password_iterations`, `users`.`password_hint`, `users`.`akey`, `users`.`private_key`, `users`.`public_key`, `users`.`totp_secret`, `users`.`totp_recover`, `users`.`security_stamp`, `users`.`stamp_exception`, `users`.`equivalent_domains`, `users`.`excluded_globals`, `users`.`client_kdf_type`, `users`.`client_kdf_iter`, `users`.`api_key` FROM `users` WHERE `users`.`uuid` = '*-*-*-*-*' LIMIT 1
                80 Execute      SELECT `users_organizations`.`uuid`, `users_organizations`.`user_uuid`, `users_organizations`.`org_uuid`, `users_organizations`.`access_all`, `users_organizations`.`akey`, `users_organizations`.`status`, `users_organizations`.`atype` FROM `users_organizations` WHERE `users_organizations`.`user_uuid` = '*-*-*-*-*' AND `users_organizations`.`status` = 2
                80 Prepare      REPLACE INTO `devices` (`uuid`, `created_at`, `updated_at`, `user_uuid`, `name`, `atype`, `push_token`, `refresh_token`, `twofactor_remember`) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?)
                80 Execute      REPLACE INTO `devices` (`uuid`, `created_at`, `updated_at`, `user_uuid`, `name`, `atype`, `push_token`, `refresh_token`, `twofactor_remember`) VALUES ('**', TIMESTAMP'2021-12-18 18:08:24', TIMESTAMP'2022-05-26 18:51:20.076111', '*-*-*-*-*', 'chrome', 9, NULL, '*-*==', NULL)
                80 Close stmt
                80 Query        SELECT 1
                80 Execute      SELECT `devices`.`uuid`, `devices`.`created_at`, `devices`.`updated_at`, `devices`.`user_uuid`, `devices`.`name`, `devices`.`atype`, `devices`.`push_token`, `devices`.`refresh_token`, `devices`.`twofactor_remember` FROM `devices` WHERE `devices`.`uuid` = '1a21a841-8410-48d0-8238-386859383fd3' AND `devices`.`user_uuid` = '*-*-*-*-*' LIMIT 1
                80 Execute      SELECT `users`.`uuid`, `users`.`enabled`, `users`.`created_at`, `users`.`updated_at`, `users`.`verified_at`, `users`.`last_verifying_at`, `users`.`login_verify_count`, `users`.`email`, `users`.`email_new`, `users`.`email_new_token`, `users`.`name`, `users`.`password_hash`, `users`.`salt`, `users`.`password_iterations`, `users`.`password_hint`, `users`.`akey`, `users`.`private_key`, `users`.`public_key`, `users`.`totp_secret`, `users`.`totp_recover`, `users`.`security_stamp`, `users`.`stamp_exception`, `users`.`equivalent_domains`, `users`.`excluded_globals`, `users`.`client_kdf_type`, `users`.`client_kdf_iter`, `users`.`api_key` FROM `users` WHERE `users`.`uuid` = '*-*-*-*-*' LIMIT 1
                80 Query        SELECT 1
                80 Execute      SELECT `users_organizations`.`uuid`, `users_organizations`.`user_uuid`, `users_organizations`.`org_uuid`, `users_organizations`.`access_all`, `users_organizations`.`akey`, `users_organizations`.`status`, `users_organizations`.`atype` FROM `users_organizations` WHERE `users_organizations`.`user_uuid` = '*-*-*-*-*' AND `users_organizations`.`status` = 2
                80 Execute      SELECT `organizations`.`uuid`, `organizations`.`name`, `organizations`.`billing_email`, `organizations`.`private_key`, `organizations`.`public_key` FROM `organizations` WHERE `organizations`.`uuid` = '*-*-*-*-*' LIMIT 1
                80 Execute      SELECT `organizations`.`uuid`, `organizations`.`name`, `organizations`.`billing_email`, `organizations`.`private_key`, `organizations`.`public_key` FROM `organizations` WHERE `organizations`.`uuid` = '*-*-*-*-*' LIMIT 1
                80 Execute      SELECT `organizations`.`uuid`, `organizations`.`name`, `organizations`.`billing_email`, `organizations`.`private_key`, `organizations`.`public_key` FROM `organizations` WHERE `organizations`.`uuid` = '*-*-*-*-*' LIMIT 1
                80 Execute      SELECT `organizations`.`uuid`, `organizations`.`name`, `organizations`.`billing_email`, `organizations`.`private_key`, `organizations`.`public_key` FROM `organizations` WHERE `organizations`.`uuid` = '*-*-*-*-*' LIMIT 1
                80 Execute      SELECT `twofactor`.`uuid`, `twofactor`.`user_uuid`, `twofactor`.`atype`, `twofactor`.`enabled`, `twofactor`.`data`, `twofactor`.`last_used` FROM `twofactor` WHERE `twofactor`.`user_uuid` = '*-*-*-*-*' AND `twofactor`.`atype` < 1000
                80 Execute      SELECT DISTINCT `ciphers`.`uuid`, `ciphers`.`created_at`, `ciphers`.`updated_at`, `ciphers`.`user_uuid`, `ciphers`.`organization_uuid`, `ciphers`.`atype`, `ciphers`.`name`, `ciphers`.`notes`, `ciphers`.`fields`, `ciphers`.`data`, `ciphers`.`password_history`, `ciphers`.`deleted_at`, `ciphers`.`reprompt` FROM (((`ciphers` LEFT OUTER JOIN `ciphers_collections` ON `ciphers`.`uuid` = `ciphers_collections`.`cipher_uuid`) LEFT OUTER JOIN `users_organizations` ON `ciphers`.`organization_uuid` = `users_organizations`.`org_uuid` AND `users_organizations`.`user_uuid` = '*-*-*-*-*' AND `users_organizations`.`status` = 2) LEFT OUTER JOIN `users_collections` ON `ciphers_collections`.`collection_uuid` = `users_collections`.`collection_uuid` AND `users_organizations`.`user_uuid` = `users_collections`.`user_uuid`) WHERE ((`ciphers`.`user_uuid` = '*-*-*-*-*' OR `users_organizations`.`access_all` = 1) OR `users_collections`.`user_uuid` = '*-*-*-*-*')
                80 Prepare      SELECT `attachments`.`id`, `attachments`.`cipher_uuid`, `attachments`.`file_name`, `attachments`.`file_size`, `attachments`.`akey` FROM `attachments` WHERE `attachments`.`cipher_uuid` IN (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?,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, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)
                80 Close stmt

May be the se select have to much elements into the "IN" clause. counted 3213 elements. find some people saying the max is 1000 but don't have the clue.

put vaultwarden log level to trace. unfortunately not helping.

@jzahraoui
Copy link

to compare the version 1.24.0 give this query trace :

220526 21:09:33     79 Query    SELECT 1
                79 Execute      SELECT `devices`.`uuid`, `devices`.`created_at`, `devices`.`updated_at`, `devices`.`user_uuid`, `devices`.`name`, `devices`.`atype`, `devices`.`push_token`, `devices`.`refresh_token`, `devices`.`twofactor_remember` FROM `devices` WHERE `devices`.`uuid` = '*-*-*-*-*' LIMIT 1
                79 Execute      SELECT `users`.`uuid`, `users`.`enabled`, `users`.`created_at`, `users`.`updated_at`, `users`.`verified_at`, `users`.`last_verifying_at`, `users`.`login_verify_count`, `users`.`email`, `users`.`email_new`, `users`.`email_new_token`, `users`.`name`, `users`.`password_hash`, `users`.`salt`, `users`.`password_iterations`, `users`.`password_hint`, `users`.`akey`, `users`.`private_key`, `users`.`public_key`, `users`.`totp_secret`, `users`.`totp_recover`, `users`.`security_stamp`, `users`.`stamp_exception`, `users`.`equivalent_domains`, `users`.`excluded_globals`, `users`.`client_kdf_type`, `users`.`client_kdf_iter`, `users`.`api_key` FROM `users` WHERE `users`.`uuid` = '*-*-*-*-*' LIMIT 1

@BlackDex
Copy link
Collaborator

Yes, that has changed to improve sync.
Look at those answers its a configuration item on the server. https://stackoverflow.com/questions/4275640/mysql-in-condition-limit/4275704#4275704

There isn't a hardcoded limitation on the amount. I have tested 6000+ items during the development.

I would suggest to see if changing that max_allowed_packets option would help.

@jzahraoui
Copy link

tried max_allowed_packet=1G but it didn't help. I'm still searching.

@sunny5055
Copy link

Have you tried creating an organization on 1.25 and check if you get the issue ?

@jzahraoui
Copy link

yes I tried. It return the error when I try to create an organization. but when I revert back to 1.24 the organization appear.
Another thing, If I login with an other user, no errors at all, everything is working fine.

@BlackDex
Copy link
Collaborator

@jzahraoui does that new user have more then 1000 items?

@jzahraoui
Copy link

my user have 3143 items, it is not working.
the second user have only 44 items (it is working)

@BlackDex
Copy link
Collaborator

How much memory does the system have which is running MariaDB?
Is it using the default Debian configuration?

@jzahraoui
Copy link

Having 32gb of ram but running some other process. Turned some innodb parameters.

@PeterRob
Copy link

PeterRob commented May 28, 2022

I made a new user account and progressively added logins (plain logins, no attachments). Syncing the vault failed at 1,000 logins added to the account.

@BlackDex
Copy link
Collaborator

BlackDex commented May 28, 2022

It probably has something to do with in_predicate_conversion_threshold. But in my setup that is also 1000, but even if i set that to 200 it will not break. Also, if i understood correctly, MariaDB uses that to try and optimize the query it self, but still allows larger values.

The max_allowed_packet value, if set to low, generates a totally different error, so that is probably not the issue here.

It would be interesting to see what happens if you put the in_predicate_conversion_threshold to 4000 or something to see what that does.

Also see: https://mariadb.com/kb/en/conversion-of-big-in-predicates-into-subqueries/

@PeterRob
Copy link

Setting in_predicate_conversion_threshold to 4000 = success!

@BlackDex
Copy link
Collaborator

Good to see that that is a working solution. Still strange, as i understand the documentation correctly that MariaDB only uses that value to split the IN() clause into multiple IN() clauses or something like that. And me having it set to 200, and having 6000+ entries in there does work without any issue.

I'm going to see if i can figure out how i can trigger this my self, maybe it's a bug in the specific MariaDB version used by Debian, that is something i did not try yet.

@BlackDex BlackDex added wontfix This will not be worked on Third party Needs an update from the third party library and removed bug Something isn't working troubleshooting There might be bug or it could be user error, more info needed labels Jun 4, 2022
@BlackDex
Copy link
Collaborator

BlackDex commented Jun 4, 2022

I tried and tried, and nothing seemed to break on my testing environments what ever i tried.
Low memory, low CPU etc..

Then i went to ask for some help on IRC from the MariaDB Devs, and they mentioned this was a bug in the exact version you are using. It seems that both Ubuntu and Debian didn't updated there packages yet, or cherry-picked that fix into there builds.

It is fixed in v10.5.16 of MariaDB.

For some more information see the following links:

I'm afraid that we can't fix this on the client (Vaultwarden) side.

So, what they suggest is to set in_predicate_conversion_threshold=0.
By setting it to 0 it will behave as MariaDB did before they implemented this feature.
Or try to update your version to v10.5.16 or higher.

Because of this, i will close this issue.

@BlackDex BlackDex closed this as not planned Won't fix, can't repro, duplicate, stale Jun 4, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Third party Needs an update from the third party library wontfix This will not be worked on
Projects
None yet
Development

No branches or pull requests

6 participants