Skip to content
This repository has been archived by the owner on Jun 17, 2022. It is now read-only.

1Password 1pux importer: Cannot read properties of undefined (reading 'passwordHistory') #820

Closed
dvdhrm opened this issue May 27, 2022 · 3 comments

Comments

@dvdhrm
Copy link

dvdhrm commented May 27, 2022

Hi

Neither the webinterface nor the bitwarden-cli (1.22.1) can import my 1password 1pux file. The webinterface shows nothing, but on the CLI I get:

$ bw --version
1.22.1

$ bw import --session "(stripped)" 1password1pux ./archive.1pux 
mac failed.
? Master password: [hidden]
Cannot read properties of undefined (reading 'passwordHistory')

If I strip all "Item" entries from the export.data file in the 1pux archive, I get:

$ bw import --session "(stripped)" 1password1pux ./archive.1pux 
mac failed.
? Master password: [hidden]
Nothing was imported.

So it seems that parsing of the item-array fails. The working dataset is:

{
  "accounts": [
    {
      "attrs": {
        "accountName": "Test",
        "name": "Test Name",
        "avatar": "something.png",
        "email": "someone@something.com",
        "uuid": "4TJHWIKKXHFG64BQ4ZCWAJ5UKI",
        "domain": "https://my.1password.com/"
      },
      "vaults": [
        {
          "attrs": {
            "uuid": "vc2fz65whw64rafhsz54pzxebm",
            "desc": "",
            "avatar": "something.png",
            "name": "Z+D",
            "type": "U"
          },
          "items": [
          ]
        }
      ]
    }
  ]
}

Once I add a single item back into the item-array, the original error occurs. Here is one simple example:

  "accounts": [
    {
      "attrs": {
        "accountName": "Test",
        "name": "Test Name",
        "avatar": "something.png",
        "email": "someone@something.com",
        "uuid": "4TJHWIKKXHFG64BQ4ZCWAJ5UKI",
        "domain": "https://my.1password.com/"
      },
      "vaults": [
        {
          "attrs": {
            "uuid": "vc2fz65whw64rafhsz54pzxebm",
            "desc": "",
            "avatar": "something.png",
            "name": "Z+D",
            "type": "U"
          },
          "items": [
            {
              "item": {
                "uuid": "mu7egdm4nmjm5odhausf6bqqo4",
                "favIndex": 0,
                "createdAt": 1540000000,
                "updatedAt": 1620000000,
                "trashed": false,
                "categoryUuid": "001",
                "details": {
                  "htmlForm": {
                    "htmlMethod": "LB1"
                  },
                  "loginFields": [
                    {
                      "value": "me@me.com",
                      "id": "login_email;opid=__0",
                      "name": "email",
                      "fieldType": "T",
                      "designation": "username"
                    },
                    {
                      "value": "somePassword",
                      "id": "login_pass;opid=__1",
                      "name": "pass",
                      "fieldType": "P",
                      "designation": "password"
                    }
                  ],
                  "sections": [],
                  "passwordHistory": []
                },
                "overview": {
                  "subtitle": "sub@title.com",
                  "urls": [
                    {
                      "label": "Sign-in Page",
                      "url": "https://foo.bar"
                    }
                  ],
                  "title": "Something",
                  "url": "https://foo.bar",
                  "ps": 0,
                  "pbe": 0.0,
                  "pgrng": false
                }
              }
            }
          ]
        }
      ]
    }
  ]
}

I tried digging into src/importers/onepasswordImporters/onepassword1PuxImporter.ts but I cannot seem to see any wrong accesses to passwordHistory, so I am unsure where exactly this originates.

Thanks
David

@djsmith85
Copy link
Contributor

Hi @dvdhrm,

It seems you are trying to import an older 1pux format. Please ensure to update 1password to atleast version 8.5 and then re-export the 1pux file.

Further information can be found here: https://bitwarden.com/help/import-from-1password/

Hope this helps.

@dvdhrm
Copy link
Author

dvdhrm commented May 27, 2022

What the... I used their official flatpak version, which appears to be 8.4, and thus loooong outdated. I am really sorry. I did not expect this to be unmaintained, yet advertised on their website.

Works all fine with 8.7.

@dvdhrm dvdhrm closed this as completed May 27, 2022
@djsmith85
Copy link
Contributor

@dvdhrm No worries, glad I could help and it now works as expected.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants