mirror of
https://github.com/dani-garcia/vaultwarden.git
synced 2026-02-05 00:29:40 +03:00
Cannot import vault json into Vaultwarden #1147
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 @fbartels on GitHub (Nov 8, 2021).
Subject of the issue
I am trying to move one Vaultwarden Vault from one instance to another. Initially I wanted to do this with Portwarden (to also migrate attachments), but Portwarden was throwing the following error:
Trying to directly trying to import the vault data generated from the "Export Vault" function in the web ui does not give a visible error message, but in the browser tools I can see that the request produced an error 400 with the following response:
Vaultwarden logs the following when this happens (in both cases):
I tried to import the same json file into the Bitwarden SaaS and got a more descriptive error there:
Deployment environment
Your environment (Generated via diagnostics page)
Config (Generated via diagnostics page)
Show Running Config
Environment settings which are overridden:
Steps to reproduce
Import a json file with an entry that has more than 10000 characters in the notes field.
Expected behaviour
Import the json or give an error message similar to the Bitwarden SaaS.
Actual behaviour
Non descriptive error message.
Troubleshooting data
@cksapp commented on GitHub (Nov 9, 2021):
There is a 10k limit on upstream Bitwarden, mind you this is also 10k characters when encrypted as well, so decrypted in the vault it will have to be much less. Do you have vault items with more than the 10k character limit in notes field? In my limited testing, it seems when attempting to create a vault item with more than 10k characters the same above error occurs, this is on the backend server side after encryption. In plain-text within your vault this appears to be approx. ~7400k characters
https://bitwarden.com/help/article/import-data/#troubleshooting-import-errors
It appears Vaultwarden does not have this same 10K character limit when encrypted server side, as the web vault allows notes well over 10k characters.
Though it does seem to break somewhere in between 5mil - 10 million characters.
This would best be solved with a feature request (PR) to have Vaultwarden honour the 10k encrypted limit server side when the client attempts to import, create, or edit and save an item over this limit.
@BlackDex commented on GitHub (Dec 23, 2021):
I'm not able to reproduce this, at least not on the latest version currently available.
It could be that they fixed something in the latest web-vault version v2.25.x.
Could you please try that and see if this is solved?
Update/Edit:
btw, i used a string with 30.000+ characters in both a
LoginandSecure Note, exported and imported using both Bitwarden'sJSONandCSVformats.@BlackDex commented on GitHub (Dec 24, 2021):
I just also checked a different database besides SQLite3, with MariaDB/MySQL it also works fine.
I think this is related to an issue i discovered last week that sometimes imports are aborted or timed-out because of some websocket refreshes which are generated.
it's either that, or the bitwarden cli (which is used by portwarden) doesn't support these items to read/write.
That is something i did not try yet.
@fbartels commented on GitHub (Dec 27, 2021):
Hi @BlackDex,
thanks for your response (and @cksapp of course as well). I understood this as a general recommendation to break down large note fields and split them up. The migration carried out a few weeks ago and I no longer have access to the old installation.
Since it does no longer seem to be a problem in newer installations it sounds like a good idea to close this and the original error messages no longer appear.