{"record":{"id":"ed8097c52c3dd77f","repo":"ipfs/kubo","slug":"creating-keystore-base-directory-w","errorCode":null,"errorMessage":"creating keystore base directory: %w","messagePattern":"creating keystore base directory: %w","errorType":"error_code","errorClass":null,"httpStatus":null,"severity":"error","filePath":"core/node/provider.go","lineNumber":640,"sourceCode":"\t\t}\n\n\t\t// Find the root datastore type (levelds, pebbleds, etc.)\n\t\trootSpec := findRootDatastoreSpec(repoCfg.Datastore.Spec)\n\n\t\t// Keystore datastores live at <repo>/{KeystoreDatastorePath}/<suffix>\n\t\tkeystoreBasePath := filepath.Join(repoPath, KeystoreDatastorePath)\n\n\t\tcreateDs := func(suffix string) (datastore.Batching, error) {\n\t\t\tif err := validateKeystoreSuffix(suffix); err != nil {\n\t\t\t\treturn nil, err\n\t\t\t}\n\t\t\t// In-memory datastore in no-schedule mode (keystore is inert)\n\t\t\t// or when no datastore spec is configured (test/mock repos).\n\t\t\tif noScheduleMode || rootSpec == nil {\n\t\t\t\treturn datastore.NewMapDatastore(), nil\n\t\t\t}\n\t\t\tif err := os.MkdirAll(keystoreBasePath, 0o755); err != nil {\n\t\t\t\treturn nil, fmt.Errorf(\"creating keystore base directory: %w\", err)\n\t\t\t}\n\t\t\tds, err := openDatastoreAt(rootSpec, filepath.Join(keystoreBasePath, suffix))\n\t\t\tif err != nil {\n\t\t\t\treturn nil, err\n\t\t\t}\n\t\t\tproviderLog.Infow(\"provider keystore: opened datastore\", \"suffix\", suffix, \"path\", filepath.Join(keystoreBasePath, suffix))\n\t\t\treturn ds, nil\n\t\t}\n\n\t\tdestroyDs := func(suffix string) error {\n\t\t\tif err := validateKeystoreSuffix(suffix); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t\tif noScheduleMode {\n\t\t\t\treturn nil\n\t\t\t}\n\t\t\tproviderLog.Infow(\"provider keystore: removing datastore from disk\", \"suffix\", suffix, \"path\", filepath.Join(keystoreBasePath, suffix))\n\t\t\treturn os.RemoveAll(filepath.Join(keystoreBasePath, suffix))","sourceCodeStart":622,"sourceCodeEnd":658,"githubUrl":"https://github.com/ipfs/kubo/blob/329838acdfafae224582930457efe80aa217afc0/core/node/provider.go#L622-L658","documentation":"Fired during provider/keystore construction when creating the base directory for the keystore datastores (<repo>/KeystoreDatastorePath, e.g. via os.MkdirAll) fails — typically due to filesystem permissions or a full disk. The wrapped error aborts node startup since the provider keystore cannot be set up.","triggerScenarios":"Thrown at core/node/provider.go:640 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Check permissions on the repo directory and free disk space","Verify the path is not read-only or a file","Fix the underlying filesystem issue and restart the daemon"],"exampleFix":null,"handlingStrategy":"retry","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"}