ipfs/kubo · error

ErrOldRepo

ErrOldRepo

Error message

ipfs repo found in old '~/.go-ipfs' location, please run migration tool.

What it means

Sentinel ErrOldRepo: no initialized repo was found at the given path, but a legacy repo does exist at the old '~/.go-ipfs' location. Kubo refuses to use it in place and directs the user to the migration tool.

Source

Thrown at repo/fsrepo/fsrepo.go:53

const LockFile = "repo.lock"

var log = logging.Logger("fsrepo")

// RepoVersion is the version number that we are currently expecting to see.
var RepoVersion = version.RepoVersion

var migrationInstructions = `See https://github.com/ipfs/fs-repo-migrations/blob/master/run.md
Sorry for the inconvenience. In the future, these will run automatically.`

var programTooLowMessage = `Your programs version (%d) is lower than your repos (%d).
Please update ipfs to a version that supports the existing repo, or run
a migration in reverse.

See https://github.com/ipfs/fs-repo-migrations/blob/master/run.md for details.`

var (
	ErrNoVersion     = errors.New("no version file found, please run 0-to-1 migration tool.\n" + migrationInstructions)
	ErrOldRepo       = errors.New("ipfs repo found in old '~/.go-ipfs' location, please run migration tool.\n" + migrationInstructions)
	ErrNeedMigration = errors.New("ipfs repo needs migration, please run migration tool.\n" + migrationInstructions)
)

type NoRepoError struct {
	Path string
}

var _ error = NoRepoError{}

func (err NoRepoError) Error() string {
	return fmt.Sprintf("no IPFS repo found in %s.\nplease run: 'ipfs init'", err.Path)
}

const (
	apiFile      = "api"
	gatewayFile  = "gateway"
	swarmKeyFile = "swarm.key"
)

View on GitHub (pinned to 329838acdf)

Solutions

  1. Run the fs-repo-migrations tool (https://github.com/ipfs/fs-repo-migrations/blob/master/run.md) to migrate the old repo
  2. Or move/rename the legacy directory to the new location and ensure its version is current
  3. Or start fresh with 'ipfs init' in the new location if the old data is not needed
Defensive patterns

Strategy: fallback

When it happens

Trigger: Thrown at repo/fsrepo/fsrepo.go:53 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of ipfs/kubo@329838acdf (2026-09-03). Data as JSON: /api/errors/359b151af0b7a75d. Report an issue: GitHub.