lastpass / lastpass-cli

LastPass command line interface tool
GNU General Public License v2.0
2.86k stars 290 forks source link

Sync=now does not sync to server #326

Open wolfem4n opened 7 years ago

wolfem4n commented 7 years ago

Hi there,

Trying to remove some sites from a shared folder. I have admin privileges to the shared folder and our LastPass enterprise account. After logging into LastPass via cli, I retrieve the unique ID of the site I want to delete, and run the command:

lpass rm --sync=now 1421751611354723636

The command finishes, and does not throw an error. The site appears to be gone from the local cache, however the site never disappears from the server. Running the lpass sync command afterwards results in the command hanging forever, and terminal has to be closed/re-opened. I am using the LastPass-cli through macOS, though I have replicated the issue on CentOS and Ubuntu.

Thanks. Mr. Wolfe

bcopeland commented 7 years ago

It is true, that, unlike what the docs say, lpass edit --sync=now doesn't actually sync after the edit. I think this sentence in the docs is wrong or the functionality was never implemented:

If 'now' is set, and the command makes a change, the change is synchronized before the command exits.

What it does do is sync the local cache with the server before doing anything else. So, as it exists today, you will really need to run lpass sync after making a change

On the other hand, lpass sync hanging is indicative of sync actually doing something. Most likely you either have a large queue of updates to sync or sync is backing off due to rate limiting. You can look in your ~/.lpass/upload-queue to see what is queued. If you don't care about anything queued and just want to make sync work again (i.e. ok to lose some work) then you can just blow that directory away.

mjbroekman commented 7 years ago

Any chance a 'verbose' or 'debug' option could be added to make sync report how many items are remaining in the upload-queue? That would certainly help identify if the hang is a result of connectivity issues or just a large volume of updates pending.