Skip to content
This repository has been archived by the owner on Feb 12, 2024. It is now read-only.

Web UI hangs indefinitely when opening it in a browser after starting the js ipfs daemon #2796

Closed
pcowgill opened this issue Feb 26, 2020 · 23 comments
Labels
need/author-input Needs input from the original author

Comments

@pcowgill
Copy link
Contributor

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.

@pcowgill
Copy link
Contributor Author

I considered using IPFS Desktop as an alternative, but that's an upcoming feature for js-ipfs ipfs/ipfs-desktop#601

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

@achingbrain
Copy link
Member

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

@pcowgill
Copy link
Contributor Author

@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

@pcowgill
Copy link
Contributor Author

@hugomrdias Can you reproduce this?

@hugomrdias
Copy link
Member

no works here

@pcowgill
Copy link
Contributor Author

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

@pcowgill
Copy link
Contributor Author

Thoughts on how we can move forward with this?

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

@achingbrain
Copy link
Member

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.

@pcowgill
Copy link
Contributor Author

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

@pcowgill
Copy link
Contributor Author

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

@pcowgill pcowgill changed the title Web UI hangs indefinitely when loading it Web UI hangs indefinitely when opening it in a browser after starting the js ipfs daemon Mar 18, 2020
@pcowgill
Copy link
Contributor Author

@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.

@pcowgill
Copy link
Contributor Author

@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?

@pcowgill
Copy link
Contributor Author

pcowgill commented Mar 18, 2020

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

@Schwartz10
Copy link

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.

@pcowgill
Copy link
Contributor Author

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

@pcowgill
Copy link
Contributor Author

pcowgill commented Apr 9, 2020

Did this info help with reproducing the issue? Thanks!

@jacobheun
Copy link
Contributor

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?

@jacobheun jacobheun added the need/author-input Needs input from the original author label Jul 2, 2020
@jacobheun
Copy link
Contributor

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

@Kavelaa
Copy link

Kavelaa commented Aug 8, 2020

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

@Kavelaa
Copy link

Kavelaa commented Aug 8, 2020

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.

@LehaoLin
Copy link

LehaoLin commented Feb 9, 2021

After 2 hours trial, I solve this problem finally. I find that there are some attributes missing in js-ipfs's config, compared with go-ipfs.
My solution is
In /.jsipfs/config, add:

  "Mounts": {
    "IPFS": "/ipfs",
    "IPNS": "/ipns",
    "FuseAllowOther": false
  },
  "Gateway": {
    "HTTPHeaders": {
      "Access-Control-Allow-Headers": [
        "X-Requested-With",
        "Range",
        "User-Agent"
      ],
      "Access-Control-Allow-Methods": [
        "GET"
      ],
      "Access-Control-Allow-Origin": [
        "*"
      ]
    },
    "RootRedirect": "",
    "Writable": false,
    "PathPrefixes": [],
    "APICommands": [],
    "NoFetch": false,
    "NoDNSLink": false,
    "PublicGateways": null
  },
  "API": {
    "HTTPHeaders": {}
  },
  "Peering": {
    "Peers": null
  },
  "Provider": {
    "Strategy": ""
  },
  "Reprovider": {
    "Interval": "12h",
    "Strategy": "all"
  },
  "Plugins": {
    "Plugins": null
  }

LehaoLin added a commit to LehaoLin/js-ipfs that referenced this issue Feb 9, 2021
I met the same issue as ipfs#2796 , then I added this piece of code and problem was solved.
Environment: 
macOS 10.15.3
js-ipfs version: 0.4.2
System version: x64/darwin
Node.js version: 15.8.0
@wa1one
Copy link

wa1one commented Sep 7, 2022

@LehaoLin can confirm the issue. Why was this closed?

@luzzif
Copy link

luzzif commented Nov 4, 2022

This is still an issue for me, plase reopen.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
need/author-input Needs input from the original author
Projects
None yet
Development

No branches or pull requests

9 participants