archon icon indicating copy to clipboard operation
archon copied to clipboard

Connection refused by shipgate server

Open patapancakes opened this issue 3 years ago • 4 comments

I've been trying to set up an Archon instance and can't get past this error on startup: error starting SHIP server: error initializing SHIP server: error registering with shipgate: twirp error internal: failed to do request: Post "https://<server>:13000/twirp/archon.Shipgate/RegisterShip": dial tcp <server>:13000: connect: connection refused

I'm able to connect to the shipgate server through a web browser and netstat shows it as listening, no firewall is running on the server either so I'm not sure what's wrong.

patapancakes avatar Aug 02 '22 00:08 patapancakes

Oddly, adding game files into the patches folder seems to fix this. It looks like the ship server is trying to connect to shipgate server before it's ready, causing the error.

patapancakes avatar Aug 02 '22 02:08 patapancakes

Hard to say without seeing the log output but my assumption here is that I re-introduced a race condition while refactoring that I had previously guarded against with respect to shipgate startup. Adding files to the patches directory probably solves the issue because it slows down the patch server startup and given the Controller initializes the servers sequentially, the shipgate to finish initializing before other servers start connecting.

I'll see if I can reproduce this, though if you're able to trigger this again and capture the log output that would be helpful in figuring out what's going on

dcrodman avatar Aug 04 '22 03:08 dcrodman

I'm pretty sure on it being a race condition, yeah. While I don't have a log anymore (I switched to using newserv), I do remember that adding a time.Sleep() to the patch server function fixes the issue.

patapancakes avatar Aug 04 '22 06:08 patapancakes

Accidental close.

patapancakes avatar Aug 04 '22 06:08 patapancakes