bachya / lp-vault-manager

An Alfred 2 workflow to interact with a LastPass vault.
121 stars 13 forks source link

lpvs fails with error #2

Closed fmmr closed 9 years ago

fmmr commented 9 years ago

Installation, setting up my username and login seems to be working fine. Also lpass export (from the cmdline lists a lot of data.

But I get the following error when trying to search my vault:

example: lpvs skand

Starting debug for 'LastPass Vault Manager'

[ERROR: alfred.workflow.input.scriptfilter] Code 1: 23:35:18 workflow.py:1598 DEBUG    Loading cached data from : /Users/fmr/Library/Caches/com.runningwithcrayons.Alfred-2/Workflow Data/com.bachya.lpvm/vault_items.cpickle
23:35:18 workflow.py:1951 ERROR    'ascii' codec can't decode byte 0xc3 in position 10: ordinal not in range(128)
Traceback (most recent call last):
  File "/Users/fmr/Dropbox/settings/alfred_2/Alfred.alfredpreferences/workflows/user.workflow.127EFC78-D2F5-47D5-BD4A-B4C80FBCFB73/workflow/workflow.py", line 1946, in run
    func(self)
  File "lpvm.py", line 246, in main
    search_vault(wf, vault, args.query)
  File "lpvm.py", line 141, in search_vault
    results = _search_vault(wf, vault, query)
  File "lpvm.py", line 40, in _search_vault
    match_on=MATCH_ALL ^ MATCH_ALLCHARS
  File "/Users/fmr/Dropbox/settings/alfred_2/Alfred.alfredpreferences/workflows/user.workflow.127EFC78-D2F5-47D5-BD4A-B4C80FBCFB73/workflow/workflow.py", line 1780, in filter
    value = key(item).strip()
  File "lpvm.py", line 88, in search_item_fields
    return ' '.join(elements)
UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in position 10: ordinal not in range(128)
23:35:18 workflow.py:1969 DEBUG    Workflow finished in 0.790 seconds.
bachya commented 9 years ago

Looks like an issue somewhere in [the Alfred Python library I'm using].(https://github.com/deanishe/alfred-workflow). I've shown it to the author and will let you know what he says. In the meantime: does your vault contain any non-ASCII characters in the title or URL fields of its items?

fmmr commented 9 years ago

yes, it does. Here are the first lines wen running the export manually:

╰  $~ lpass export
pinentry-curses: no LC_CTYPE known - assuming UTF-8
url,username,password,hostname,name,grouping
http://repo.fredrik.com:9080,....
...

example of an entry with non ascii character: http://rødtangen.no/,xxx,xxx,rødtangen.no,rødtangen.no,

bachya commented 9 years ago

Please try the following:

  1. Download the pre-release of version 3.2: https://github.com/bachya/lp-vault-manager/releases/tag/v3.2
  2. Run lpdd to re-download your cache.
  3. Try your search again.

Let me know if this fixes your issue.

fmmr commented 9 years ago

pre-release of version 3.2 seems to have done the trick. It works. Thanks!

bachya commented 9 years ago

Great to hear! I'm working on Issue #3 before I do an official release, but you are welcome to proceed forward with it.