ipfs / ipfs-desktop

An unobtrusive and user-friendly desktop application for IPFS on Windows, Mac and Linux.
https://docs.ipfs.tech/install/ipfs-desktop/
MIT License
6.02k stars 864 forks source link

Error: private key in config does not match id #2821

Closed Karthikchary23 closed 5 months ago

Karthikchary23 commented 6 months ago

👉️ Please describe what you were doing when this error happened.

Specifications

Error


Error: Initializing daemon...
Kubo version: 0.28.0
Repo version: 15
System version: amd64/windows
Golang version: go1.22.2
2024-05-23T22:39:02.060 0530    ERROR   core    core/builder.go:158 constructing the node: could not build arguments for function "github.com/ipfs/kubo/core/node/libp2p".PstoreAddSelfKeys (github.com/ipfs/kubo@v0.28.0/core/node/libp2p/libp2p.go:39): failed to build crypto.PrivKey: received non-nil error from function "github.com/ipfs/kubo/core/node".Identity.PrivateKey.func3 (github.com/ipfs/kubo@v0.28.0/core/node/identity.go:18): private key in config does not match id: 12D3KooWQqRmvNSHpwbWQGkKHx9N8BoCcHPTD9Ur5oxWuyowiAjw != 12D3KooWEWiPAXRaWtHHRcuQjknakzxMZks4GdBUxWDfeEkPDoGP
Error: constructing the node (see log for full detail): private key in config does not match id: 12D3KooWQqRmvNSHpwbWQGkKHx9N8BoCcHPTD9Ur5oxWuyowiAjw != 12D3KooWEWiPAXRaWtHHRcuQjknakzxMZks4GdBUxWDfeEkPDoGP

    at errorTemplate (C:\Users\DELL\AppData\Local\Programs\IPFS Desktop\resources\app.asar\src\daemon\migration-prompt.js:78:49)
    at Object.loadWindow (C:\Users\DELL\AppData\Local\Programs\IPFS Desktop\resources\app.asar\src\daemon\migration-prompt.js:129:26)
    at startIpfsWithLogs (C:\Users\DELL\AppData\Local\Prog
welcome[bot] commented 6 months ago

Thank you for submitting your first issue to this repository! A maintainer will be here shortly to triage and review. In the meantime, please double-check that you have provided all the necessary information to make this process easy! Any information that can help save additional round trips is useful! We currently aim to give initial feedback within two business days. If this does not happen, feel free to leave a comment. Please keep an eye on how this issue will be labeled, as labels give an overview of priorities, assignments and additional actions requested by the maintainers:

Finally, remember to use https://discuss.ipfs.io if you just need general support.

lidel commented 5 months ago

@Karthikchary23 either you manually edited Kubo config file, or it got corrupted in your filesystem.

This made the Identity.PeerID no longer match the Identity.PrivKey in .ipfs/config.

A quick fix is to replace these two values with a new (consitent) identity.

You can generate it by moving .ipfs to different directory and starting Desktop app again. It will create fresh config in .ipfs/config. Copy Identity.PeerID Identity.PrivKey from this new profile, then shut down Desktop app, restore the old .ipfs directory, and start it again. It will have your data but will use fixed PeerID.

ps. If you need more support, open a thread in https://discuss.ipfs.tech/c/help/13