{"record":{"id":"9fd0266864874e0b","repo":"ipfs/kubo","slug":"s-implies-s-false-and-cannot-be-combined-wit","errorCode":null,"errorMessage":"--%s implies --%s=false and cannot be combined with --%s=true; please drop one of them","messagePattern":"--(.+?) implies --(.+?)=false and cannot be combined with --(.+?)=true; please drop one of them","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"core/commands/dag/import.go","lineNumber":64,"sourceCode":"\tapi, err = api.WithOptions(options.Api.Offline(true))\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tpinRootsVal, pinRootsSet := req.Options[pinRootsOptionName].(bool)\n\tlocalOnly, _ := req.Options[localOnlyOptionName].(bool)\n\n\t// --pin-roots defaults to true; the default is applied here (not via\n\t// .WithDefault) so we can tell apart \"user explicitly passed true\" from\n\t// \"no value provided\".\n\tdoPinRoots := true\n\tif pinRootsSet {\n\t\tdoPinRoots = pinRootsVal\n\t}\n\n\tif localOnly {\n\t\tif pinRootsSet && pinRootsVal {\n\t\t\treturn fmt.Errorf(\"--%s implies --%s=false and cannot be combined with --%s=true; please drop one of them\", localOnlyOptionName, pinRootsOptionName, pinRootsOptionName)\n\t\t}\n\t\t// --local-only implies --pin-roots=false: a partial CAR has no full DAG to pin.\n\t\tdoPinRoots = false\n\t}\n\tfastProvideRoot, fastProvideRootSet := req.Options[fastProvideRootOptionName].(bool)\n\tfastProvideDAG, fastProvideDAGSet := req.Options[fastProvideDAGOptionName].(bool)\n\tfastProvideWait, fastProvideWaitSet := req.Options[fastProvideWaitOptionName].(bool)\n\n\tfastProvideRoot = config.ResolveBoolFromConfig(fastProvideRoot, fastProvideRootSet, cfg.Import.FastProvideRoot, config.DefaultFastProvideRoot)\n\tfastProvideDAG = config.ResolveBoolFromConfig(fastProvideDAG, fastProvideDAGSet, cfg.Import.FastProvideDAG, config.DefaultFastProvideDAG)\n\tfastProvideWait = config.ResolveBoolFromConfig(fastProvideWait, fastProvideWaitSet, cfg.Import.FastProvideWait, config.DefaultFastProvideWait)\n\n\t// grab a pinlock ( which doubles as a GC lock ) so that regardless of the\n\t// size of the streamed-in cars nothing will disappear on us before we had\n\t// a chance to roots that may show up at the very end\n\t// This is especially important for use cases like dagger:\n\t//    ipfs dag import $( ... | ipfs-dagger --stdout=carfifos )\n\t//","sourceCodeStart":46,"sourceCodeEnd":82,"githubUrl":"https://github.com/ipfs/kubo/blob/329838acdfafae224582930457efe80aa217afc0/core/commands/dag/import.go#L46-L82","documentation":"`ipfs dag import --local-only` skips the network entirely, so a partial CAR cannot guarantee a complete DAG to pin; kubo therefore forces pin-roots off. If the caller explicitly sets --pin-roots=true together with --local-only, the command rejects the contradictory options with this error.","triggerScenarios":"Running `ipfs dag import --local-only --pin-roots=true carfile.car`. The error fires only when pin-roots is explicitly set true; an implicit default is fine because local-only silently implies pin-roots=false.","commonSituations":"Scripts combining offline import with pinning expectations; users assuming --pin-roots is required to keep imported data; copying flags from non-local import examples.","solutions":["Drop --pin-roots=true; --local-only already implies --pin-roots=false","Remove --local-only if you actually want the full DAG fetched and roots pinned","Pin explicitly later once the complete DAG is available (e.g. via `ipfs pin add`)"],"exampleFix":"// before\nipfs dag import --local-only --pin-roots=true data.car\n// after\nipfs dag import --local-only data.car","handlingStrategy":"validation","validationCode":"// reject conflicting flags before invoking the CLI\nif localOnly && pinRootsExplicitTrue {\n    return fmt.Errorf(\"--local-only cannot be combined with --pin-roots=true\")\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["When using --local-only, omit --pin-roots entirely","Pin explicitly afterwards if you need pins from offline imports","Review script flags when copying between online/offline import flows"],"tags":["cli","dag-import","flag-conflict","pinning"],"backgroundTag":"incompatible-cli-flags","analyzedSha":"329838acdfafae224582930457efe80aa217afc0","analyzedAt":"2026-09-03T18:30:52.135Z","contentChangedAt":"2026-09-03T18:30:52.135Z","schemaVersion":2},"datasetVersion":"2026-09-11T00:17:11.886Z"}