Js-ipfs: Web UI hangs indefinitely when opening it in a browser after starting the js ipfs daemon

Created on 26 Feb 2020  Â·  20Comments  Â·  Source: ipfs/js-ipfs

After using js-ipfs to start a daemon, it says the web UI will be available here http://127.0.0.1:5002/webui, but when you go to that page in a browser it never finishes loading.

neeauthor-input

All 20 comments

I considered using IPFS Desktop as an alternative, but that's an upcoming feature for js-ipfs https://github.com/ipfs-shipyard/ipfs-desktop/issues/601

In the meantime, is cating files from the terminal my best bet?

Does this still happen for you? I can't replicate it.

@achingbrain Yep. Trying it in Chrome with the latest version of the js-ipfs master branch.

Initializing IPFS daemon...
js-ipfs version: 0.41.2
System version: x64/darwin
Node.js version: 12.14.1
Swarm listening on /ip4/127.0.0.1/tcp/4002/p2p/QmRGuGpzcEoQRFFJsK8Eh7uLeKuFM9C2xFv3R3cMmVzVQi
Swarm listening on /ip4/192.168.7.42/tcp/4002/p2p/QmRGuGpzcEoQRFFJsK8Eh7uLeKuFM9C2xFv3R3cMmVzVQi
Swarm listening on /ip4/169.254.98.207/tcp/4002/p2p/QmRGuGpzcEoQRFFJsK8Eh7uLeKuFM9C2xFv3R3cMmVzVQi
Swarm listening on /ip4/127.0.0.1/tcp/4003/ws/p2p/QmRGuGpzcEoQRFFJsK8Eh7uLeKuFM9C2xFv3R3cMmVzVQi
API listening on /ip4/127.0.0.1/tcp/5002/http
Gateway (read only) listening on /ip4/127.0.0.1/tcp/9090/http
Web UI available at http://127.0.0.1:5002/webui
Daemon is ready

Screenshot 2020-03-11 11 02 05

@hugomrdias Can you reproduce this?

no works here

Maybe it's a Mac issue? Does @alanshaw have a Mac to try it on?

Thoughts on how we can move forward with this?

@Schwartz10 Can you check if you can reproduce this issue? Thanks!

Maybe it's a Mac issue?

No, I have a Mac, I've tried with multiple browsers, it all seems fine.

Thoughts on how we can move forward with this?

If you can figure out how to replicate it reliably it can certainly be fixed.

Steps to reproduce this

git clone this repo at commit bfba767 (which is master at the time I'm writing this)

Mac OS 10.15.3
Chrome Version 80.0.3987.149

Using nvm to pick node versions, run:
nvm use 10.18.1

npm v6.13.7
yarn version 1.22.4

cd into js-ipfs after clunning, run yarn to run lerna bootstrap

Open a zsh terminal

➜ js-ipfs git:(master) ./packages/ipfs/src/cli/bin.js daemon

Initializing IPFS daemon...
js-ipfs version: 0.41.2
System version: x64/darwin
Node.js version: 10.18.1

Web UI available at http://127.0.0.1:5002/webui

Navigate to URI output when running the js ipfs daemon, and it hangs forever.

Screenshot 2020-03-18 14 27 20

After loading for a long time, the URL changes to this, but the spinner is there and an error message shows up:
Screenshot 2020-03-18 14 29 18

@Schwartz10 tried it and it took ~5 minutes to load but eventually loaded when using node.js 12.14.1. But it taking that long still probably counts as a bug.

I just tried with node.js 12.16.1, and the results weren't different for me.

The only other strange thing I can think of that's specific to my config is that I am using 1.1.1.1 as my DNS resolver. Any chance that could be related? When using 1.1.1.1 on my mobile device on airplanes I've had to disable it to get the internet to work.

I've tried running the daemon without a VPN connection, so that's not the problem.

@Schwartz10 and I chatted. We think the most likely explanation is that you're using a set of peers that already can serve the file corresponding to that Qmexhq2sBHnXQbvyP2GfUdbnY7HCagH2Mw5vUNSBn2nxip CID that either currently or always points to the web UI content (depending on whether you're using MFS or not).

Maybe js-ipfs should ship pointing to a known usually-live peer that can resolve Qmexhq2sBHnXQbvyP2GfUdbnY7HCagH2Mw5vUNSBn2nxip?

When @Schwartz runs swarm peers, here are his results:

./packages/ipfs/src/cli/bin.js swarm peers
/dns4/node0.preload.ipfs.io/tcp/443/wss/p2p/QmZMxNdpMkewiVZLMRxaNxUeZpDUb34pWjZ1kZvsd16Zic

and here are mine:

➜  js-ipfs git:(master) ./packages/ipfs/src/cli/bin.js swarm peers 
/ip6/::1/tcp/4001/p2p/QmQa5ADTm4tJft7Yf5KzpkhCULtskARhRfnNRRU4ouhCEt
/ip4/162.243.248.213/tcp/4001/p2p/QmSoLueR4xBeUbY9WZ9xGUUxunbKWcrNFTDAadQJmocnWm
/ip4/104.236.76.40/tcp/4001/p2p/QmSoLV4Bbm51jM9C4gDYZQ9Cy3U6aXMJDAbzgu2fzaDs64
/ip4/104.236.179.241/tcp/4001/p2p/QmSoLPppuBtQSGwKDZT2M73ULpjvfd3aZ6ha4oFGL1KrGM
/ip4/104.131.131.82/tcp/4001/p2p/QmaCpDMGvV2BGHeYERUEnRQAwe3N8SzbUtfsmvsqQLuvuJ
/ip4/178.62.61.185/tcp/4001/p2p/QmSoLMeWqB7YGVLJN3pNLQpmmEk35v6wYtsMGLzSr5QBU3
/ip4/178.62.158.247/tcp/4001/p2p/QmSoLer265NRgSp2LA3dPaeykiS1J6DifTC88f5uVQKNAd
/ip4/128.199.219.111/tcp/4001/p2p/QmSoLSafTMBsPKadTEgaXctDQVcqN88CNLHXMkTNwMKPnu

Just to add on to what @pcowgill said with some more explicit observations (and this may have already been obvious to everyone), we ran a series of tests - the problem isn't the web UI itself, it's that Paul's js-ipfs instance can't resolve the content behind Qmexhq2sBHnXQbvyP2GfUdbnY7HCagH2Mw5vUNSBn2nxip before timing out.

The only other strange thing I can think of that's specific to my config is that I am using 1.1.1.1 as my DNS resolver. Any chance that could be related? When using 1.1.1.1 on my mobile device on airplanes I've had to disable it to get the internet to work.

^ This definitely isn't the problem, given that the web UI is working for me with go-ipfs

Did this info help with reproducing the issue? Thanks!

I wasn't able to reproduce but I am also connected to the preload nodes, if you're losing connection to the preload nodes that may be the issue. @pcowgill are you still having this issue?

Closing this, please reopen if you're still encountering this.

well... I have the same problem...

ok..I solve this problem.
In my /.jsipfs/config, attribute "Gateway" was undefined, then I copy the "Gateway"'s content from go-ipfs's config, and jsipfs daemon, it actually works.
I think you could try.

Was this page helpful?
0 / 5 - 0 ratings