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

Infinite scuttling with repeated IP addresses on different interfaces #1222

Closed
ivilata opened this issue Dec 6, 2019 · 6 comments · May be fixed by ssbc/ssb-config#67
Closed

Infinite scuttling with repeated IP addresses on different interfaces #1222

ivilata opened this issue Dec 6, 2019 · 6 comments · May be fixed by ssbc/ssb-config#67

Comments

@ivilata
Copy link

ivilata commented Dec 6, 2019

Patchwork 3.17.1 remains stuck in the initial screen with the big "Loading..." spinner at the center and the small "Scuttling..." spinner at the top. I waited for several minutes, with Patchwork barely using CPU. The terminal output shows the following error:

Error: listen EADDRINUSE: address already in use 192.168.23.1:8008
    at Server.setupListenHandle [as _listen2] (net.js:1226:14)
    at listenInCluster (net.js:1274:12)
    at doListen (net.js:1413:7)
    at processTicksAndRejections (internal/process/task_queues.js:84:9)
    at runNextTicks (internal/process/task_queues.js:59:3)
    at processImmediate (internal/timers.js:412:9)
Error: async hook stack has become corrupted (actual: 90, expected: 0)

Before starting Patchwork no process was listening on port 8008.

192.168.23.1 happens to be an address that I have in two different interfaces with different network masks, as part of a VPN setup where one interface is used to reach my local part of the VPN and another the rest of the VPN.

This is quite easy to reproduce in GNU/Linux by creating some dummy interfaces and setting the address there. As root:

# ip link add test0 type dummy
# ip link add test1 type dummy
# ip link set test0 up
# ip link set test1 up
# ip addr add 192.0.2.1/24 dev test0
# ip addr add 192.0.2.1/16 dev test1

Then run Patchwork to see the problem. To cleanup the network configuration, as root:

# ip link del test1
# ip link del test0

It seems that Patchwork iterates over IP addresses to listen on each of them (why not just listen on all interfaces?), but doesn't keep track of addresses it already started listening on (wrongly assuming that they will only appear once in interfaces).

Please note that this error did not show in 3.15.0 (the last version I used).

Thanks and keep the good work!

@ivilata
Copy link
Author

ivilata commented Dec 6, 2019

Please note that this error did not show in 3.15.0 (the last version I used).

Precision: 3.15.0 does show the two errors below in its terminal, but it continues to work as expected:

Error: listen EADDRINUSE 192.168.23.1:8008
    at Server.setupListenHandle [as _listen2] (net.js:1286:14)
    at listenInCluster (net.js:1334:12)
    at doListen (net.js:1460:7)
    at process._tickCallback (internal/process/next_tick.js:63:19)
Error: listen EADDRINUSE 192.168.23.1:8989
    at Server.setupListenHandle [as _listen2] (net.js:1286:14)
    at listenInCluster (net.js:1334:12)
    at doListen (net.js:1460:7)
    at process._tickCallback (internal/process/next_tick.js:63:19)

Note that there is no "async hook stack has become corrupted" error.

@christianbundy
Copy link
Contributor

Sorry to hear you're bumping into this. I think I was the last person to touch the related networking code so I hope I can help! Could you post JSON config that Patchwork outputs? Specifically the .connections.incoming property, I'm curious about which interfaces are being listened on.

I think ssbc/multiserver#49 is the correct fix for that, it's just pending review. Maybe we can come up with a workaround in the meantime.

@christianbundy
Copy link
Contributor

Reproduced! I'll take care of this, no JSON config required. Thanks for the awesome repro code.

@christianbundy
Copy link
Contributor

Assuming you're building from source, could can try the fix with:

npm install ssb-config@github:ssbc/ssb-config#filter-incoming

This should replace the default ssb-config with the patched version, I'd be curious to hear if it resolves the problem. Thanks again!

@ivilata
Copy link
Author

ivilata commented Mar 27, 2020

Thanks @christianbundy for taking care of this! Unfortunately I'm using the AppImage, not building from source. But if there is some way that I could work around that to test it, or use some dev build I can try it.

@ivilata
Copy link
Author

ivilata commented Jun 9, 2020

FYI, this is still happening in 3.18.0.

@christianbundy christianbundy removed their assignment Jan 31, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants