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

go-ipfs repo migration from 0.7.0 to 0.9.0-rc1 is broken #15937

Closed
Tracked by #17112
lidel opened this issue May 18, 2021 · 1 comment · Fixed by brave/brave-core-crx-packager#224 or brave/brave-core#8892
Closed
Tracked by #17112

Comments

@lidel
Copy link

lidel commented May 18, 2021

@spylogsster I took your advice and swapped the binary and found a bug.

Description

IPFS node fails to start if I swap go-ipfs_v0.7.0_linux-amd64 binary and replace it with 0.9.0-rc1 (ipfs/kubo#8058), which suggests it is not safe to update go-ipfs component without additional work.

Steps to Reproduce

  1. Start Brave Nightly v1.26.22
  2. Activate local IPFS node by opening ipns://en.wikipedia-on-ipfs.org
  3. Shut down the node
  4. Locate go-ipfs binary in the browser profile (on linux it is go-ipfs_v0.7.0_linux-amd64)
  5. Download 0.9 RC1 from https://dist.ipfs.io/go-ipfs/v0.9.0-rc1, unpack it and replace go-ipfs binary in the browser profile
  6. Start browser again and try opening ipns://en.wikipedia-on-ipfs.org

Actual result:

  1. Node does not start
  2. Forcing start via brave://ipfs-internals/ produces two errors in log:
Error: ipfs repo needs migration
Error: ipfs repo needs migration

2021-05-18--15-48-51

Expected result:

Migration should be applied and ipns://en.wikipedia-on-ipfs.org should open correctly.

Reproduces how often:

Every time

Desktop Brave version:

Nightly v1.26.22

Miscellaneous Information:

The very first command executed against the repo should be ipfs daemon --migrate to ensure that subsequent commands operate on repo with compatible data layout

I manually run go-ipfs_v0.9.0-rc1_linux-amd64 daemon --migrate=true command and migration works as expected, which means Brave does something extra (as suggested by double error), or there is a race condition when repo is accessed before migrations starts/finish:

$ export IPFS_PATH=$BRAVE_PROFILE/brave_ipfs 
$ go-ipfs_v0.9.0-rc1_linux-amd64  daemon --migrate=true --enable-gc --routing=dhtclient
Initializing daemon...
go-ipfs version: 0.9.0-rc1
Repo version: 11
System version: amd64/linux
Golang version: go1.16.4
Found outdated fs-repo, migrations need to be run.
Looking for suitable migration binaries.
Need 1 migrations, downloading.
Downloading migration: fs-repo-10-to-11...
Fetching with HTTP: "https://ipfs.io/ipfs/QmVxxcTSuryJYdQJGcS8SyhzN7NBNLTqVPAxpu6gp2ZcrR/fs-repo-10-to-11/versions"
Fetching with HTTP: "https://ipfs.io/ipfs/QmVxxcTSuryJYdQJGcS8SyhzN7NBNLTqVPAxpu6gp2ZcrR/fs-repo-10-to-11/v1.0.0/fs-repo-10-to-11_v1.0.0_linux-amd64.tar.gz"
Downloaded and unpacked migration: /tmp/migrations074310918/fs-repo-10-to-11 (v1.0.0)
Running migration fs-repo-10-to-11 ...
  => Running: /tmp/migrations074310918/fs-repo-10-to-11 -path=/home/lidel/TODO/BRAVE-go-ipfs-7-to-9-test/brave_ipfs -verbose=true
applying 10-to-11 repo migration
opening datastore at "/home/lidel/TODO/BRAVE-go-ipfs-7-to-9-test/brave_ipfs"
upgrading pinning to use datastore
converted 2 pins from ipld storage into datastore
updated version file
Migration 10 to 11 succeeded
Success: fs-repo migrated to version 11.
[...]
Daemon is ready
^C
Received interrupt signal, shutting down...
(Hit ctrl-c again to force-shutdown the daemon.)
@stephendonner
Copy link

stephendonner commented Jun 23, 2021

Verified PASSED using

Brave 1.27.76 Chromium: 91.0.4472.114 (Official Build) dev (x86_64)
Revision 4bb19460e8d88c3446b360b0df8fd991fee49c0b-refs/branch-heads/4472@{#1496}
OS macOS Version 11.4 (Build 20F71)

Steps:

  1. new profile
  2. launch Brave
  3. load ipns://brantly.eth
  4. click on Use a local node
  5. confirm on brave://ipfs-internals that Version: under Node info is go-ipfs/0.7.0
  6. shut down Brave
  7. launch Brave with --use-dev-goupdater-url
  8. load brave://ipfs-internals and click on Restart
  9. confirm that Version: under Node info now reads go-ipfs/0.9.0-rc1/

In addition to Start, Stop, Restart, and My node, I confirmed the following worked:

Brave

brave://ipfs -> brave://ipfs-internals

brave://ipfs-internals (0.7.0) brave://ipfs-internals (0.9.0-rc1)
Screen Shot 2021-06-22 at 4 26 07 PM Screen Shot 2021-06-22 at 5 32 51 PM

My node

Screen Shot 2021-06-22 at 5 33 07 PM

Direct URIs

IPFS

  • ipfs://bafybeiemxf5abjwjbikoz4mc3a3dla6ual3jsgpdr4cjr3oz3evfyavhwq/wiki/Vincent_van_Gogh.html

  • ipfs://bafybeigdyrzt5sfp7udm7hu76uh7y26nf3efuylqabf3oclgtqy55fbzdi/

  • ipfs://QmXoypizjW3WknFiJnKLwHCnL72vedxjQkDDP1mXWo6uco/wiki/Tokyo_National_Museum.html

  • ipfs:QmYwAPJzv5CZsnA625s3Xf2nemtYgPpHdWEz79ojWnPbdG/readme

IPNS

  • ipns://brantly.eth
  • ipns://en.wikipedia-on-ipfs.org
  • ipns://libp2p.io/
  • ipns://en.wikipedia-on-ipfs.org/wiki/Tokyo_National_Museum.html
  • ipns://browsers.today
  • ipns://ipfs.io
  • http://en.wikipedia-on-ipfs.org.ipns.localhost:48082/wiki/ - Open using IPFS (badge in URL bar) -> ipns://en.wikipedia-on-ipfs.org/wiki/
http://en.wikipedia-on-ipfs.org.ipns.localhost:48082/wiki/ ipns://en.wikipedia-on-ipfs.org/wiki/
Screen Shot 2021-06-22 at 5 23 20 PM Screen Shot 2021-06-22 at 5 23 23 PM

Path gateway URL:

https://ipfs.io/ipfs/QmbWqxBEKC3P8tqsKc98xmWNzrzDtRLMiMPL8wBuTGsMnR

Subdomain links:

  • https://bafybeiemxf5abjwjbikoz4mc3a3dla6ual3jsgpdr4cjr3oz3evfyavhwq.ipfs.dweb.link/wiki/

  • https://bafybeiemxf5abjwjbikoz4mc3a3dla6ual3jsgpdr4cjr3oz3evfyavhwq.ipfs.cf-ipfs.com/wiki/Vincent_van_Gogh.html

Imports - context-menu items for selection

Import to IPFS -> Linked content

https://brave.com/brave-search-beta/

Import to IPFS -> This page

wikipedia.org

Import to IPFS -> Selected audio

https://file-examples-com.github.io/uploads/2017/11/file_example_OOG_5MG.ogg

Import to IPFS -> Selected image

https://homepages.cae.wisc.edu/~ece533/images/airplane.png

Import to IPFS -> Selected text

lipsum.com

Import to IPFS -> Selected video

https://upload.wikimedia.org/wikipedia/commons/c/c0/Big_Buck_Bunny_4K.webm

Linked content This page Selected audio Selected text Selected image Selected video
Screen Shot 2021-06-22 at 5 08 10 PM Screen Shot 2021-06-22 at 5 17 03 PM Screen Shot 2021-06-22 at 5 19 01 PM Screen Shot 2021-06-22 at 4 46 59 PM Screen Shot 2021-06-23 at 4 58 39 PM Screen Shot 2021-06-23 at 5 04 44 PM

Sharing - "hamburger" -> flyout, on browser toolbar

IPFS -> Share local file using IPFS

Big Buck Bunny: https://upload.wikimedia.org/wikipedia/commons/c/c0/Big_Buck_Bunny_4K.webm

Share link: https://ipfs.io/ipfs/QmWUg6PJubdKTXWp4KqjkkCidrD8LPoCnoGyYxSKG71fTs?filename=Big_Buck_Bunny_4K.webm

IPFS -> Share local folder using IPFS

Share link: https://ipfs.io/ipfs/Qmb7MgAK5kZNkiFSkScbF7dG9jGftwqKe9Ndw4oNGvaLep

local file shared using IPFS local folder shared using IPFS
Screen Shot 2021-06-22 at 5 21 10 PM Screen Shot 2021-06-22 at 5 21 25 PM

Verification passed on


Brave | 1.27.78 Chromium: 91.0.4472.114 (Official Build) beta (64-bit)
-- | --
Revision | 4bb19460e8d88c3446b360b0df8fd991fee49c0b-refs/branch-heads/4472@{#1496}
OS | Windows 10 OS Version 2004 (Build 19041.1052)

Brave

Confirmed Start, Stop, Restart, and My node worked as expected along with following

brave://ipfs -> brave://ipfs-internals

brave://ipfs-internals (0.7.0) brave://ipfs-internals (0.9.0-rc1)
image image

My node

image

IPNS

  • ipns://brantly.eth
  • ipns://en.wikipedia-on-ipfs.org
  • ipns://libp2p.io/
  • ipns://en.wikipedia-on-ipfs.org/wiki/Tokyo_National_Museum.html
  • ipns://browsers.today
  • ipns://ipfs.io
  • http://en.wikipedia-on-ipfs.org.ipns.localhost:48082/wiki/ - Open using IPFS (badge in URL bar) -> ipns://en.wikipedia-on-ipfs.org/wiki/
http://en.wikipedia-on-ipfs.org.ipns.localhost:48082/wiki/ ipns://en.wikipedia-on-ipfs.org/wiki/
image image

Imports - context-menu items for selection

Import to IPFS -> Linked content

https://brave.com/brave-search-beta/

Logged issue for linked content #16680

Import to IPFS -> This page

wikipedia.org
encountered #16680 (comment)

Import to IPFS -> Selected audio

https://file-examples-com.github.io/uploads/2017/11/file_example_OOG_5MG.ogg

Import to IPFS -> Selected image

https://homepages.cae.wisc.edu/~ece533/images/airplane.png

Import to IPFS -> Selected text

lipsum.com

Encountered #16680 (comment)

Import to IPFS -> Selected video

https://upload.wikimedia.org/wikipedia/commons/c/c0/Big_Buck_Bunny_4K.webm

Logged #16705

Selected audio Selected image Selected video Selected video video imports via import menu option
image image image image image

Sharing - "hamburger" -> flyout, on browser toolbar

IPFS -> Share local file using IPFS

Big Buck Bunny: https://upload.wikimedia.org/wikipedia/commons/c/c0/Big_Buck_Bunny_4K.webm

Share link: https://ipfs.io/ipfs/QmWUg6PJubdKTXWp4KqjkkCidrD8LPoCnoGyYxSKG71fTs?filename=Big_Buck_Bunny_4K.webm

IPFS -> Share local folder using IPFS

local file shared using IPFS local folder shared using IPFS
image image

.txt and .json files cannot be viewed in IPFS localhost Logged #16713

Verified PASSED using the testplan from brave/brave-core#8892 and here, on build

Brave 1.27.91 Chromium: 91.0.4472.124 (Official Build) beta (64-bit)
Revision 7345a6d1bfcaff81162a957e9b7d52649fe2ac38-refs/branch-heads/4472_114@{#6}
OS Linux
example example example
Screen Shot 2021-07-06 at 1 14 43 PM Screen Shot 2021-07-06 at 2 22 04 PM Screen Shot 2021-07-06 at 2 36 26 PM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment