Project Zomboid - ADS applying incorrect default ports

OS Name/Version: Ubuntu Server 20.04.5 LTS

Product Name/Version: 2.4.0.10

Problem Description:
When applying Project Zomboid generic template from CubeCoders Git repo, new instance is applying ports:

Steam Port
GenericModule.App.Ports.$ApplicationPort1	
19132
UDP
Direct Port
GenericModule.App.Ports.$ApplicationPort2	
19133
UDP

Even after changing them to the correct ports listed online, and in Greelan’s configs game does not connect:

Steam Port
GenericModule.App.Ports.$ApplicationPort1	
16261
UDP
Direct Port
GenericModule.App.Ports.$ApplicationPort2	
16262
UDP

Steps to reproduce:

  1. Create new instance using generic template for Project Zomboid, set to not start after creating.
  2. Check port assignments. Find they are incorrect.

Actions taken to resolve so far:

  1. Found App.Ports item in GenericModule.kvp file of instance is set to the incorrect ports, while the App.AppSettings is correct as per the template file.
  2. Tried deleting and re-updating from Repo. Issue persists.
  3. Have repeatedly tried new test instances. In and out of docker.
  4. After adding 16261:16262 to ADS Application Port Ranges, template now applies correctly. Now instance will not start. Rebooted. Docker returned error code 125, but instance starts anyway. Server starts, still cannot connect. Getting server log:
LOG  : Network     , 1667161335501> 1,065,302> [30-10-22 20:22:15.501] > ZNet: SSteamSDK -> SZombienet: OnPolicyResponse
LOG  : Network     , 1667161335501> 1,065,302> [30-10-22 20:22:15.501] > ZNet: OnPolicyResponse
LOG  : Network     , 1667161335501> 1,065,302> [30-10-22 20:22:15.501] > ZNet: SZombienet -> SSteamSDK: BSecure
LOG  : Network     , 1667161335502> 1,065,303> [30-10-22 20:22:15.502] > ZNet: Zomboid Server is VAC Secure
LOG  : Network     , 1667161365397> 1,095,198> [30-10-22 20:22:45.397] > ZNet: SSteamSDK -> SZombienet: OnP2PSessionRequest
LOG  : Network     , 1667161365397> 1,095,199> [30-10-22 20:22:45.397] > ZNet: OnP2PSessionRequest: idx=1 SteamID=76561198034502266
LOG  : Network     , 1667161365398> 1,095,199> [30-10-22 20:22:45.398] > ZNet: SZombienet -> SSteamSDK: AcceptP2PSessionWithUser
LOG  : Network     , 1667161368804> 1,098,605> [30-10-22 20:22:48.804] > ZNet: SRakNet -> SZombienet: RakNetRecvFrom
LOG  : Network     , 1667161368804> 1,098,605> [30-10-22 20:22:48.804] > ZNet: SZombienet -> SZombienet: OnMsgVersionMessage
LOG  : Network     , 1667161368805> 1,098,606> [30-10-22 20:22:48.805] > ZNet: Client version=41.77.9 matches server version=41.77.9
LOG  : Network     , 1667161368805> 1,098,606> [30-10-22 20:22:48.805] > ZNet: hnote over SZombienet : **ZNetServerInfoMessage**
LOG  : Network     , 1667161368806> 1,098,607> [30-10-22 20:22:48.806] > ZNet: SZombienet -> SSteamSDK: SendP2PPacket
LOG  : Network     , 1667161395795> 1,125,596> [30-10-22 20:23:15.794] > ZNet: SSteamSDK -> SZombienet: OnP2PSessionConnectFail
LOG  : Network     , 1667161395795> 1,125,596> [30-10-22 20:23:15.795] > ZNet: OnP2PSessionConnectFail: "Timeout"

If you change “Port Assignment Mode” under Configuration->Networking to “Allow all except excluded” then you won’t have this issue with new instances - ADS will be able to assign ports as defined in the template.

You might have a firewall issue. Does ampinstmgr dumpfirewall run as root show entries for the PZ ports?

1 Like

The man. The Myth. The legend. He has arrived :upside_down_face:

I went ahead and changed “Port Assignment Mode” under Configuration->Networking to “Allow all except excluded”. The issue still persisted.

I went ahead and tested another known good instance, my MineCraft server and found it also wasn’t working. In both cases, I could access the game locally. I rebooted my network equipment, issue persisted. And then tried toggling port forwarding on my router, and now MineCraft is working. In PZ, I am now getting server information showing up, but I still can’t connect.

Still getting the timeout error.

You’re forwarding UDP for PZ rather than TCP?

1 Like

Yes sir
image

Gotta think it is some network issue if you can connect locally.

1 Like

I’m right with you. However, the known good was not working, and after applying reboots and toggles it is now working. And now the PZ server is outputting its server details, and I am seeing it connect in the server logs, but then times out.

I have found when running ss -tulpnss -tulpn on the host as root, it is still showing the incorrect port opened. I don’t think AMP is setting the firewall correctly on the host.