Connection is random between servers from the same host

Moderator: English Moderator

Post Reply
erwinweber
Posts: 13
Joined: 21 Jun 2012, 19:53

Connection is random between servers from the same host

Post by erwinweber »

Hello,

I am having some weird issues after I've updated both the ManiaPlanet dedicated server and some structural stuff regarding docker.

I have 16 servers up with their ports in their name. Dedicated server with 'esac1' as login is named 'esac.gg|GS-2350', dedicated server with 'esac2' as login is named 'esac.gg|GS-2351', dedicated server with 'esac3' as login is named 'esac.gg|GS-2352', and so on ... The issue is that, when I access any of these servers, the in-game join panel displays the login of the server correctly, but the name of the server appears as if it's a different server.

Image

esac1 appears correctly here, but 2357 is a different server. It should've appeared 2350. What's more is that if I join this server I get redirected to an even different one.

Image

I got connected to 2356. If I check the logs it shows that I connected to the 2356 server, not 2350 as it should've and not even 2357 as it appeared in the join panel.

This happens to all servers. Every one of these are accessible, but I always get redirected to a different one.

I have a custom controller that connects to the servers via xmlrcp and the connection is fine there. 5000 links to 2350 (esac1), 5001 links to 2351 (esac2), 5002 links to 2352 (esac3), ... as expected. Just when I join the servers either in-game or via maniaplanet protocol, I get redirected to the wrong server.

I'm using docker compose to build the containers based on toffe's dockerfile from here: https://hub.docker.com/r/pyplanet/maniaplanet-dedicated
Network mode is on host mode. Each server has its own image. Each image has a config file loaded that matches the following port pattern: (2350/3450/5000 for first server, 2351/3451/5001, etc). I can see that the config is loaded properly in the logs, because it listens to the expected ports.

This is a major issue for me since esac is completely down and unusable because of this. Not sure what else I can do. Does anyone know what am I missing?
Huge thanks in advance!

Have a great evening,
Erwin
esac.gg
User avatar
TMarc
Posts: 15255
Joined: 05 Apr 2011, 19:10
Location: Europe
Contact:

Re: Connection is random between servers from the same host

Post by TMarc »

In the documentation (in the default config template) it is written that if the indicated port is busy, the server takes the next number...

Now, if you have your servers running, change something, and restart them, all the ports will be busy for some time, especially after shutting down the servers.
There is a TCP/IP timeout after closing a connection, and it is typically several minutes long.

You can check yourself the states of the connection with netstat -na
It will show such ports as TIME_WAIT or so.

So, the best thing to do, is to shut down all your servers (releasing all ports), and gradually starting them up one by one, checking the ports.

And also double-check your configurations and startup commands, not that one is using a wrong configuration by error.
erwinweber
Posts: 13
Joined: 21 Jun 2012, 19:53

Re: Connection is random between servers from the same host

Post by erwinweber »

Ok. I will shut down the servers for now, follow your instructions tomorrow and will write here how the process went. Thanks for the quick reply!
erwinweber
Posts: 13
Joined: 21 Jun 2012, 19:53

Re: Connection is random between servers from the same host

Post by erwinweber »

The issue is resolved. Thanks a lot TMarc.

The problem most probably appeared when making several modifications to the dockerfile and constantly rebuilding/restarting the servers in a short time span. Also, the fact that all servers were started simultaneously on build might have led to them picking random free ports, since the ports weren't already fully closed before the restarts.

All I did, was leaving them turned off overnight, then gradually starting them instead of starting them all at once.
User avatar
TMarc
Posts: 15255
Joined: 05 Apr 2011, 19:10
Location: Europe
Contact:

Re: Connection is random between servers from the same host

Post by TMarc »

Perfect :thumbsup:
erwinweber
Posts: 13
Joined: 21 Jun 2012, 19:53

Re: Connection is random between servers from the same host

Post by erwinweber »

Actually not resolved, please don't close this topic yet. I will investigate this further and write a reply asap.
User avatar
Harest
Posts: 144
Joined: 26 Mar 2018, 04:21
Contact:

Re: Connection is random between servers from the same host

Post by Harest »

I got half the issue explained here just a few hours ago. For the CCP (Christmas Calendar project by Mania Exchange) event, i opened 3 servers for the different used titlepacks by the mappers on December 1st. One was the RPG one but there's no RPG map this year so i closed it to open instead an Alpine server even if there's only one map.

What happened is that when i connected to the Alpine server which use the same port as the previous RPG one, instead of displaying the server id _Harest_CCP_Alpine, it was _Harest_CCP_RPG. It was only a display issue in the UI though as it did connect me correctly to the Alpine server.
erwinweber
Posts: 13
Joined: 21 Jun 2012, 19:53

Re: Connection is random between servers from the same host

Post by erwinweber »

Sorry for the late reply. I figured it out eventually.

My solution at the moment is to open the servers up manually one by one. So opening up the first server until it appears in the in-game servers list, then opening the other ones and so on. The problem I had was caused by both intentional and unintentional system reboots or container restarts. These would cause all the containers running the dedicated servers to start in bulk, leading to a really random mix up of the ports between the servers.

In case of a system failure I guess one solution could be a script that starts servers sequentially rather than in bulk, with a big sleep period between them. Doesn't really sound optimal, but I don't have other ideas at the moment.
Post Reply

Return to “Support and technical issues (not bug)”

Who is online

Users browsing this forum: No registered users and 1 guest