Skip to content

ipfs dag export --ignore-missing-blocks #10826

Closed

Description

@lidel

Checklist

  • My issue is specific & actionable.
  • I am not suggesting a protocol enhancement.
  • I have searched on the issue tracker for my issue.

Description

This is a feature request extracted from ipfs/ipfs-webui#2380 (comment)

WebUI users would like to have an ability to export/import MFS as a potentially partial CAR (without prefetching non-local blocks)

General idea

  • Kubo: add --ignore-missing-blocks to both dag import|export
    • this would allow for ipfs dag export --ignore-missing-blocks --offline $(ipfs files stat / | head -1) that would effectively do the same "local-only" DAG walk as Reprovider.Strategy=mfs and output blocks to a CAR
    • ipfs dag import would error if both --pin-roots and --ignore-missing-blocks are passed
  • Webui (tracked in Support import of partial CARs without prefetching the full DAG ipfs-webui#2380, here only for context)
    • Files → Import → From CAR in WebUI would have a checkboxes for controlling --pin-roots and --skip-missing-blocks before proceeding with import.
    • Files → Export CAR in WebUI would show modal which would allow user to do export via ipfs.dag.export and uncheck --ignore-missing-blocks --offline.

Activity

  1. added
    kind/enhancementA net-new feature or improvement to an existing feature
    help wantedSeeking public contribution on this issue
    P2Medium: Good to have, but can wait until someone steps up
    exp/intermediatePrior experience is likely helpful
    effort/daysEstimated to take multiple days, but less than a week
    on Jun 6, 2025
  2. ChayanDass commented on Feb 28, 2026

    @ChayanDass
    Contributor

    hi @lidel , I'd like to work on that

  3. lidel commented on Feb 28, 2026

    @lidel
    ContributorAuthor

    @ChayanDass sure, take a stab at it.

    fyi we have some prior art in ipfs files stat --help where --with-local flag will identify part of DAG that are in local repository.

    Instead of --ignore-missing-blocks a --local-only may be a better name for this.

  4. ChayanDass commented on Mar 6, 2026

    @ChayanDass
    Contributor
    If errors.Is(err, ipld.ErrNotFound{}) {
    		explicitOffline, _ := req.Options["offline"].(bool)
    		if explicitOffline {
    			err = fmt.Errorf("%s (currently offline, perhaps retry without the offline flag)", err)
    		} else {
    			node, envErr := cmdenv.GetNode(env)
    			if envErr == nil && !node.IsOnline {
    				err = fmt.Errorf("%s (currently offline, perhaps retry after attaching to the network)", err)
    			}
    		}
    
    

    I am getting an issue , like ipld.errnotfound not working as expected, while I tried with offline flag , it should give the error as currently offline , but still it end up with walk failed , I have tried with a broken dag export

  5. ChayanDass commented on Mar 6, 2026

    @ChayanDass
    Contributor

    Hi @lidel, I identified the issue. It seems go-car is wrapping the error using %s instead of %w, which prevents errors.Is() from correctly detecting ipld.ErrNotFound, leading to the unexpected behavior in that if block.

    I’ve opened a PR to address this here:
    ipld/go-car#658

    Could you please take a look when you have time?

  6. removed
    help wantedSeeking public contribution on this issue
    on Mar 8, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2Medium: Good to have, but can wait until someone steps upeffort/daysEstimated to take multiple days, but less than a weekexp/intermediatePrior experience is likely helpfulkind/enhancementA net-new feature or improvement to an existing feature

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions