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

Occasionally, local ipfs node/daemon isn't restarted and running on browser restart #14816

Closed
stephendonner opened this issue Mar 18, 2021 · 2 comments

Comments

@stephendonner
Copy link

Description

Occasionally, local ipfs node/daemon isn't restarted and running on browser restart

Steps to Reproduce

  1. load ipfs://bafybeiemxf5abjwjbikoz4mc3a3dla6ual3jsgpdr4cjr3oz3evfyavhwq/wiki/Vincent_van_Gogh.html in a new profile
  2. click Use a local node on the interstitial page
  3. load ipns://en.wikipedia-on-ipfs.org in a new tab
  4. shut down Brave
  5. re-launch the browser
  6. wait for the reopened tabs to load
  7. repeat steps 4-6 until you see the error below
  8. load brave://ipfs-internals and look at the node status

Actual result:

At some point, you'll run into this Can't load resources using local node error; the daemon/local node isn't running, at this point

Screen Shot 2021-03-18 at 10 25 31 AM

Screen Shot 2021-03-18 at 10 12 15 AM

ipfs-not-launched-restart

I don't see anything unusual in the logs:

generating ED25519 keypair...done
peer identity: 12D3KooWSffcx86kMLgkgaoT9iGATh3sqmSuiFtECkPKxQJXTJ42
initializing IPFS node at /Users/stephendonner/Library/Application Support/BraveSoftware/Brave-Browser-Nightly/brave_ipfs
to get started, enter:

	ipfs cat /ipfs/QmQPeNsJPyVWPFDVHb77w8G42Fvo15z4bG2X8D2GhfbSXc/readme

Error: daemon not running
Initializing daemon...
go-ipfs version: 0.7.0
Repo version: 10
System version: amd64/darwin
Golang version: go1.14.4
Swarm listening on /ip4/10.0.0.19/tcp/44002
Swarm listening on /ip4/127.0.0.1/tcp/44002
Swarm listening on /ip6/2002:6398:716c:0:1436:784e:aec9:6a76/tcp/44002
Swarm listening on /ip6/2002:6398:716c:0:2d0b:e962:90af:a5cf/tcp/44002
Swarm listening on /ip6/2002:6398:716c:0:5925:80a7:d4fa:eb29/tcp/44002
Swarm listening on /ip6/::1/tcp/44002
Swarm listening on /p2p-circuit
Swarm announcing /ip4/10.0.0.19/tcp/44002
Swarm announcing /ip4/127.0.0.1/tcp/44002
Swarm announcing /ip6/::1/tcp/44002
API server listening on /ip4/127.0.0.1/tcp/45002
WebUI: http://127.0.0.1:45002/webui
Gateway (readonly) server listening on /ip4/127.0.0.1/tcp/48081
Daemon is ready

Expected result:

Local ipfs node relaunches/restarts, and tab content loads upon browser restart/restore.

Reproduces how often:

It reproduces 100% of the time if you give the shutdown-and-restart steps enough tries; sometimes it takes a while for it to happen, and other times, it happens immediately on relaunch (less common). Perhaps it's a timing/race-condition thing.

Found while testing #14328.

Brave version (brave://version info)

Brave 1.24.4 Chromium: 89.0.4389.90 (Official Build) nightly (x86_64)
Revision 62eb262cdaae9ef819aadd778193781455ec7a49-refs/branch-heads/4389@{#1534}
OS macOS Version 11.2.3 (Build 20D91)

@spylogsster @lidel any debug logging I can help add, here?

@spylogsster
Copy link

spylogsster commented Apr 7, 2021

@stephendonner this looks like a problem I have already fixed here https://github.com/brave/brave-core/blame/master/components/services/ipfs/ipfs_service_impl.cc#L274, it should work in versions starting from https://github.com/brave/brave-core/releases/tag/v1.24.53 and I can not reproduce it on latest one, could you please recheck?

@stephendonner
Copy link
Author

@stephendonner this looks like a problem I have already fixed here https://github.com/brave/brave-core/blame/master/components/services/ipfs/ipfs_service_impl.cc#L274, it should work in versions starting from https://github.com/brave/brave-core/releases/tag/v1.24.53 and I can not reproduce it on latest one, could you please recheck?

Cannot reproduce this using

Brave 1.24.52 Chromium: 90.0.4430.51 (Official Build) nightly (x86_64)
Revision 32e5fa33a31641bded70a90e60121060691e7125-refs/branch-heads/4430@{#927}
OS macOS Version 11.2.3 (Build 20D91)

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

No branches or pull requests

2 participants