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

bug: HTTPError: unrecognized key type: Ed25519 #143

Closed
SgtPooki opened this issue Feb 9, 2023 · 1 comment · Fixed by #145
Closed

bug: HTTPError: unrecognized key type: Ed25519 #143

SgtPooki opened this issue Feb 9, 2023 · 1 comment · Fixed by #145

Comments

@SgtPooki
Copy link
Member

SgtPooki commented Feb 9, 2023

Related to task being tracked in #56: #144

Note that I am getting this error as i'm trying to migrate webui to kubo-rpc-client

I have almost everything working, but when I run e2e tests, I'm getting the following failures in the ipns.test.js:

  1) explore.test.js:20:3 › Explore screen › should open arbitrary CID =============================

    Test timeout of 30000ms exceeded.

    page.waitForSelector: Target closed
    =========================== logs ===========================
    waiting for locator('text=Raw Block') to be visible
    ============================================================

      30 |     // await page.waitForSelector(`a[href="#/explore/${cid}"]`)
      31 |     // expect node type
    > 32 |     await page.waitForSelector('text=Raw Block')
         |                ^
      33 |     // expect cid details
      34 |     await page.waitForSelector('text=base32 - cidv1 - raw - sha2-256~256~46532C71D1B730E168548410DDBB4186A2C3C0659E915B19D47F373EC6C5174A')
      35 |   })

        at file:///Users/sgtpooki/code/work/protocol.ai/ipfs/webui/test/e2e/explore.test.js:32:16

    Pending operations:
      - page.waitForSelector at test/e2e/explore.test.js:32:16


  2) ipns.test.js:34:5 › IPNS publishing › Settings screen › should support adding new keys ========

    Test timeout of 30000ms exceeded.

    page.waitForSelector: Target closed
    =========================== logs ===========================
    waiting for locator('text=pet-name-e2e-ipns-test-1675975764917') to be visible
    ============================================================

      133 | async function waitForIPNSKeyList (ipfs, specificKey, page) {
      134 |   await page.waitForSelector('text=IPNS Publishing Keys')
    > 135 |   if (specificKey) await page.waitForSelector(`text=${specificKey}`)
          |                               ^
      136 |   for (const { id, name } of await ipfs.key.list()) {
      137 |     if (name.startsWith('rm-key-test-')) continue // avoid race with removal tests
      138 |     await page.waitForSelector(`text=${id}`)

        at waitForIPNSKeyList (file:///Users/sgtpooki/code/work/protocol.ai/ipfs/webui/test/e2e/ipns.test.js:135:31)
        at file:///Users/sgtpooki/code/work/protocol.ai/ipfs/webui/test/e2e/ipns.test.js:49:7

    Pending operations:
      - page.waitForSelector at test/e2e/ipns.test.js:135:31


  3) ipns.test.js:52:5 › IPNS publishing › Settings screen › should support removing keys ==========

    HTTPError: unrecognized key type: Ed25519

      53 |       // create key that we want to remove
      54 |       const rmKeyName = 'rm-key-test-' + new Date().getTime()
    > 55 |       const { id } = await ipfs.key.gen(rmKeyName)
         |                      ^
      56 |       await page.reload()
      57 |       // remove key via UI on Settings page
      58 |       await page.waitForSelector(`text=${rmKeyName}`)

        at Object.errorHandler [as handleError] (file:///Users/sgtpooki/code/work/protocol.ai/ipfs/webui/node_modules/kubo-rpc-client/src/lib/core.js:106:15)
        at Client.fetch (/Users/sgtpooki/code/work/protocol.ai/ipfs/webui/node_modules/kubo-rpc-client/node_modules/ipfs-utils/src/http.js:161:9)
        at Object.gen (file:///Users/sgtpooki/code/work/protocol.ai/ipfs/webui/node_modules/kubo-rpc-client/src/key/gen.js:15:17)
        at file:///Users/sgtpooki/code/work/protocol.ai/ipfs/webui/test/e2e/ipns.test.js:55:22

  4) ipns.test.js:85:5 › IPNS publishing › Files screen › should have functional "Publish to IPNS" context action

    HTTPError: unrecognized key type: Ed25519

      75 |       keyName = 'pet-name-e2e-ipns-test-' + new Date().getTime()
      76 |       ipfs = kuboRpcModule.create(process.env.IPFS_RPC_ADDR)
    > 77 |       await ipfs.key.gen(keyName)
         |       ^
      78 |       await page.goto('/#/files')
      79 |       await page.reload()
      80 |     })

        at Object.errorHandler [as handleError] (file:///Users/sgtpooki/code/work/protocol.ai/ipfs/webui/node_modules/kubo-rpc-client/src/lib/core.js:106:15)
        at Client.fetch (/Users/sgtpooki/code/work/protocol.ai/ipfs/webui/node_modules/kubo-rpc-client/node_modules/ipfs-utils/src/http.js:161:9)
        at Object.gen (file:///Users/sgtpooki/code/work/protocol.ai/ipfs/webui/node_modules/kubo-rpc-client/src/key/gen.js:15:17)
        at file:///Users/sgtpooki/code/work/protocol.ai/ipfs/webui/test/e2e/ipns.test.js:77:7


  4 failed
    explore.test.js:20:3 › Explore screen › should open arbitrary CID ==============================
    ipns.test.js:34:5 › IPNS publishing › Settings screen › should support adding new keys =========
    ipns.test.js:52:5 › IPNS publishing › Settings screen › should support removing keys ===========
    ipns.test.js:85:5 › IPNS publishing › Files screen › should have functional "Publish to IPNS" context action
@SgtPooki
Copy link
Member Author

SgtPooki commented Feb 9, 2023

all tests are successful when using the proper casing:

> cross-env REACT_APP_ENV=test npx playwright test -c ./test/e2e "test/e2e/ipns.test.js"


Running 4 tests using 4 workers

[WebServer] (node:55312) [DEP0066] DeprecationWarning: OutgoingMessage.prototype._headers is deprecated
(Use `node --trace-deprecation ...` to show where the warning was created)
  ✓  1 ipns.test.js:85:5 › IPNS publishing › Files screen › should have functional "Publish to IPNS" context action (3.7s)
  ✓  2 ipns.test.js:52:5 › IPNS publishing › Settings screen › should support removing keys (3.5s)
  ✓  3 ipns.test.js:34:5 › IPNS publishing › Settings screen › should support adding new keys (3.2s)
  ✓  4 ipns.test.js:29:5 › IPNS publishing › Settings screen › should list IPNS keys (2.7s)
name:  pet-name-e2e-ipns-test-1675981078960
options:  { type: 'ed25519' }
name:  rm-key-test-1675981079455
options:  { type: 'ed25519' }

SgtPooki added a commit to ipfs/ipfs-webui that referenced this issue Feb 10, 2023
SgtPooki added a commit to ipfs/ipfs-webui that referenced this issue Feb 10, 2023
SgtPooki added a commit to ipfs/ipfs-webui that referenced this issue Mar 13, 2023
* feat!: ipfs-http-client -> kubo-rpc-client

fix: error rendering peerId

fix: peers table on peerspage

fix: statusPage -> advanced -> addresses

fix: most e2e tests working with kubo-rpc-client

chore: update to go-ipfsv0.18.1

* chore: fix key.gen with patch

needed until kubo-rpc-client fix is merged

see ipfs/js-kubo-rpc-client#143
see ipfs/js-kubo-rpc-client#145

* fix: use ipld-explorer-components patch temporarily

see #2079
see #2079 (comment)

must use until ipfs/ipld-explorer-components#356

* chore: fix ipld-explorer-components patch

not needed once ipfs/ipld-explorer-components#356 is merged

* test: add tests to explore.test.js

* tmp: trying to navigate the undocumented world of parsing CIDs

* chore: working on getting tests fully tied up

* test(e2e): finish updating explore.test.js

* chore: lint fixes

* chore: remove debugging code

* test: test clicking children links on explore page

* tmp: fix children explore views

* test: e2e explore test traverses children

* Update test/e2e/explore.test.js

Co-authored-by: Nishant Arora <[email protected]>

* chore: address PR comments

---------

Co-authored-by: Nishant Arora <[email protected]>
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

Successfully merging a pull request may close this issue.

1 participant