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

WebSocket connection failed, Error 403 #941

Closed
milankragujevic opened this issue Aug 8, 2017 · 31 comments
Closed

WebSocket connection failed, Error 403 #941

milankragujevic opened this issue Aug 8, 2017 · 31 comments
Labels
kind/bug A bug in existing code (including security flaws)

Comments

@milankragujevic
Copy link

  • Version: 0.25.1
  • Platform: Browser, Windows 10, Chrome 60.0.3112.78
  • Subsystem: Not sure?

Type: Bug

Severity: Medium

Description: I receive a websocket error.

VM44:161 WebSocket connection to 'wss://ams-1.bootstrap.libp2p.io/' failed: Error during WebSocket handshake: Unexpected response code: 403

Steps to reproduce the error: https://milankragujevic.com/temp/ipfs/test.html

@lightninglu10
Copy link

I'm getting the same error here. Seems like there's no error handling on a failed wss reconnect so it tries a bunch and then eventually IPFS crashes which crashes my browser.

@ghost
Copy link

ghost commented Aug 9, 2017

Are you getting the same 403 error with other bootstrap.libp2p.io nodes too, and is this only on reconnect? I'm seeing a couple dozen peers connected to these nodes so from my point of view all is good.

@lightninglu10
Copy link

This happens to me whenever I load up my web page and I have IPFS running in the page.

screen shot 2017-08-08 at 5 07 59 pm

@ya7ya
Copy link
Contributor

ya7ya commented Aug 9, 2017

I'm seeing the same issue too.

403

@victorb
Copy link
Member

victorb commented Aug 10, 2017

@lgierth some nodes seems to work, but others not...

For example, nodes I can connect to (get status code 101):

  • sgp-1.bootstrap.libp2p.io
  • nyc-{1,2}.bootstrap.libp2p.io
  • lon-1.bootstrap.libp2p.io

Nodes that don't work (get status code 403):

  • sfo-{1,3}.bootstrap.libp2p.io
  • ams-1.bootstrap.libp2p.io

@victorb victorb added the kind/bug A bug in existing code (including security flaws) label Aug 10, 2017
@ghost
Copy link

ghost commented Aug 10, 2017

Nodes that don't work (get status code 403):

  • sfo-{1,3}.bootstrap.libp2p.io
  • ams-1.bootstrap.libp2p.io

Great, these are the ones running go-ipfs master using the new websocket lib :/

@victorb
Copy link
Member

victorb commented Aug 11, 2017

We have now rolled back the bootstrap nodes with the new websocket library so things should work correctly now.

Sorry for the temporary hiccup with this.

@milankragujevic
Copy link
Author

Still getting a similar issue as I got before
WebSocket connection to 'wss://sfo-2.bootstrap.libp2p.io/' failed: Error during WebSocket handshake: Unexpected response code: 502

Only sfo-1 and sfo-2.

@daviddias daviddias reopened this Aug 25, 2017
@daviddias
Copy link
Member

@milankragujevic confirm if this makes the node unusable. If I understand correctly, the browser itself will log an error if a connection fails, which doesn't mean that all the other connections won't work.

@joeltg
Copy link

joeltg commented Aug 26, 2017

Also getting this - after a while (~5 minutes) the page crashes.
screen shot 2017-08-25 at 10 47 24 pm
screen shot 2017-08-25 at 10 55 10 pm

@JohnAllen
Copy link

I get exactly what @joeltg gets so won't repost unless requested. I am also unable to ipfs cat content added after this so has made IPFS in the browser not very useful for the time being.

@mitra42
Copy link

mitra42 commented Aug 26, 2017

I get these errors as well, BUT not many of them and it doesn't crash the page. However - the page crashing after about 5 mins is something we are seeing all the time, and is something reported on #950 and by Orbit on #942

@lightninglu10
Copy link

@joeltg check these issues on the browser crashing.

#950

I think we solved our IPFS browser crashing issue by disabling webRTC by here: #942 (comment)

before the # of listeners continually increased, but now they stay at a reasonable state without webRTC (which is default enabled)

@merlox
Copy link

merlox commented Aug 27, 2017

What kind of solution is that? I just can't disable webRTC because my dapp needs it.

@mitra42
Copy link

mitra42 commented Aug 28, 2017

Yes - same for us, disabling WebRTC seems to disable IIIF (both PubSub and retrieving annotation lists) which means without WebRTC our demos are non-functional

@merlox
Copy link

merlox commented Aug 28, 2017

Here is the solution for me, I removed those 2 nodes that were emmiting the error:
BEFORE:

 const ipfs = new Ipfs({
  init: true,
  start: true,
  repo: 'ipfs-testing',
  config: {
    Bootstrap: [
      "/dns4/ams-1.bootstrap.libp2p.io/tcp/443/wss/ipfs/QmSoLer265NRgSp2LA3dPaeykiS1J6DifTC88f5uVQKNAd",
      "/dns4/sfo-1.bootstrap.libp2p.io/tcp/443/wss/ipfs/QmSoLju6m7xTh3DuokvT3886QRYqxAzb1kShaanJgW36yx",
      "/dns4/lon-1.bootstrap.libp2p.io/tcp/443/wss/ipfs/QmSoLMeWqB7YGVLJN3pNLQpmmEk35v6wYtsMGLzSr5QBU3",
      "/dns4/sfo-2.bootstrap.libp2p.io/tcp/443/wss/ipfs/QmSoLnSGccFuZQJzRadHn95W2CrSFmZuTdDWP8HXaHca9z",
      "/dns4/sfo-3.bootstrap.libp2p.io/tcp/443/wss/ipfs/QmSoLPppuBtQSGwKDZT2M73ULpjvfd3aZ6ha4oFGL1KrGM",
      "/dns4/sgp-1.bootstrap.libp2p.io/tcp/443/wss/ipfs/QmSoLSafTMBsPKadTEgaXctDQVcqN88CNLHXMkTNwMKPnu",
      "/dns4/nyc-1.bootstrap.libp2p.io/tcp/443/wss/ipfs/QmSoLueR4xBeUbY9WZ9xGUUxunbKWcrNFTDAadQJmocnWm",
      "/dns4/nyc-2.bootstrap.libp2p.io/tcp/443/wss/ipfs/QmSoLV4Bbm51jM9C4gDYZQ9Cy3U6aXMJDAbzgu2fzaDs64"
    ]
  }
})

AFTER (note that those nodes are gone):

window.ipfs = new IPFS({
            init: true,
            start: true,
            config: {
               Bootstrap: [
                  "/dns4/ams-1.bootstrap.libp2p.io/tcp/443/wss/ipfs/QmSoLer265NRgSp2LA3dPaeykiS1J6DifTC88f5uVQKNAd",
                  "/dns4/lon-1.bootstrap.libp2p.io/tcp/443/wss/ipfs/QmSoLMeWqB7YGVLJN3pNLQpmmEk35v6wYtsMGLzSr5QBU3",
                  "/dns4/sfo-3.bootstrap.libp2p.io/tcp/443/wss/ipfs/QmSoLPppuBtQSGwKDZT2M73ULpjvfd3aZ6ha4oFGL1KrGM",
                  "/dns4/sgp-1.bootstrap.libp2p.io/tcp/443/wss/ipfs/QmSoLSafTMBsPKadTEgaXctDQVcqN88CNLHXMkTNwMKPnu",
                  "/dns4/nyc-1.bootstrap.libp2p.io/tcp/443/wss/ipfs/QmSoLueR4xBeUbY9WZ9xGUUxunbKWcrNFTDAadQJmocnWm",
                  "/dns4/nyc-2.bootstrap.libp2p.io/tcp/443/wss/ipfs/QmSoLV4Bbm51jM9C4gDYZQ9Cy3U6aXMJDAbzgu2fzaDs64"
               ]
            }
         })

joeltg added a commit to nDimensional/prototypical that referenced this issue Aug 28, 2017
@daviddias
Copy link
Member

This is no longer an issue in js-ipfs 0.25.3. Fixed with 5ec27a3

@rstormsf
Copy link

rstormsf commented Oct 9, 2018

it's still the issue
@diasdavid
image

@sriharrsha
Copy link

I'm on 0.33.1

error

Never used wss1 or wss0 but somewhere the dependency libraries are hardcoded calling these servers.

Any Help?

@sriharrsha
Copy link

This is no longer an issue in js-ipfs 0.25.3. Fixed with 5ec27a3

This is still an ongoing issue.

@sriharrsha
Copy link

it's still the issue
@diasdavid
image

Any Update?

@hushino
Copy link

hushino commented Dec 31, 2018

same issue here with ipfs 0.33.1

@Juanperezc
Copy link

Rt

@hushino
Copy link

hushino commented Dec 31, 2018

use this solve the problem

 Bootstrap: [
        "/dns4/ams-1.bootstrap.libp2p.io/tcp/443/wss/ipfs/QmSoLer265NRgSp2LA3dPaeykiS1J6DifTC88f5uVQKNAd",
        "/dns4/lon-1.bootstrap.libp2p.io/tcp/443/wss/ipfs/QmSoLMeWqB7YGVLJN3pNLQpmmEk35v6wYtsMGLzSr5QBU3",
        "/dns4/nyc-1.bootstrap.libp2p.io/tcp/443/wss/ipfs/QmSoLueR4xBeUbY9WZ9xGUUxunbKWcrNFTDAadQJmocnWm",
        "/dns4/nyc-2.bootstrap.libp2p.io/tcp/443/wss/ipfs/QmSoLV4Bbm51jM9C4gDYZQ9Cy3U6aXMJDAbzgu2fzaDs64"
      ]

@tomnyson
Copy link

tomnyson commented Jan 3, 2019

thank for problem

@AravDalwani
Copy link

image

Hi, I am getting similiar websocket error but with the localhost IP address. Can anyone please please help me out?
IPFS is not connecting because of this

JS-IPFS version: 0.47.0

@giraffekey
Copy link

I am getting that localhost error too, on version 0.48.1.

@zhgromov
Copy link

zhgromov commented Nov 5, 2020

again this problem... how I can fix this?

@d4mr
Copy link

d4mr commented Jul 7, 2021

We are having the same problem. Any updates?

@zhgromov
Copy link

zhgromov commented Jul 7, 2021

We are having the same problem. Any updates?

we cancel this lib and use "ipfs-core": "^0.2.0",

next,
initialize node from ipfs via window

    const node = window.IpfsCore.create({
      repo: "projectName",
      init: {
        emptyRepo: true,
        algorithm: "ed25519",
      },
    });
    node.then((i) => this.setState({nodeIPFS: i}))
after that, upload files to connected ipfs node from first code example
  const addToIpfs = async (file) => {
    const {path} = await node.add(file);

    if (path) {
      console.log(path);
      // await node.stop();
      // setSNode(false)
      return path
    }
  };

@d4mr
Copy link

d4mr commented Jul 7, 2021

@zhgromov thanks a ton, let me try this

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

No branches or pull requests