Skip to content

Init check fails but version does exist (migrating 9 -> 10) #299

Closed
@v-stickykeys

Description

@v-stickykeys

Hello!

I'm trying to migrate a repo from v9 to v10. It uses s3 as a backend for ipfs-repo.

Before migration attempt

The repo clearly has version and config files.

λ cat version 
9

image

During migration attempt

The migration is failing and shows the following logs:

2021-04-08T11:36:27.731Z ipfs:repo opening at: ipfs
--
2021-04-08T11:36:28.234Z ipfs:repo init check
2021-04-08T11:36:28.459Z ipfs:repo acquired repo.lock
2021-04-08T11:36:28.713Z ipfs:repo:version comparing version: 9 and 10
2021-04-08T11:36:29.233Z ipfs:repo migrating to version 10

2021-04-08T11:36:29.787Z ipfs:repo:migrator:repo:init Version entry present: false # <---- WHY??
2021-04-08T11:36:29.787Z ipfs:repo:migrator:repo:init Config entry present: false # <---- WHY??

NotInitializedRepoError: Repo in path ipfs is not initialized!
at Object.getVersion (/ipfs-repo-migrations/src/repo/version.js:22:11)
at processTicksAndRejections (internal/process/task_queues.js:93:5)
at async Object.migrate (/ipfs-repo-migrations/src/index.js:67:26)
at async IpfsRepo.open (/ipfs-repo/src/index.js:120:11)
at async openRepo (/ipfs-core/src/components/storage.js:88:7)
at async loadRepo (/ipfs-core/src/components/storage.js:60:21)
at async Function.start (/ipfs-core/src/components/storage.js:44:41)
at async Object.create (/ipfs-core/src/components/index.js:208:21)
at async Function.create (/ipfs-daemon.js:65:22) {
code: 'ERR_NOT_INITIALIZED_REPO'
}

After migration attempt

The repo gets 2 new files which seem like they should not be there and version is still on 9
image


Could the issue be here?

async exists () { // eslint-disable-line require-await
// [email protected] cannot read keys from [email protected] dbs so fall back to
// using IndexedDB API with string keys - only necessary until we do
// the migratiion to v10 or above
return hasWithFallback(versionKey, store.has.bind(store), store)
},

Metadata

Metadata

Assignees

Labels

kind/bugA bug in existing code (including security flaws)status/in-progressIn progress

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions