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

SRCDS Instances cannot be bound to 0.0.0.0 because of UI restriction #935

Closed
4 tasks done
Bryantdl7 opened this issue Oct 5, 2023 · 21 comments
Closed
4 tasks done

Comments

@Bryantdl7
Copy link

Bug Report

System Information

  • Operating System Windows 10
  • AMP version and build date (Always use the version number, 'latest' is not valid!): v2.4.6.6, built 05/10/2023 11:56
  • Which AMP release stream you're using: Mainline

I confirm:

  • that I have searched for an existing bug report for this issue.
  • that I am using the latest available version of AMP.
  • that my operating system is up-to-date.
  • that my checkboxes above look exactly like the one on the left with no extra spaces. Remove this line to confirm you can follow instructions - if this line shows up in the bug report then the whole report will be ignored

Symptoms

  • What are you trying to do?: Assign a srcds server to 0.0.0.0 allowing it to listen to all IP addresses
  • What are you expecting to happen?: The server to boot with the default settings of a new SRCDS instance
  • What is actually happening? ('Nothing' is not an acceptable answer!): I am greeted with an error saying "The srcds server must be bound to a specific IP address rather than 0.0.0.0 to function correctly in AMP. You can change this setting under Configuration -> Source Server Settings -> Server IP address."

Reproduction

Enter reproductions steps here.

  1. Create a new tf2 instance
  2. open the instance
  3. click update on the orange button
  4. once complete click start
  5. You'll be greeted with this lovely error

Assigning an SRCDS server to quad zero is a very common practice making the server listen on all IP addresses of the interface in question, it is supported by srcds itself, along with many other game server tools, such as SeDirector.

I believe there is a bug with linux-based SRCDS which dislikes certain IP assignments, but as the old valve documentation hints-but-never-confirms, windows (sadly) is the more ideal srcds platform. Perhaps instead of a hard failure change the flow of this to instead be a warning that can be bypassed? Maybe a check box in the source server settings saying allow 0.0.0.0?

Either way, the default for all SRCDS templates is to bind to 0.0.0.0, and for people to make a brand new server and always get an error isn't fun :)

@xLeviNx
Copy link

xLeviNx commented Oct 5, 2023

Yeah, its expected of the user to assign the IP which I prefer as a fellow scrds user

@Greelan
Copy link
Contributor

Greelan commented Oct 6, 2023

I agree with the OP, I've never understood the reason why the srcds module forces the binding

@PhonicUK
Copy link
Contributor

Not an issue. This is a deliberate design choice. The UDP logger does not work properly in SRCDS when it's bound to 0.0.0.0. This prevents AMP from monitoring the server or showing you any log output. The requirement to be bound to a specific IP is to avoid this issue and to allow AMP to work properly. The limitation isn't a UI issue or an arbritary restriction.

@Bryantdl7
Copy link
Author

Bryantdl7 commented Oct 15, 2023 via email

@Greelan
Copy link
Contributor

Greelan commented Oct 16, 2023

Not an issue. This is a deliberate design choice. The UDP logger does not work properly in SRCDS when it's bound to 0.0.0.0. This prevents AMP from monitoring the server or showing you any log output. The requirement to be bound to a specific IP is to avoid this issue and to allow AMP to work properly. The limitation isn't a UI issue or an arbritary restriction.

Presumably you're referring to logaddress_add needing to point to a specific IP to log to? That sounds more like a binding issue for the AMP endpoint receiving the logs, rather than the srcds server itself needing to bound to an IP?

More importantly, what does AMP use to receive and parse the logs, and can that be used with the generic module (thinking of CS2)?

@PhonicUK
Copy link
Contributor

Ok, can amp be reconfigured to not default to 0.0.0.0 then? Its not fun that SRCDS instances do not work with default settings and require manual intervention of some form. Oct 14, 2023 2:58:17 PM PhonicUK @.***>:

Yes, you can set the default application IP binding in ADSs network settings.

@PhonicUK
Copy link
Contributor

Presumably you're referring to logaddress_add needing to point to a specific IP to log to? That sounds more like a binding issue for the AMP endpoint receiving the logs, rather than the srcds server itself needing to bound to an IP?

More importantly, what does AMP use to receive and parse the logs, and can that be used with the generic module (thinking of CS2)?

There's a bug in srcds whereby logaddress_add doesn't work even with a specific IP if the game server itself is bound to 0.0.0.0. It's why it's an absolute pain because the game server IP binding alters its behaviour even though it's completely unrelated.

@Bryantdl7
Copy link
Author

Bryantdl7 commented Oct 20, 2023 via email

@Greelan
Copy link
Contributor

Greelan commented Oct 21, 2023

Presumably you're referring to logaddress_add needing to point to a specific IP to log to? That sounds more like a binding issue for the AMP endpoint receiving the logs, rather than the srcds server itself needing to bound to an IP?
More importantly, what does AMP use to receive and parse the logs, and can that be used with the generic module (thinking of CS2)?

There's a bug in srcds whereby logaddress_add doesn't work even with a specific IP if the game server itself is bound to 0.0.0.0. It's why it's an absolute pain because the game server IP binding alters its behaviour even though it's completely unrelated.

Any insights on my second question?

@PhonicUK
Copy link
Contributor

PhonicUK commented Dec 6, 2023

What AMP uses is a UDP logger source. So AMP receives those UDP packets.

@Greelan
Copy link
Contributor

Greelan commented Dec 6, 2023

...

I understand that. The question is how AMP receives the packets, and whether that can replicated in generic.

@Bryantdl7
Copy link
Author

Bryantdl7 commented Dec 6, 2023

Why doesnt amp just view the console the same way STEAMCMD is read into the AMP console? Then you don't need any networking at all. There's got to be a way to do it this way. Would make debugging issues way more verbose. In the current implementation developer 1 outputs aren't even made into the amp console.

I can understand potential limitations to this approach, but at least give us a toggle for viewing the console this way.

@PhonicUK
Copy link
Contributor

Why doesnt amp just view the console the same way STEAMCMD is read into the AMP console?

Because it doesn't work. Source games do not write data to standard output, they write it directly to the console display buffer which isn't readable. For SteamCMD AMP uses an ugly, unstable and unreliable hack that only works if you don't care about missing the odd line - which for getting download progress is fine but not for anything important.

@IceOfWraith
Copy link
Collaborator

It defaults to 0.0.0.0, which errors. Can it be defaulted to something else out of the box? Very well aware I can change it myself, but having a default value be something that isn't allowed doesn't make sense... Oct 20, 2023 9:18:52 AM PhonicUK @.>:

Ok, can amp be reconfigured to not default to 0.0.0.0 then? Its not fun that SRCDS instances do not work with default settings and require manual intervention of some form. Oct 14, 2023 2:58:17 PM PhonicUK /
@
/.
**>: Yes, you can set the default application IP binding in ADSs network settings. — Reply to this email directly, view it on GitHub[#935 (comment)], or unsubscribe[https://github.com/notifications/unsubscribe-auth/ABKOR5KQIN3MLSGNVR5NSELYAJ23RAVCNFSM6AAAAAA5UGN5AKVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTONZSG4ZDOMZYG4]. You are receiving this because you authored the thread. [Tracking image][https://github.com/notifications/beacon/ABKOR5NC6L43ONY3NJVYEADYAJ23RA5CNFSM6AAAAAA5UGN5AKWGG33NNVSW45C7OR4XAZNMJFZXG5LFINXW23LFNZ2KUY3PNVWWK3TUL5UWJTTJVGWFW.gif]

Looks like this question got overlooked. 0.0.0.0 is preferred for almost every game server out there. It's only an issue with SRCDS servers within AMP because of the need for the UDP Logging. AMP on Windows can read the console properly, but on Linux it cannot, so it relies on the logger as Mike stated. If instances are bound to specific IP addresses it can get messy. Servers with multiple network adapters or moving servers requires a lot of intervention as opposed to having it set to 0.0.0.0.

@IceOfWraith
Copy link
Collaborator

Here's a couple sources that back what is done by AMP. Unfortunately, it is a long-standing SRCDS bug. The only work around is that AMP be able to read the console in Linux, but that too seems to be a limitation of the game server.

https://github.com/stevenocchipinti/CS_Scoreboard#logging-statistics-on-localhost

https://github.com/startersclan/source-udp-forwarder#demo

@Greelan
Copy link
Contributor

Greelan commented Dec 19, 2023

Those links have alternative solutions?

@IceOfWraith
Copy link
Collaborator

Sorry, I'm not following. What solution are you wanting AMP to handle from those?

@Greelan
Copy link
Contributor

Greelan commented Dec 19, 2023

In one of them it suggests having the UDP logger endpoint as 0.0.0.0, and in the other it suggests using the hostname

@Greelan
Copy link
Contributor

Greelan commented Dec 19, 2023

Specifically for the first:

Start the gameserver with cvar logaddress_add_http "http://127.0.0.1:26999" for Counter-Strike 2, logaddress_add 0.0.0.0:26999 for srcds (srcds refuses to log to logaddress_add 127.0.0.1:<PORT> for some reason), or logaddress_add 127.0.0.1 26999 for hlds servers, and cvar log on, to ensure the gameserver send logs to source-udp-forwarder.

No mention of any binding limitations for the srcds server itself.

@IceOfWraith
Copy link
Collaborator

The hostname fix requires editing the hosts file so not really a useful solution for AMP.

I just tested 0.0.0.0 for the logaddress_add on Garry's Mod and 127.0.0.1 as the address for the UDP Logger to connect to and it didn't see any packets. I'm not sure that one is a fix. I'm open to be proven wrong though.

@PhonicUK
Copy link
Contributor

Maybe ::1 would work if the problems are specifically with localhost and 127.0.0.1 ? Or perhaps using something like 127.10.0.1 on both ends instead?

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

5 participants