{"record":{"id":"5c81040aa896ba2f","repo":"ipfs/kubo","slug":"reached-limit-of-d-unflushed-mfs-operations-to-r","errorCode":null,"errorMessage":"reached limit of %d unflushed MFS operations. To resolve: 1) run 'ipfs files flush' to persist changes, 2) use --flush=true (default), or 3) increase Internal.MFSNoFlushLimit in config","messagePattern":"reached limit of (.+?) unflushed MFS operations\\. To resolve: 1\\) run 'ipfs files flush' to persist changes, 2\\) use --flush=true \\(default\\), or 3\\) increase Internal\\.MFSNoFlushLimit in config","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"core/commands/files.go","lineNumber":73,"sourceCode":"// updateNoFlushCounter manages the counter for unflushed operations\nfunc updateNoFlushCounter(nd *core.IpfsNode, flush bool) error {\n\tif flush {\n\t\t// Reset counter when flushing\n\t\tnoFlushOperationCounter.Store(0)\n\t\treturn nil\n\t}\n\n\t// Cache the limit on first use (config doesn't change at runtime)\n\tnoFlushLimitInit.Do(func() {\n\t\tnoFlushLimit = int64(config.DefaultMFSNoFlushLimit)\n\t\tif cfg, err := nd.Repo.Config(); err == nil && cfg.Internal.MFSNoFlushLimit != nil {\n\t\t\tnoFlushLimit = cfg.Internal.MFSNoFlushLimit.WithDefault(int64(config.DefaultMFSNoFlushLimit))\n\t\t}\n\t})\n\n\t// Check if limit reached\n\tif noFlushLimit > 0 && noFlushOperationCounter.Load() >= noFlushLimit {\n\t\treturn fmt.Errorf(\"reached limit of %d unflushed MFS operations. \"+\n\t\t\t\"To resolve: 1) run 'ipfs files flush' to persist changes, \"+\n\t\t\t\"2) use --flush=true (default), or \"+\n\t\t\t\"3) increase Internal.MFSNoFlushLimit in config\", noFlushLimit)\n\t}\n\n\tnoFlushOperationCounter.Add(1)\n\treturn nil\n}\n\n// mfsPinLock takes the pin lock, a shared read-lock on the blockstore GC\n// locker. A concurrent \"ipfs repo gc\" holds the exclusive GC lock, so while\n// this lock is held GC cannot run, and GC waits for it to be released. Hold it\n// across a whole MFS mutation (including its flush) so GC cannot collect blocks\n// the mutation has written to the blockstore before they are linked into the\n// persisted MFS root. This mirrors how \"ipfs add\" guards its writes.\nfunc mfsPinLock(nd *core.IpfsNode, ctx context.Context) bstore.Unlocker {\n\treturn nd.Blockstore.PinLock(ctx)\n}","sourceCodeStart":55,"sourceCodeEnd":91,"githubUrl":"https://github.com/ipfs/kubo/blob/329838acdfafae224582930457efe80aa217afc0/core/commands/files.go#L55-L91","documentation":"Error \"reached limit of %d unflushed MFS operations. To resolve: 1) run 'ipfs files flush' to persist changes, 2) use --flush=true (default), or 3) increase Internal.MFSNoFlushLimit in config\" thrown in ipfs/kubo.","triggerScenarios":"Thrown at core/commands/files.go:73 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Run 'ipfs files flush' to persist pending changes and reset the counter","Omit --flush=false so operations flush by default","Raise Internal.MFSNoFlushLimit in the config if the workload legitimately needs more unflushed operations"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"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"}