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

Fix IPFS errors when loading projects #129

Open
jakubgs opened this issue Jul 28, 2022 · 16 comments
Open

Fix IPFS errors when loading projects #129

jakubgs opened this issue Jul 28, 2022 · 16 comments
Assignees

Comments

@jakubgs
Copy link
Member

jakubgs commented Jul 28, 2022

Currently project pages do not load due to IPFS Websocket errors:

client.js:19 WebSocket connection to 'wss://ams-1.bootstrap.libp2p.io/ipfs/QmSoLer265NRgSp2LA3dPaeykiS1J6DifTC88f5uVQKNAd' failed: 
client.js:19 WebSocket connection to 'wss://lon-1.bootstrap.libp2p.io/ipfs/QmSoLMeWqB7YGVLJN3pNLQpmmEk35v6wYtsMGLzSr5QBU3' failed: 
client.js:19 WebSocket connection to 'wss://sfo-3.bootstrap.libp2p.io/ipfs/QmSoLPppuBtQSGwKDZT2M73ULpjvfd3aZ6ha4oFGL1KrGM' failed: 
client.js:19 WebSocket connection to 'wss://sgp-1.bootstrap.libp2p.io/ipfs/QmSoLSafTMBsPKadTEgaXctDQVcqN88CNLHXMkTNwMKPnu' failed: 
client.js:19 WebSocket connection to 'wss://nyc-2.bootstrap.libp2p.io/ipfs/QmSoLV4Bbm51jM9C4gDYZQ9Cy3U6aXMJDAbzgu2fzaDs64' failed: 
client.js:19 WebSocket connection to 'wss://nyc-1.bootstrap.libp2p.io/ipfs/QmSoLueR4xBeUbY9WZ9xGUUxunbKWcrNFTDAadQJmocnWm' failed: 

This is most probably due to IPFS API changes.

@jakubgs jakubgs self-assigned this Jul 28, 2022
@jakubgs
Copy link
Member Author

jakubgs commented Jul 29, 2022

It looks like the domains are just gone:

 > cat <<EOF | xargs -n1 host
ams-1.bootstrap.libp2p.io
lon-1.bootstrap.libp2p.io
nyc-1.bootstrap.libp2p.io
nyc-2.bootstrap.libp2p.io
sfo-3.bootstrap.libp2p.io
sgp-1.bootstrap.libp2p.io
EOF                      
Host ams-1.bootstrap.libp2p.io not found: 3(NXDOMAIN)
Host lon-1.bootstrap.libp2p.io not found: 3(NXDOMAIN)
Host nyc-1.bootstrap.libp2p.io not found: 3(NXDOMAIN)
Host nyc-2.bootstrap.libp2p.io not found: 3(NXDOMAIN)
Host sfo-3.bootstrap.libp2p.io not found: 3(NXDOMAIN)
Host sgp-1.bootstrap.libp2p.io not found: 3(NXDOMAIN)

@jakubgs
Copy link
Member Author

jakubgs commented Jul 29, 2022

I believe the package that controls these addresses is: https://github.com/libp2p/js-libp2p-bootstrap

liquid-funding/yarn.lock

Lines 13904 to 13905 in 3e7ed35

libp2p-bootstrap@~0.9.3:
version "0.9.7"

Which is already at 2.0.0 and we are still on 0.9.7: https://github.com/libp2p/js-libp2p-bootstrap/releases/tag/v2.0.0

@jakubgs
Copy link
Member Author

jakubgs commented Jul 29, 2022

We have a CI build for assembe.fund but it hasn't been used in ages:
https://ci.status.im/job/website/job/assemble.fund/
And there is a Jenkinsfile. So this should be fairly simple to fix:
https://github.com/status-im/liquid-funding/blob/master/Jenkinsfile

@jakubgs
Copy link
Member Author

jakubgs commented Jul 29, 2022

Unfortunately yarn install doesn't work and explodes with:

error Command failed.
Exit code: 128
Command: git
Arguments: ls-remote --tags --heads git://github.com/frozeman/WebSocket-Node.git
Directory: /home/jakubgs/work/liquid-funding
Output:
fatal: unable to connect to github.com:
github.com[0: 140.82.121.3]: errno=Connection timed out

Where WebSocket-Node is a dependency from embark, specifically:

"embark": "^4.1.0-beta.0",

Merciful Christ protect me...

@jakubgs
Copy link
Member Author

jakubgs commented Jul 29, 2022

The way the dependency is specified in yarn.lock is kinda weird:

liquid-funding/yarn.lock

Lines 23468 to 23475 in 3e7ed35

"websocket@git://github.com/frozeman/WebSocket-Node.git#browserifyCompatible":
version "1.0.26"
resolved "git://github.com/frozeman/WebSocket-Node.git#6c72925e3f8aaaea8dc8450f97627e85263999f2"
dependencies:
debug "^2.2.0"
nan "^2.3.3"
typedarray-to-buffer "^3.1.2"
yaeti "^0.0.6"

@jakubgs
Copy link
Member Author

jakubgs commented Jul 29, 2022

This appears to be the relevant issue:

And the suggested solution is:

git config --global url.https://github.com/.insteadOf git://github.com/

Which creates an entry like this:

 > grep -A1 github ~/.gitconfig   
[url "https://github.com/"]
	insteadOf = git://github.com/

@jakubgs
Copy link
Member Author

jakubgs commented Jul 29, 2022

And it does indeed fix that issue, but we have another:

error [email protected]: The engine "node" is incompatible with this module. Expected version ">=8.12.0 <12.0.0". Got "16.15.0"

So I guess I will need to somehow get Node 11, possibly via Nix.

@jakubgs
Copy link
Member Author

jakubgs commented Jul 29, 2022

Looks like Node.js 10 was remove from nixpkgs 2 months ago: NixOS/nixpkgs@0bb08246

But we can lock nixpkgs at an older version.

@jakubgs
Copy link
Member Author

jakubgs commented Jul 29, 2022

Looks like libp2p-bootstrap is published as two different packages on NPM:

But even using 0.14.0 causes issues:

error [email protected]: The engine "node" is incompatible with this module. Expected version ">=15.0.0". Got "10.24.1"

Just end me...

@jakubgs
Copy link
Member Author

jakubgs commented Jul 29, 2022

Looks like the highest I can go with NodeJS 10 is [email protected].
And the highest version of IPFS library I can get is [email protected]. Which pulls in [email protected].

Not sure if that's going to be enough, since that version is from 21st of April 2022, but lets see.

@jakubgs
Copy link
Member Author

jakubgs commented Jul 29, 2022

Whelp, I upgraded both, but now I get this:

  > yarn run build
...
$ node scripts/build.js
Creating an optimized production build...
Browserslist: caniuse-lite is outdated. Please run next command `yarn upgrade`
Failed to compile.

./src/dapp.js
Cannot find file './embarkArtifacts/embarkjs' in './src'.

error Command failed with exit code 1.

this is why we can't have nice things

@jakubgs
Copy link
Member Author

jakubgs commented Jul 29, 2022

Apparently the solution for the browserlist error is:

npx browserslist@latest --update-db

@jakubgs
Copy link
Member Author

jakubgs commented Jul 29, 2022

I tried running node_modules/.bin/embark build but it just gets stuck on these lines:

...
assuming ERCProxy to be an interface
assuming ERC20 to be an interface
assuming ERC20Basic to be an interface
To get more details on interface Smart contracts, go here: https://embark.status.im/docs/troubleshooting.html#Assuming-Contract-to-be-an-interface
LiquidPledging has code associated to it but it's configured as an instanceOf LiquidPledgingMock

And nothing happens.

@jakubgs
Copy link
Member Author

jakubgs commented Jul 29, 2022

Apparently I should be using embark build livenet based on this config:


But when I do I see errors like these:

Unsupported account configuration: {}
Check the docs at https://embark.status.im/docs/contracts_deployment.html#Using-accounts-in-a-wallet
Error initiating Web3 provider Error getting the account

And it gets stuck as well.

@jakubgs
Copy link
Member Author

jakubgs commented Jul 29, 2022

Using strace shows it being stuck on epoll_wait:

 > strace -f -p $(pgrep -f 'node node_modules/.bin/embark build livenet')
strace: Process 1113465 attached with 11 threads
[pid 1113476] futex(0x7fbef80f1228, FUTEX_WAIT_BITSET_PRIVATE|FUTEX_CLOCK_REALTIME, 0, NULL, FUTEX_BITSET_MATCH_ANY <unfinished ...>
[pid 1113475] futex(0x7fbef80f1228, FUTEX_WAIT_BITSET_PRIVATE|FUTEX_CLOCK_REALTIME, 0, NULL, FUTEX_BITSET_MATCH_ANY <unfinished ...>
[pid 1113474] futex(0x7fbef80f1228, FUTEX_WAIT_BITSET_PRIVATE|FUTEX_CLOCK_REALTIME, 0, NULL, FUTEX_BITSET_MATCH_ANY <unfinished ...>
[pid 1113473] futex(0x7fbef80f1228, FUTEX_WAIT_BITSET_PRIVATE|FUTEX_CLOCK_REALTIME, 0, NULL, FUTEX_BITSET_MATCH_ANY <unfinished ...>
[pid 1113471] futex(0x1997580, FUTEX_WAIT_BITSET_PRIVATE|FUTEX_CLOCK_REALTIME, 0, NULL, FUTEX_BITSET_MATCH_ANY <unfinished ...>
[pid 1113470] futex(0x38df188, FUTEX_WAIT_BITSET_PRIVATE|FUTEX_CLOCK_REALTIME, 0, NULL, FUTEX_BITSET_MATCH_ANY <unfinished ...>
[pid 1113469] futex(0x38df188, FUTEX_WAIT_BITSET_PRIVATE|FUTEX_CLOCK_REALTIME, 0, NULL, FUTEX_BITSET_MATCH_ANY <unfinished ...>
[pid 1113468] futex(0x38df188, FUTEX_WAIT_BITSET_PRIVATE|FUTEX_CLOCK_REALTIME, 0, NULL, FUTEX_BITSET_MATCH_ANY <unfinished ...>
[pid 1113467] futex(0x38df188, FUTEX_WAIT_BITSET_PRIVATE|FUTEX_CLOCK_REALTIME, 0, NULL, FUTEX_BITSET_MATCH_ANY <unfinished ...>
[pid 1113466] epoll_wait(13,  <unfinished ...>
[pid 1113465] epoll_wait(3, 

jakubgs added a commit that referenced this issue Jul 29, 2022
Possible fix for wrong bootstrap node addresses:
#129

Signed-off-by: Jakub Sokołowski <[email protected]>
@jakubgs
Copy link
Member Author

jakubgs commented Jul 29, 2022

According to @John-44 this isn't worth fixing currently, so I'm going to leave it be fore now.

The partially working PR is open as a draft, maybe it will help someone in the future get this done:

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

No branches or pull requests

1 participant