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

Error in connection establishment: net::ERR_CONNECTION_REFUSED #3256

Closed
hunterInt opened this issue Aug 30, 2020 · 4 comments
Closed

Error in connection establishment: net::ERR_CONNECTION_REFUSED #3256

hunterInt opened this issue Aug 30, 2020 · 4 comments
Labels
need/triage Needs initial labeling and prioritization

Comments

@hunterInt
Copy link

  • Version: 0.48.2
  • Platform:

Firefox 80
Brave 1.13.82
Chrome 85.0.4183.83

  • Subsystem:

Severity: Medium

Description:

Once await IPFS.create(); has run the console fills with these errors:
Firefox can’t establish a connection to the server at

ws://127.0.0.1:8081/p2p/QmSoLer265NRgSp2LA3dPaeykiS1J6DifTC88f5uVQKNAd.
The connection to ws://127.0.0.1:8081/p2p/QmSoLV4Bbm51jM9C4gDYZQ9Cy3U6aXMJDAbzgu2fzaDs64 was interrupted while the page was loading.

image

Steps to reproduce the error:

import IPFS from 'ipfs'

await IPFS.create();

Or I have created and attached a simple reproduce project that will reproduce this error.
test.zip
Run it like so:

npm i
node server.js

Then visit localhost:8080

@hunterInt hunterInt added the need/triage Needs initial labeling and prioritization label Aug 30, 2020
@welcome
Copy link

welcome bot commented Aug 30, 2020

Thank you for submitting your first issue to this repository! A maintainer will be here shortly to triage and review.
In the meantime, please double-check that you have provided all the necessary information to make this process easy! Any information that can help save additional round trips is useful! We currently aim to give initial feedback within two business days. If this does not happen, feel free to leave a comment.
Please keep an eye on how this issue will be labeled, as labels give an overview of priorities, assignments and additional actions requested by the maintainers:

  • "Priority" labels will show how urgent this is for the team.
  • "Status" labels will show if this is ready to be worked on, blocked, or in progress.
  • "Need" labels will indicate if additional input or analysis is required.

Finally, remember to use https://discuss.ipfs.io if you just need general support.

@jacobheun
Copy link
Contributor

This isn't actually an error, but it is annoying when checking logs. The problem is that libp2p is trying to dial a websocket address that another node has advertised, but it's a private address. So when we attempt to make a websocket connection it fails. The error logged to the console is an uncatchable error due to security concerns in the browser, so there's no way for us to hide those from the logs. As long as there is another, valid public address for the peer we'll still dial and connect to it.

The feature that needs to be implemented in libp2p to mitigate the large number of errors here is multiaddr confidence, libp2p/js-libp2p#593. This will enable us to identify 127.0.0.1:8081 as a bad IP/port combo and add it to a deny list for future dials. We can't restrict this address outright because there may indeed be a local node running on that address and port.

We will always have some of these when we receive bad addresses from another peer, but we should be able to limit the number of them with deny lists.

@jacobheun
Copy link
Contributor

Closing this as the underlying solution is already planned for in libp2p.

@raphael10-collab
Copy link

Hi @jacobheun !
I'm having this issue too

image

When is planned the solution?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
need/triage Needs initial labeling and prioritization
Projects
None yet
Development

No branches or pull requests

3 participants