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

Error: No resolver found for codec "dag-json" (and dag-cbor) #1923

Closed
Tracked by #1965
ben221199 opened this issue Apr 12, 2022 · 8 comments
Closed
Tracked by #1965

Error: No resolver found for codec "dag-json" (and dag-cbor) #1923

ben221199 opened this issue Apr 12, 2022 · 8 comments
Assignees
Labels
area/screen/explore Issues related to IPLS Explorer screen area/screen/files Issues related to Files screen kind/bug A bug in existing code (including security flaws) P1 High: Likely tackled by core team if no one steps up status/blocked Unable to be worked further until needs are met

Comments

@ben221199
Copy link

  • OS: Windows
  • Version of IPFS Desktop: 0.20.5

Describe the bug
Not all codecs supported by the IPFS command-line are supported by IPFS desktop. See screenshot. It only shows dag-json but also json and some other codecs show the same error.

When making a CID using ipfs dag put someData.json --store-codec=dag-json, I get a CIDv1. Strange enough, dag-json is not in the list of ipfs cid codecs, but supported by ipfs dag put. When copying the received CID to IPFS Desktop, I get error from the screenshot that there is no resolver found for the codec.

To Reproduce
Steps to reproduce the behavior:

  1. ipfs cid codecs
  2. notepad someData.json and add some JSON data
  3. ipfs dag put someData.json --store-codec=dag-json
  4. Copy the received CID to IPFS Desktop and inspect it.
  5. See error

Expected behavior
IPFS Desktop recognises that the CID is dag-json, so it should also view information about the content.

Screenshots
image

Additional context
None.

@ben221199 ben221199 added kind/bug A bug in existing code (including security flaws) need/triage Needs initial labeling and prioritization labels Apr 12, 2022
@ipfs ipfs deleted a comment from welcome bot Apr 12, 2022
@lidel lidel added the P1 High: Likely tackled by core team if no one steps up label Apr 12, 2022
@lidel
Copy link
Member

lidel commented Apr 12, 2022

Thank you for filling this.

@lidel lidel transferred this issue from ipfs/ipfs-desktop Apr 12, 2022
@ipfs ipfs deleted a comment from welcome bot Apr 12, 2022
@lidel
Copy link
Member

lidel commented Apr 12, 2022

@hacdias mind taking a look if we can add support for dag-json (and dag-cbor) CIDs?

@lidel lidel added area/screen/files Issues related to Files screen area/screen/explore Issues related to IPLS Explorer screen and removed need/triage Needs initial labeling and prioritization labels Apr 12, 2022
@lidel lidel changed the title Error: No resolver found for codec "dag-json" Error: No resolver found for codec "dag-json" (and dag-cbor) Apr 12, 2022
@lidel lidel moved this to 🥞 Todo in IPFS Shipyard Team Apr 12, 2022
@hacdias hacdias self-assigned this Apr 16, 2022
@hacdias
Copy link
Member

hacdias commented Apr 17, 2022

@lidel just before I tackle this, isn't the fact that IPLD Explorer still uses the old microformats packages a blocker? And updating that is, in turn, blocked by migrating Web UI to the newer IPFS JS HTTP API version? Because the @ipld/js-dag-json should be incompatible with the old versions.

Refs:

If so, I have to plan how to proceed forward because of my limited time weekly.

@lidel
Copy link
Member

lidel commented Apr 19, 2022

@hacdias

@hacdias
Copy link
Member

hacdias commented May 10, 2022

@lidel here's a PR to add support for dag-json: ipfs/ipld-explorer-components#319

dag-cbor is supposed to be working already. As you can see, I used this converter to make the new package be compatible with the old ipld. If there are other formats to be supported, or even if you want the old formats updated to the new packages, I can take care of that using the converter.

@lidel
Copy link
Member

lidel commented May 16, 2022

@hacdias that is a really nice way, was not expecting us to be this lucky 👍 🚀

Changes from your PR got released as – mind opening a PR against ipfs-webui that:

  1. bumps ipld-explorer-components to v2.3.0
  2. adds tests to test/e2e/explore.test.js that protect us against codec-related regressions
    • I think a simple test that
      • imports block with fixture data for tested codec (see list below + repo with potential fixtures to reuse)
      • opens Explore screen
      • enters CIDv1 with specific codec
      • confirms "CID INFO" section contains expected human-readable string or something similar?
        • e.g. for "apollo archives" dag-pb QmSnuWmxptJZdLJpKRarxBMS2Ju2oANVrgbr2xWbie9b2D we should expect base58btc - cidv0 - dag-pb - sha2-256~256~422896A1CE82A7B1CC0BA27C7D8DE2886C7DF95588473D5E88A28A9FCFA0E43E to be present on the screen – iiuc this is enough, because if codec is not supported, the screen will not have this section, but will show the red error as seen in the top comment here.

Some ideas how to make your work easier:

  • If you have any good test data, export it as block or CAR and import before running tests (so we don't require any networking, and tests work in offline mode)
  • Alternatively, use fixtures from https://github.com/ipld/codec-fixtures
    • These are raw blocks created by IPLD team for test purposes like this one, iiuc you should be able to ipfs.block.put them and and then read data using CIDv1
    • We only need one CID per codec:
      • dag-pb
      • dag-pb hamt-sharded
      • dag-cbor
      • dag-json
      • raw

@hacdias
Copy link
Member

hacdias commented May 19, 2022

@lidel so I've been trying to tackle that and I've been running into this two issues:

  1. We cannot use ipfs.dag.import on the tests because we don't have an enough updated version of the HTTP API (cc feat: import DAG CAR #1838)
  2. ipfs.dag.put is failing with HTTPError: Invalid byte while expecting start of value: 0xa2 which may be caused by mistach of go ipfs version and the HTTP client (see http-client dag.put failed with invalid byte js-ipfs#3914).

I have been trying to find a workaround, without success. Any suggestions?

@lidel lidel moved this to To do in IPFS-GUI (PL EngRes) Sep 1, 2022
@SgtPooki SgtPooki added the status/blocked Unable to be worked further until needs are met label Oct 10, 2022
@lidel
Copy link
Member

lidel commented Dec 6, 2022

This was fixed upstream, and works in the latest webui that shipped with Kubo 0.17

2022-12-06_01-31

JSON / CBOR saga continues in: ipfs/kubo#9335 (Kubo 0.18 will have JSON/CBOR support on Gateways too)

@lidel lidel closed this as completed Dec 6, 2022
Repository owner moved this from Needs Grooming to Done in IPFS-GUI (PL EngRes) Dec 6, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/screen/explore Issues related to IPLS Explorer screen area/screen/files Issues related to Files screen kind/bug A bug in existing code (including security flaws) P1 High: Likely tackled by core team if no one steps up status/blocked Unable to be worked further until needs are met
Projects
No open projects
Archived in project
Development

No branches or pull requests

4 participants