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

How to deal with a full safe (edited) #9

Open
zupo opened this issue Sep 13, 2015 · 6 comments
Open

How to deal with a full safe (edited) #9

zupo opened this issue Sep 13, 2015 · 6 comments

Comments

@zupo
Copy link

zupo commented Sep 13, 2015

An unhandled exception occured:

   Traceback (most recent call last):
     File "/usr/local/lib/python2.7/site-packages/pol/main.py", line 1273, in _run_command
       return self.args.func()
     File "/usr/local/lib/python2.7/site-packages/pol/main.py", line 1150, in cmd_import_keepass
       the_container.save()
     File "/usr/local/lib/python2.7/site-packages/pol/safe.py", line 403, in save
       self.main_slice.store(self.list_key, main_pt, annex=annex)
     File "/usr/local/lib/python2.7/site-packages/pol/safe.py", line 520, in store
       raise ValueError("`value' too large")
   ValueError: `value' too large
@zupo
Copy link
Author

zupo commented Sep 13, 2015

One possibility is to display the key & value, and offer to skip.

@bwesterb
Copy link
Owner

Thanks for reporting the problem. I should make this error message more user friendly. You have to many entries to fit in the default size of the container. (Actually, it's the combined size of the entries.) Are you sure there are no unnecessarily large entries in there? You can show the entries while importing by adding -vv after pol. Another hack is to increase the size of your safe using the -N parameter to init. Default is 1024. Larger will make pol slower to rerandomize after each operation. Be warned: you will need to overwrite your existing container. If you already have something in there, you can use pol import and pol export.

@bwesterb bwesterb changed the title Error importing KeepassX db How to deal with a full safe Sep 13, 2015
@bwesterb bwesterb changed the title How to deal with a full safe How to deal with a full safe (edited) Sep 13, 2015
@zupo
Copy link
Author

zupo commented Sep 13, 2015

After removing the "trash" folder in KeepassX DB, the import finished successful for 425 items.

But the safe is broken apparenly. I get the following error for list, edit, etc. The safe was empty before import.

An unhandled exception occured:

   Traceback (most recent call last):
     File "/usr/local/lib/python2.7/site-packages/pol/main.py", line 1273, in _run_command
       return self.args.func()
     File "/usr/local/lib/python2.7/site-packages/pol/main.py", line 950, in cmd_edit
       for container in self._open_containers(safe, password):
     File "/usr/local/lib/python2.7/site-packages/pol/safe.py", line 678, in open_containers
       on_move_append_entries)
     File "/usr/local/lib/python2.7/site-packages/pol/safe.py", line 707, in _open_container_with_access_data
       main_slice.value))
     File "/usr/local/lib/python2.7/site-packages/pol/serialization.py", line 34, in string_to_son
       tmp = zlib.decompress(s[1:])
   error: Error -5 while decompressing data: incomplete or truncated stream

@bwesterb
Copy link
Owner

Can you create a new safe and try the import again, but this time adding -vv directly after pol? Please copy the output after you removed your usernames and passwords. Please double check you removed those. I am interested in the lines like

8018 DEBUG pol.serialization son_to_string: original 2705; gzipped: 2289
8018 DEBUG pol.serialization son_to_string: original 5568; gzipped: 4282
8018 DEBUG pol.safe Slice.store: storing @206; 162 blocks; 4283/20376B
8144 DEBUG pol.safe Slice.store:  ... done in 0.126 (1286.7 block/s)

@zupo
Copy link
Author

zupo commented Sep 13, 2015

Hmmm. Cannot reproduce.

@bwesterb
Copy link
Owner

I will try to reproduce the bug you hit.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants