{"record":{"id":"1eb519c487ea6420","repo":"ipfs/kubo","slug":"key-with-name-s-doesn-t-exist","errorCode":null,"errorMessage":"key with name '%s' doesn't exist","messagePattern":"key with name '(.+?)' doesn't exist","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"core/commands/keystore.go","lineNumber":222,"sourceCode":"\t\tver, err := migrations.RepoVersion(cfgRoot)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\tif ver != fsrepo.RepoVersion {\n\t\t\treturn fmt.Errorf(\"key export expects repo version (%d) but found (%d)\", fsrepo.RepoVersion, ver)\n\t\t}\n\n\t\t// Export is read-only: safe to read it without acquiring repo lock\n\t\t// (this makes export work when ipfs daemon is already running)\n\t\tksp := filepath.Join(cfgRoot, \"keystore\")\n\t\tks, err := keystore.NewFSKeystore(ksp)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\n\t\tsk, err := ks.Get(name)\n\t\tif err != nil {\n\t\t\treturn fmt.Errorf(\"key with name '%s' doesn't exist\", name)\n\t\t}\n\n\t\texportFormat, _ := req.Options[keyFormatOptionName].(string)\n\t\tvar formattedKey []byte\n\t\tswitch exportFormat {\n\t\tcase keyFormatPemCleartextOption:\n\t\t\tstdKey, err := crypto.PrivKeyToStdKey(sk)\n\t\t\tif err != nil {\n\t\t\t\treturn fmt.Errorf(\"converting libp2p private key to std Go key: %w\", err)\n\t\t\t}\n\t\t\t// For some reason the ed25519.PrivateKey does not use pointer\n\t\t\t// receivers, so we need to convert it for MarshalPKCS8PrivateKey.\n\t\t\t// (We should probably change this upstream in PrivKeyToStdKey).\n\t\t\tif ed25519KeyPointer, ok := stdKey.(*ed25519.PrivateKey); ok {\n\t\t\t\tstdKey = *ed25519KeyPointer\n\t\t\t}\n\t\t\tif secpKey, ok := stdKey.(*crypto.Secp256k1PrivateKey); ok {\n\t\t\t\t// crypto/x509 does not support the secp256k1 curve","sourceCodeStart":204,"sourceCodeEnd":240,"githubUrl":"https://github.com/ipfs/kubo/blob/329838acdfafae224582930457efe80aa217afc0/core/commands/keystore.go#L204-L240","documentation":"Lookup failure in `ipfs key export`: the keystore on disk has no key file under the requested name. Note the implementation wraps any ks.Get error into this message, so it most often means the name is wrong or the key was never created, but a permissions or filesystem error reading the keystore can also surface as it.","triggerScenarios":"Thrown at core/commands/keystore.go:222 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Run ipfs key list to see existing key names and correct the typo","Create the key first with ipfs key gen or import it with ipfs key import","Check permissions on the <IPFS_PATH>/keystore directory if the key should exist"],"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"}