{"record":{"id":"ff9bcc074ed19201","repo":"ipfs/kubo","slug":"fast-provide-w","errorCode":null,"errorMessage":"fast-provide: %w","messagePattern":"fast-provide: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"core/commands/cmdenv/env.go","lineNumber":172,"sourceCode":"\t}\n\n\t// Check if strategy allows providing this content\n\tstrategyStr := cfg.Provide.Strategy.WithDefault(config.DefaultProvideStrategy)\n\tstrategy := config.MustParseProvideStrategy(strategyStr)\n\tshouldProvide := config.ShouldProvideForStrategy(strategy, isPinned, isPinnedRoot, isMFS)\n\n\tif !shouldProvide {\n\t\tlog.Debugw(\"fast-provide-root: skipped\", \"reason\", \"strategy does not match content\", \"strategy\", strategyStr, \"pinned\", isPinned, \"pinnedRoot\", isPinnedRoot, \"mfs\", isMFS)\n\t\treturn nil\n\t}\n\n\t// Execute provide operation\n\tif wait {\n\t\t// Synchronous mode: block until provide completes, return error on failure\n\t\tlog.Debugw(\"fast-provide-root: providing synchronously\", \"cid\", rootCid)\n\t\tif err := provideCIDSync(ctx, ipfsNode.DHTClient, rootCid); err != nil {\n\t\t\tlog.Warnw(\"fast-provide-root: sync provide failed\", \"cid\", rootCid, \"error\", err)\n\t\t\treturn fmt.Errorf(\"fast-provide: %w\", err)\n\t\t}\n\t\tlog.Debugw(\"fast-provide-root: sync provide completed\", \"cid\", rootCid)\n\t\treturn nil\n\t}\n\n\t// Asynchronous mode (default): fire-and-forget, don't block, always return nil.\n\t// Parent off the node's lifetime context (not context.Background) so the\n\t// goroutine cancels on daemon shutdown instead of potentially outliving\n\t// the node and touching a closed DHT client. The timeout still bounds\n\t// stuck DHT operations.\n\tlog.Debugw(\"fast-provide-root: providing asynchronously\", \"cid\", rootCid)\n\tgo func() {\n\t\tctx, cancel := context.WithTimeout(ipfsNode.Context(), config.DefaultFastProvideTimeout)\n\t\tdefer cancel()\n\t\tif err := provideCIDSync(ctx, ipfsNode.DHTClient, rootCid); err != nil {\n\t\t\tlog.Warnw(\"fast-provide-root: async provide failed\", \"cid\", rootCid, \"error\", err)\n\t\t} else {\n\t\t\tlog.Debugw(\"fast-provide-root: async provide completed\", \"cid\", rootCid)","sourceCodeStart":154,"sourceCodeEnd":190,"githubUrl":"https://github.com/ipfs/kubo/blob/329838acdfafae224582930457efe80aa217afc0/core/commands/cmdenv/env.go#L154-L190","documentation":"ExecuteFastProvideRoot wraps a failure from the synchronous DHT provide of a root CID. When the 'wait' mode is selected, provideCIDSync blocks until the DHT client announces the CID; any underlying error (no DHT client, RPC failure, timeout) is wrapped as 'fast-provide: %w'. In async mode errors are only logged, so this error only surfaces from sync runs.","triggerScenarios":"Running `ipfs pin add` / pinning with Provide.Strategy causing a fast-provide and --provide-wait (sync) when the DHT provide RPC fails: node offline, no bootstrap/DHT peers, provide worker error, or nil DHTClient.","commonSituations":"Nodes behind restrictive NAT/firewalls with no reachable DHT; Provide.Enabled or routing misconfiguration; tests without bootstrap peers trying sync provide.","solutions":["Inspect the wrapped cause (%w) — fix the underlying DHT/routing error first","Ensure the daemon has DHT/routing reachable (bootstrap peers, Swarm connectivity)","Check Provide.Strategy / Provide.Enabled config if fast-provide shouldn't run","Use async mode (omit wait) if blocking on provide is not required; failures then log as warnings"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":"// pre-check: node routing reachable\nif cfg.Provide.Enabled == false {\n    // skip fast-provide entirely\n}","typeGuard":null,"tryCatchPattern":"err := cmdenv.ExecuteFastProvideRoot(ctx, node, rootCid, true)\nif err != nil {\n    var cause error\n    errors.As(err, &cause) // unwrap 'fast-provide: %w' to see the DHT error\n    log.Warnf(\"sync provide failed: %v\", cause)\n}","preventionTips":["Verify bootstrap/DHT connectivity before sync provide","Prefer async mode unless the announcement must complete before continuing","Keep Provide.Strategy and Provide.Enabled config intentional and documented"],"tags":["network","dht","provide","pinning"],"backgroundTag":"dht-provide-failed","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"}