question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

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

See original GitHub issue
  • 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.

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:8 (8 by maintainers)

github_iconTop GitHub Comments

1reaction
lidelcommented, 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
1reaction
hacdiascommented, May 10, 2022

@lidel here’s a PR to add support for dag-json: https://github.com/ipfs/ipld-explorer-components/pull/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.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Using a custom repository with Apache Ivy, no resolver found
This resolver is incredibly clever, demonstrates the true power of ivy, but the bulk of the world uses Maven repositories to host their...
Read more >
IPLD Codec Docs: DAG-JSON
DAG-JSON is a codec that implements the IPLD Data Model as JSON, plus some additional conventions for encoding links, which it does by...
Read more >
Kubo command-line - IPFS Docs
Online mode is when you have IPFS running separately as a daemon process. If you do not have an IPFS daemon running, you...
Read more >
parkydb - npm Package Health Analysis - Snyk
We found that parkydb demonstrates a positive version release cadence ... undefined) { throw new Error('Not found ' + id) } return model ......
Read more >
Kubo RPC API v0 reference - IPFS Docs
Default: dag-cbor . Required: no. input-codec [string]: Codec that the input object is encoded in. Default: dag-json . Required: no ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found