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

It appears you are not logged in to Lastpass. #54

Open
diegosantamarta opened this issue Feb 21, 2019 · 24 comments
Open

It appears you are not logged in to Lastpass. #54

diegosantamarta opened this issue Feb 21, 2019 · 24 comments

Comments

@diegosantamarta
Copy link

I put my login credentials but when I try to search hace this error:

captura de pantalla 2019-02-21 a las 12 33 26

The debug output on Alfred with All information is:

[2019-02-21 12:33:23][input.scriptfilter] Queuing argument 'zeplin'
[2019-02-21 12:33:24][input.scriptfilter] Script with argument '(null)' finished
[2019-02-21 12:33:24][ERROR: input.scriptfilter] Code 1: <?xml version="1.0"?>
<items>
<item uid="error-login"><arg>'error-login', ''</arg><title>It appears you are not logged in to LastPass.</title><subtitle>Please login using the 'lplogin' command or press 'ctrl' + enter to login now.</subtitle><icon>icon.png</icon></item>
</items>

Thanks in advance
Diego

@parceritaz
Copy link

I'm getting the same error, tried multiples times and no dice. I'm on version 4 of Alfred so maybe that's why...?

@stuartcryan
Copy link
Owner

Howdy, out of curiosity, I want to confirm, you have put your login credentials with 'lpsetemail', have you also then run 'lplogin'?

If so, when you open up a terminal session in MacOS and type 'lpass status' does it say you are logged in or logged out?
Cheers,
Stuart

@probablykasper
Copy link

Debug output from running lplogin:

[2:25:08.729] LastPass CLI[Keyword] Processing complete
[2:25:08.729] LastPass CLI[Keyword] Passing output '' to Run Script
[2:25:08.861] ERROR: LastPass CLI[Run Script] 2845:2846: syntax error: Expected end of line but found “"”. (-2741)

@juandaco
Copy link

juandaco commented Jun 2, 2019

I was having this same issue. You just need to replace in the osascript block that comes out of lplogin, Alfred 3 for Alfred 4. The window prompting you for your master password appears after that and everything is working as it should.

@probablykasper
Copy link

@juandaco Tried this, and it seems to have fixed one issue, but lplogin still gives an error:

[11:21:37.386] LastPass CLI[Keyword] Processing complete
[11:21:37.387] LastPass CLI[Keyword] Passing output '' to Run Script
[11:21:37.616] ERROR: LastPass CLI[Run Script] 2637:2649: execution error: The variable lpass_binary is not defined. (-2753)

@probablykasper
Copy link

@juandaco Nevermind, I installed the workflow wrong. Works like a charm now

@stacksjb
Copy link

Thanks, I had the same issue, working now.

@squatto
Copy link

squatto commented Sep 7, 2019

For those that are coming to this issue looking for a solution, I wanted to put it as the last comment to make it easier to find. Once #56 is merged this will no longer be an issue, but until that happens, you can easily fix it yourself by doing the following:

  1. Open Alfred Preferences and go to "Workflows" in the left nav menu

  2. Select the "LastPass CLI" workflow

  3. Double click the top workflow step that says /usr/bin/osascript to open the script editor

  4. Go to the end of the file and change the second to last line from this:

    tell application "Alfred 3" to search "lp "

    To this:

    tell application id "com.runningwithcrayons.Alfred" to search "lp "
  5. Press the "Save" button

  6. Trigger the lplogin workflow again (make sure that you've set your account email with lpsetemail [email protected] first!)

Everything should work as expected from now on 👍

Thanks goes out to @juandaco and @sublime392 for pointing me in the right direction with the fix!

@wcj3
Copy link

wcj3 commented Oct 26, 2019

@squatto Not sure what OS you're using but the steps above didn't work for me on macOS catalina

@diegosantamarta
Copy link
Author

@squatto doesn't work for me:

Starting debug for 'LastPass CLI'

[2019-11-12 13:01:43][ERROR: action.script] 2812:2858: syntax error: No puede obtenerse application id "com.runningwithcrayons.Alfred". (-1728)

@squatto
Copy link

squatto commented Nov 12, 2019

@wcj3 @diegosantamarta I'm on Catalina now but I implemented that fix prior to upgrading. It's still working on Catalina - I'll check my workflow and see if anything has changed.

@squatto
Copy link

squatto commented Nov 12, 2019

@wcj3 @diegosantamarta

I enabled debug on the workflow and ran lp test and had this output:

[09:11:06.968] LastPass CLI[Script Filter] Queuing argument 'test'
[09:11:07.140] LastPass CLI[Script Filter] Script with argv '(null)' finished
[09:11:07.145] ERROR: LastPass CLI[Script Filter] Code 1: <?xml version="1.0"?>
<items>
<item uid="error-login"><arg>scriptlocationnotset</arg><title>It appears you are not logged in to LastPass.</title><subtitle>Please login using the 'lplogin' command or press 'ctrl' + enter to login now.</subtitle><icon>icon.png</icon></item>
</items>

I pressed ctrl+enter to trigger lplogin and had this debug output:

[09:11:22.413] LastPass CLI[Script Filter] Processing complete
[09:11:22.415] LastPass CLI[Script Filter] Passing output 'scriptlocationnotset' to Run Script

The lplogin process ran, asked me for my master password, and I am now logged in and able to search my vault. The second to last line of the osascript workflow step (what I referred to in my initial comment) is the same as it was in that same comment:

tell application id "com.runningwithcrayons.Alfred" to search "lp "

I verified the bundle ID of my Alfred application, just to be sure:

$ mdls -name kMDItemCFBundleIdentifier -r "/Applications/Alfred 4.app"
com.runningwithcrayons.Alfred

Try running this command to make sure that your Alfred bundle ID matches - if not, change the updated osascript command to match your bundle ID.


If you want to manually trigger the osascript line that my comment instructed you to change, you can do so from your terminal:

osascript -e 'tell application id "com.runningwithcrayons.Alfred" to search "lp "'

It should open up the Alfred workflow prompt with "lp " entered:

image


I am running the latest version of the workflow (version 1.7.4), macOS Catalina 10.15.1, on a 2018 MacBook Pro.


I put my entire /usr/bin/osascript workflow step's code into this gist if you want to review it and compare it against your version.

@diegosantamarta
Copy link
Author

Hi @squatto I tell you my steps:
I enabled debug on the workflow and ran lp test and had this output:

[13:39:16.222] LastPass CLI[Script Filter] Queuing argument 'test'
[13:39:16.485] LastPass CLI[Script Filter] Script with argv '(null)' finished
[13:39:16.490] ERROR: LastPass CLI[Script Filter] Code 1: <?xml version="1.0"?>
<items>
<item uid="error-login"><arg>'error-login', ''</arg><title>It appears you are not logged in to LastPass.</title><subtitle>Please login using the 'lplogin' command or press 'ctrl' + enter to login now.</subtitle><icon>icon.png</icon></item>
</items>

I pressed ctrl+enter to trigger lplogin and had this debug output:

[13:39:50.956] LastPass CLI[Script Filter] Processing complete
[13:39:50.957] LastPass CLI[Script Filter] Passing output ''error-login', ''' to Run Script

The lplogin process ran, asked me for my master password, and I am not logged in.

image

Not workin...

I'm with Alfred 4 workflow 1.7.4 macOS High Sierra on a 10.13.6 iMac

@carceneaux
Copy link

@diegosantamarta Please make sure read @squatto's comment in full as he provides all the information you need to resolve this issue.

@wcj3 Like @squatto, I'm also running the latest version of the workflow (version 1.7.4), macOS Catalina 10.15.1, but on a 2019 MacBook Pro.

@wcj3
Copy link

wcj3 commented Nov 15, 2019

@carceneaux @squatto Running the debug helped, was not aware of that. Turns out I just needed to follow the installation steps again in addition to the fix mentioned here

@squatto
Copy link

squatto commented Nov 17, 2019

@wcj3 I’m glad that you were able to get it resolved!

@diegosantamarta are you able to log in by running the lplogin workflow command? If not, I would recommend deleting the workflow completely, installing it again, and making the change to the osascript step.

@glassdimly
Copy link

So I just got a new mac, and lastpass cli wasn't working! Dammit! So I started googling, and then I found that I had submitted a PR. Hah. But there was an additional step, which I had to read through this thread to figure out again.

Here are my instructions to make this work for you or for future me:

Check out my forked repository, then the branch with the fix on it.

git clone https://github.com/glassdimly/lastpass-alfred-workflow.git
git checkout fix/you-are-not-logged-in

Install by double-clicking the .workflow file.

Then make a modification to the lplogin osascript
image

At the end of this file, replace Alfred 3 with Alfred 4, so it looks like this:
image

Save, and now it will work.

@tonykaram1993
Copy link

tonykaram1993 commented Jan 5, 2020

@glassdimly Your post helped me fix the issue. In my case all I had to was change "Aflred 3" to "Alfred 4" and it all worked, did not need to anything else. I had tried to use @squatto 's fix here but it didn't work, yours did.

Cheers!

@nathankoerschner
Copy link

@glassdimly Same success, #56 didn't work buy yours did! Thanks.

@nathankoerschner
Copy link

Just got a new Mac, and the fix isnt working for me anymore. Whats new in this case is that when typing out lp <query> the option to search vault for does not persist, and just gives my default Alfred search options. Any ideas @glassdimly ?

@ysjiang4869
Copy link

For me, there is two problem

  1. This is my new mac, so I need to verify device through email, but I forget the email notification
  2. I open the 2FA, so need to verify it, if your debug console show something like ctrl+c to enter passcode you better to open 2FA and enable or use cli to login by yourself.

@Latent-code
Copy link

@juandaco Nevermind, I installed the workflow wrong. Works like a charm now

What did you do to fix that issue? Im still getting the following error:
ERROR: LastPass CLI[Run Script] 2637:2649: execution error: The variable lpass_binary is not defined. (-2753)

I have changed from Alfred 3 to Alfred 4.

@mikeohara
Copy link

mikeohara commented Apr 28, 2022

@Latent-code The fix I found involved editing the osascript and adding

else if exists POSIX file "/opt/homebrew/bin/lpass" then
set lpass_binary to "/opt/homebrew/bin/lpass"

in the tell application Finder block near the bottom of the file. Seems in newer versions of brew installs to a different location.

@jzadra
Copy link

jzadra commented May 3, 2022

This fixed it for me! Alfred 4.6.5

@Latent-code The fix I found involved editing the osascript and adding

else if exists POSIX file "/opt/homebrew/bin/lpass" then
set lpass_binary to "/opt/homebrew/bin/lpass"

in the tell application Finder block near the bottom of the file. Seems in newer versions of brew installs to a different location.

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