Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

repo migration failing when attempting to update to ipfs v0.4.16-rc1 #5191

Closed
lanzafame opened this issue Jul 5, 2018 · 13 comments · Fixed by #5194
Closed

repo migration failing when attempting to update to ipfs v0.4.16-rc1 #5191

lanzafame opened this issue Jul 5, 2018 · 13 comments · Fixed by #5194
Assignees
Labels
kind/bug A bug in existing code (including security flaws)

Comments

@lanzafame
Copy link
Contributor

Version information:

Current:
go-ipfs version: 0.4.15-
Repo version: 6
System version: amd64/darwin
Golang version: go1.10.2

attempting to update to:
go-ipfs version: 0.4.16-rc1
Repo version: 7
System version: amd64/darwin
Golang version: go1.10.2

Type:

Bug

Description:

Attempting to install go-ipfs v0.4.16-rc1 via the latest version of ipfs-update v1.5.3 and I am getting the following error. The ipfs daemon was not running whilst I ran ipfs update install v0.4.16-rc1.

$ ipfs update install v0.4.16-rc1                                                                                                                                                       
fetching go-ipfs version v0.4.16-rc1
binary downloaded, verifying...
success! tests all passed.
stashing old binary
installing new binary to /usr/local/bin/ipfs
checking if repo migration is needed...
  check complete, migration required.
fetching fs-repo-migrations version v1.4.0
running migration: '/var/folders/kh/zhltnfr93bq3tl5n11vj3s680000gn/T/ipfs-update-migrate487519237/fs-repo-migrations -to 7 -y'
Found fs-repo version 6 at /Users/lanzafame/.ipfs
===> Running migration 6 to 7...
applying 6-to-7 repo migration
ipfs migration:  migration 6 to 7 failed: cannot acquire lock: Lock FcntlFlock of /Users/lanzafame/.ipfs/repo.lock failed: resource temporarily unavailable
ERROR: Migration Failed:  migration failed: exit status 1
install failed, reverting changes...
ERROR: migration failed: exit status 1
Error: exit status 1

Not sure if this is related to #5179 or fs-repo-migrations.

@Stebalien
Copy link
Member

I can confirm. Manually running ipfs-update works (what I've been doing) but the ipfs update command doesn't.

@Stebalien Stebalien reopened this Jul 5, 2018
@Stebalien Stebalien added the kind/bug A bug in existing code (including security flaws) label Jul 5, 2018
@Stebalien
Copy link
Member

I believe this may have been broken in the original commands lib update but never noticed. Updating from v0.4.10 to v0.5.15 fails with the same error.

@Stebalien
Copy link
Member

Basically, we're now opening the repo every time we run every command.

@magik6k
Copy link
Member

magik6k commented Jul 5, 2018

Should be fixable by adding the command to https://github.com/ipfs/go-ipfs/blob/master/cmd/ipfs/ipfs.go#L89

@Stebalien
Copy link
Member

A quick inspection indicates that that won't be sufficient.

However, I'm not sure how this has ever worked properly. Looking at the ExternalBinary code, it always calls GetNode() (which should lock construct a node and lock the repo).

@Stebalien
Copy link
Member

Yeah... this has been a bug since at least 0.4.6. Upgrading 0.4.6 - 0.4.11 fails.

Stebalien added a commit that referenced this issue Jul 5, 2018
This breaks commands like `ipfs update` that expect IPFS to *not* be running.

fixes #5191

License: MIT
Signed-off-by: Steven Allen <steven@stebalien.com>
@ghost ghost assigned Stebalien Jul 5, 2018
@ghost ghost added the status/in-progress In progress label Jul 5, 2018
Stebalien added a commit that referenced this issue Jul 5, 2018
This breaks commands like `ipfs update` that expect IPFS to *not* be running.

fixes #5191

License: MIT
Signed-off-by: Steven Allen <steven@stebalien.com>
@Stebalien
Copy link
Member

@lanzafame by the way, thanks for finding this!

@ghost ghost removed the status/in-progress In progress label Jul 5, 2018
@lanzafame
Copy link
Contributor Author

@Stebalien no worries, thanks for fixing 👍

@Stebalien
Copy link
Member

So. Bad news. While this bug has been fixed, it's a bug in the current version of go-ipfs so the fix won't help users of go-ipfs 0.4.15 upgrading to 0.4.16.

@schomatis
Copy link
Contributor

So. Bad news. While this bug has been fixed, it's a bug in the current version of go-ipfs so the fix won't help users of go-ipfs 0.4.15 upgrading to 0.4.16.

I'll reopen this issue as the bug still manifests itself to go-ipfs users (ipfs/fs-repo-migrations#79).

@schomatis schomatis reopened this Aug 20, 2018
@Stebalien
Copy link
Member

Unfortunately, there isn't really anything we can do as it's a bug in shipped code. I guess we could have done an intermediate release that fixed the bug without the migration but we didn't want to delay the migration as it fixed a burning IPNS issue.

@TonyGranato
Copy link

Dear all,

any news on that issue. it still does not work, even manually...:

sh-3.2# ipfs-update install v0.4.17
fetching go-ipfs version v0.4.17
binary downloaded, verifying...
success! tests all passed.
stashing old binary
installing new binary to /usr/local/bin/ipfs
checking if repo migration is needed...
check complete, migration required.
fetching fs-repo-migrations version v1.4.0
running migration: '/tmp/ipfs-update-migrate196980155/fs-repo-migrations -to 7 -y'
Found fs-repo version 6 at /var/root/.ipfs
===> Running migration 6 to 7...
applying 6-to-7 repo migration
ipfs migration: migration 6 to 7 failed: cannot acquire lock: Lock FcntlFlock of /var/root/.ipfs/repo.lock failed: resource temporarily unavailable
ERROR: Migration Failed: migration failed: exit status 1
install failed, reverting changes...
ERROR: migration failed: exit status 1

@Stebalien
Copy link
Member

A bit late but make sure you're mot running IPFS in another process.

(closing as we're not going to be able to do anything about this issue other than field support requests)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug A bug in existing code (including security flaws)
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants