{"record":{"id":"fde93b07efa6a570","repo":"ipfs/kubo","slug":"datastore-configuration-of-s-does-not-match-wha","errorCode":null,"errorMessage":"datastore configuration of '%s' does not match what is on disk '%s'","messagePattern":"datastore configuration of '(.+?)' does not match what is on disk '(.+?)'","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"repo/fsrepo/fsrepo.go","lineNumber":509,"sourceCode":"\t} else if r.config.Datastore.Spec == nil {\n\t\treturn fmt.Errorf(\"required Datastore.Spec entry missing from config file\")\n\t}\n\tif r.config.Datastore.NoSync {\n\t\tlog.Warn(\"NoSync is now deprecated in favor of datastore specific settings. If you want to disable fsync on flatfs set 'sync' to false. See https://github.com/ipfs/kubo/blob/master/docs/datastores.md#flatfs.\")\n\t}\n\n\tdsc, err := AnyDatastoreConfig(r.config.Datastore.Spec)\n\tif err != nil {\n\t\treturn err\n\t}\n\tspec := dsc.DiskSpec()\n\n\toldSpec, err := r.readSpec()\n\tif err != nil {\n\t\treturn err\n\t}\n\tif oldSpec != spec.String() {\n\t\treturn fmt.Errorf(\"datastore configuration of '%s' does not match what is on disk '%s'\",\n\t\t\toldSpec, spec.String())\n\t}\n\n\td, err := dsc.Create(r.path)\n\tif err != nil {\n\t\treturn err\n\t}\n\tr.ds = d\n\n\t// Wrap it with metrics gathering\n\tprefix := \"ipfs.fsrepo.datastore\"\n\tr.ds = measure.New(prefix, r.ds)\n\n\treturn nil\n}\n\nfunc (r *FSRepo) readSpec() (string, error) {\n\tfn, err := config.Path(r.path, specFn)","sourceCodeStart":491,"sourceCodeEnd":527,"githubUrl":"https://github.com/ipfs/kubo/blob/329838acdfafae224582930457efe80aa217afc0/repo/fsrepo/fsrepo.go#L491-L527","documentation":"Repo open guard: the datastore spec derived from the config does not match the spec recorded on disk in the repo's _spec file. Kubo snapshots the spec at init time and refuses to open the repo against a differently-configured datastore, because on-disk layout (flatfs sharding etc.) must not silently change under an existing store.","triggerScenarios":"Thrown at repo/fsrepo/fsrepo.go:509 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Revert the Datastore.Spec change in the config back to what the repo was created with","Or re-init a new repo with the desired spec and re-import the content","To intentionally migrate datastore types, follow a documented migration (export/import of the blockstore), not a config edit"],"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"}