1Password / solutions

Examples and templates from the 1Password Solutions team
MIT License
101 stars 14 forks source link

lastpass-vault-item-import.py fails to create items and op give `unable to list item categories` error #22

Closed scottisloud closed 1 year ago

scottisloud commented 1 year ago

Problem

  1. Script fails to import some items after certain point - likely special characters in extra field. Likely related to #21
  2. unable to build a list of item categories error from op during import. Customer experienced that error and was then unable to log into 1Password, perhaps due to rate limiting.

Expected behaviour

Import script should import all items that are not secure notes.

Actual Behaviour

The script fails to import all exported data.

Additional details

Report from customer:

the script lastpass-vault-item-import.py worked for my export (13 items), but ran into issues when trying to import the export.csv from [other] account (460 items, most of which are shared folder lastpass credentials). It seems to have processed some of the export file, but then produced the below message 223 times:

[ERROR] 2023/01/11 01:08:29 Unable to build a list of item categories.

I'm going to venture to guess that it ran into issues with the "extra" column data which has some special characters in some of our shared secrets.

Interestingly while the error message was being thrown at me in the terminal, I was unable to login to the 1password portal and it returned an httpd status code 429 (too many requests). So the python script seems to have hammered on the API and gotten itself blocked/rate limited. Now that the errors have stopped, when I login to the portal and check "all items" I'm seeing 114 items. So it imported something, but not everything. And it didn't create any vaults. :-(

and

I did now see that it created a vault called "0" and tagged the secrets with "0" and there are 100 items in that vault. Is that the expected behavior?

This is probably several, distinct, issues.

scottisloud commented 1 year ago

Was unable to reproduce any issues associated with a non-delimiting comma since merging #23. That alone may not be the case.

The unable to build a list of item categories may result from either a session timing out (e.g., if op is unlocked and idle too long before running the script`, or perhaps due to rate limiting. Further investigation required to see what size of import might lead to rate limiting.

Will continue to explore both issues as time permits.

scottisloud commented 1 year ago

Possibilities:

More investigation needed but I am thinking this may be an environment-specific edge-case, or something else that's really in the margins.

scottisloud commented 1 year ago

At this point I have seen no further reports of this issue and cannot reproduce. Closing.

scottisloud commented 1 year ago

A second report (internal number: 103457) of this has come in. Re-opening but still no repro steps.

scottisloud commented 1 year ago

Closing as this script now serves mostly as an example for what's possible and has been largely rendered redundant by the importer built into 1Password.