Jump to content

Script Filters (via Python) seem to sporadically not work


Recommended Posts

Workflow: LastPass Vault Manager

Packal Page: http://www.packal.org/workflow/lastpass-vault-manager

Alfred Forum Thread: http://www.alfredforum.com/topic/5293-lp-vault-manager-a-workflow-for-lastpass/

 

The Issue:

 

A few (not all) users have been reporting that some of the Script Filters within my workflow don't seem to work. In particular, page 2 of the forum page and this GitHub issue report that although the Python scripts return the correct results, those results don't seem to translate into actually using the workflow.

 

I'd love to get a few more people hammering on it and, if possible, see where the breaks are occurring (within Alfred, within the workflow, within individual user environments, etc.).

 

Build Notes:

  • The workflow makes use of the Alfred-Workflow Python library.
  • The error reports state that a lot of debug information that is normally output by the library isn't showing up in their Alfred debug console.
  • At the same time, running the Python scripts directly in the Terminal work as expected.
Edited by Aaron B.
Link to comment

I've installed LastPass, the cli program and the workflow, and added a few passwords, but I can't replicate the problem either.

A few of pointers that may or may not help:

  • Make sure you're using the same paths in the workflow and in the shell when running scripts. Alfred normally has launchd's empty PATH. It will use /usr/bin/python (and /usr/bin/lpass if it exists). In a shell, you'll get /usr/local/bin/lpass (and /usr/local/bin/python if it exists). When folks run the Python scripts in a shell, they should use /usr/bin/python script_name.py, not just python script_name.py. In your workflow, you should also specify /usr/bin/python, not just python. If Alfred was launched from a shell, it will inherit the shell's PATH.
  • Get users to add a space after the query, delete it again, repeat. The workflow updates its cache very often. If the problem is only sporadic, it's possible the query is coming at exactly the same time that the data cache is deleted in the background. This is unlikely: if you try to load a cache while it's being updated, you'll typically get an error.
  • LastPassVaultManager ignores self.lpass_path: in line 84 it still uses DEFAULT_LPASS_PATH, not self.lpass_path.
  • Might be worth logging how many items were imported from lpass and/or stored to/loaded from cache.
  • Don't worry about crazy amounts of logging (as long as you're not logging passwords). Alfred-Workflow won't let the logfile get larger than 1 MB and logging is very fast. It's still a good idea to dial it down again once the problem's fixed, though.
  • Seeing as you're using GitHub releases, you might want to consider turning on the automatic updating. It'll make it easier to get the newer version to users while you're updating often.

 

I'm afraid I had a similar problem with my Smart Folders workflow. I was unable to figure out how to fix it, unfortunately. When you can't replicate the bug, you're basically taking shots in the dark :(

Edited by deanishe
Link to comment

I've installed LastPass, the cli program and the workflow, and added a few passwords, but I can't replicate the problem either.

A few of pointers that may or may not help:

  • Make sure you're using the same paths in the workflow and in the shell when running scripts. Alfred normally has launchd's empty PATH. It will use /usr/bin/python (and /usr/bin/lpass if it exists). In a shell, you'll get /usr/local/bin/lpass (and /usr/local/bin/python if it exists). When folks run the Python scripts in a shell, they should use /usr/bin/python script_name.py, not just python script_name.py. In your workflow, you should also specify /usr/bin/python, not just python. If Alfred was launched from a shell, it will inherit the shell's PATH.
  • Get users to add a space after the query, delete it again, repeat. The workflow updates its cache very often. If the problem is only sporadic, it's possible the query is coming at exactly the same time that the data cache is deleted in the background. This is unlikely: if you try to load a cache while it's being updated, you'll typically get an error.
  • LastPassVaultManager ignores self.lpass_path: in line 84 it still uses DEFAULT_LPASS_PATH, not self.lpass_path.
  • Might be worth logging how many items were imported from lpass and/or stored to/loaded from cache.
  • Don't worry about crazy amounts of logging (as long as you're not logging passwords). Alfred-Workflow won't let the logfile get larger than 1 MB and logging is very fast. It's still a good idea to dial it down again once the problem's fixed, though.
  • Seeing as you're using GitHub releases, you might want to consider turning on the automatic updating. It'll make it easier to get the newer version to users while you're updating often.

10-4, Dean – thank you for your suggestions and bug finds. I'll debug further with the users.

I'm afraid I had a similar problem with my Smart Folders workflow. I was unable to figure out how to fix it, unfortunately. When you can't replicate the bug, you're basically taking shots in the dark :(

Amen to that. :( This has been a real pain.

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...