3box / 3box-js

3Box JavaScript SDK: User identities, storage, messaging
MIT License
207 stars 65 forks source link

Should not throw "Key not found in database" exception #891

Open dkent600 opened 3 years ago

dkent600 commented 3 years ago

During this:

    box = await Box.create(web3Provider);

(or was it in auth, sorry I don't recall)

an exception is thrown:

generating 2048-bit RSA keypair... r {code: "ERR_NOT_FOUND", type: "NotFoundError", name: "NotFoundError", cause: Error: NotFound at n (https://alchemy-add3boxcomments-jjgmo6.herokuapp.com/vendors~app.bundle-5…, message: "Key not found in database [/AFYBEIHYNASMHHI4KRVTUROLXFP465JWOJ7OYRYFYUYOM6TQ4LGWFMMT7M]", …}

spaceName is "DAOstack" Using 3box@1.21.0 The web3provider is pointing at rinkeby.

zachferland commented 3 years ago

@dkent600 if switching between versions you may see this error, i would try clearing browser storage for your application and trying 1.21.0 again, but let me if you see it more regularly

dkent600 commented 3 years ago

Having to clear browser storage would be an issue for our users.

zachferland commented 3 years ago

yes of course, just saying if going between versions in development you may be more likely to see this

is version 1.20.x already deployed to your users?

dkent600 commented 3 years ago

actually, now that you mention it, our 1.20.* code hasn't gone out yet....

dkent600 commented 3 years ago

@zachferland I installed 1.21 and cleaned everything out and now in Box.create I get:

err {type: 'InitializationError', name: 'InitializationError', cause: undefined, message: 'Must provide a location for the database', stack: 'InitializationError: Must provide a location …/orbit-db-storage-adapter/src/index.js:49:17)'}

zachferland commented 3 years ago

@dkent600 have not been able to replicate yet, what browser do you see this in?

and can you run 'npm list levelup level-js orbit-db-storage-adapter' to see what versions of these dependencies you have?

dkent600 commented 3 years ago

Browser: Edge Chromium

 +-- 3box@1.21.0
| +-- 3box-shared-cache@1.1.0
| | +-- level-js@4.0.2 
| | +-- levelup@4.4.0
| | `-- orbit-db-storage-adapter@0.5.3  deduped
| +-- ipfs@0.46.1
| | `-- ipld-ethereum@4.0.2
| |   +-- ethereumjs-block@2.2.2
| |   | `-- merkle-patricia-tree@2.3.2
| |   |   `-- levelup@1.3.9  deduped
| |   `-- merkle-patricia-tree@3.0.0
| |     `-- level-mem@3.0.1
| |       `-- level-packager@4.0.1
| |         `-- levelup@3.1.1
| +-- levelup@4.4.0
| +-- orbit-db@0.24.2
| | +-- orbit-db-keystore@0.3.5
| | | `-- levelup@4.1.0
| | `-- orbit-db-storage-adapter@0.5.3  deduped
| `-- orbit-db-storage-adapter@0.5.3
|   `-- level@5.0.1
|     +-- level-js@4.0.2  deduped
|     `-- level-packager@5.1.1
|       `-- levelup@4.4.0
`-- @portis/web3@2.0.0-beta.59
  `-- @portis/web3-provider-engine@1.1.2
    `-- ethereumjs-block@1.7.1
      `-- merkle-patricia-tree@2.3.2
        `-- levelup@1.3.9
dkent600 commented 3 years ago

@zachferland Any updates on this? Thanks.

orenyodfat commented 3 years ago

hey @zachferland any update ? we are currently using 3box 1.22.2 and here is the dependency logs ├─┬ 3box@1.22.2 │ ├─┬ 3box-orbitdb-plugins@2.1.2 │ │ └─┬ orbit-db@0.24.2 │ │ └── orbit-db-storage-adapter@0.5.3 deduped │ ├─┬ 3box-shared-cache@1.1.0 │ │ ├── level-js@4.0.2 │ │ ├── levelup@4.4.0 │ │ └── orbit-db-storage-adapter@0.5.3 deduped │ ├─┬ ipfs@0.46.1 │ │ └─┬ ipld-ethereum@4.0.2 │ │ ├─┬ ethereumjs-block@2.2.2 │ │ │ └─┬ merkle-patricia-tree@2.3.2 │ │ │ └── levelup@1.3.9 deduped │ │ └─┬ merkle-patricia-tree@3.0.0 │ │ └─┬ level-mem@3.0.1 │ │ └─┬ level-packager@4.0.1 │ │ └── levelup@3.1.1 │ ├── levelup@4.4.0 │ ├─┬ orbit-db@0.25.3 │ │ ├─┬ orbit-db-keystore@0.3.5 │ │ │ └── levelup@4.1.0 │ │ └── orbit-db-storage-adapter@0.5.3 deduped │ └─┬ orbit-db-storage-adapter@0.5.3 │ └─┬ level@5.0.1 │ ├── level-js@4.0.2 deduped │ └─┬ level-packager@5.1.1 │ └── levelup@4.4.0 └─┬ @portis/web3@2.0.0-beta.59 └─┬ @portis/web3-provider-engine@1.1.2 └─┬ ethereumjs-block@1.7.1 └─┬ merkle-patricia-tree@2.3.2 └── levelup@1.3.9

we are seeing the "Must provide a location for the database',...error msg .. please assist . is there an option needed to be passed to openBox ? https://github.com/daostack/alchemy/blob/ab5bc39e3b5e8e551fdb59a007107424284102e1/src/actions/profilesActions.ts#L120