{"record":{"id":"4a87f5aead9d049c","repo":"ipfs/kubo","slug":"ipfs-configuration-file-already-exists-reinitiali","errorCode":null,"errorMessage":"ipfs configuration file already exists!\nReinitializing would overwrite your keys\n","messagePattern":"ipfs configuration file already exists!\nReinitializing would overwrite your keys\n","errorType":"exception","errorClass":"errors.New","httpStatus":null,"severity":"error","filePath":"cmd/ipfs/kubo/init.go","lineNumber":36,"sourceCode":"\tfsrepo \"github.com/ipfs/kubo/repo/fsrepo\"\n\n\t\"github.com/ipfs/boxo/files\"\n\tcmds \"github.com/ipfs/go-ipfs-cmds\"\n\tconfig \"github.com/ipfs/kubo/config\"\n\toptions \"github.com/ipfs/kubo/core/coreiface/options\"\n)\n\nconst (\n\talgorithmDefault    = options.Ed25519Key\n\talgorithmOptionName = \"algorithm\"\n\tbitsOptionName      = \"bits\"\n\temptyRepoDefault    = true\n\temptyRepoOptionName = \"empty-repo\"\n\tprofileOptionName   = \"profile\"\n)\n\n// nolint\nvar errRepoExists = errors.New(`ipfs configuration file already exists!\nReinitializing would overwrite your keys\n`)\n\nvar initCmd = &cmds.Command{\n\tHelptext: cmds.HelpText{\n\t\tTagline: \"Initializes ipfs config file.\",\n\t\tShortDescription: `\nInitializes ipfs configuration files and generates a new keypair.\n\nIf you are going to run IPFS in server environment, you may want to\ninitialize it using 'server' profile.\n\nFor the list of available profiles see 'ipfs config profile --help'\n\nipfs uses a repository in the local file system. By default, the repo is\nlocated at ~/.ipfs. To change the repo location, set the $IPFS_PATH\nenvironment variable:\n","sourceCodeStart":18,"sourceCodeEnd":54,"githubUrl":"https://github.com/ipfs/kubo/blob/329838acdfafae224582930457efe80aa217afc0/cmd/ipfs/kubo/init.go#L18-L54","documentation":"Sentinel error (errRepoExists) returned by the init command when fsrepo.IsInitialized finds an existing repo at the repo root. It is a safety guard: reinitializing would overwrite the node's identity keys, so 'ipfs init' refuses rather than destroying them.","triggerScenarios":"Thrown at cmd/ipfs/kubo/init.go:36 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Use the existing repo as-is","Move or delete the old repo directory (or set IPFS_PATH elsewhere) and re-run init","If a fresh identity is truly wanted, back up the old config first, then remove the repo"],"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"}