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

Cannot start server #8

Closed
geman220 opened this issue Mar 29, 2023 · 20 comments
Closed

Cannot start server #8

geman220 opened this issue Mar 29, 2023 · 20 comments

Comments

@geman220
Copy link

Compiled fine on Ubuntu 22.04, but cannot start due to the following error:

~/BeatUpRcelyte$ ./beatupserver [net.c] Failed to open TCP socket: Address family not supported by protocol

Here is my beatupserver.json (Obviously my address is my public IPv4 address normally)
{ "instance": { "address": ["11.111.11.111", "[::]"], "count": 1 }, "master": {}, "status": { "url": "http://localhost" } }

@rcelyte
Copy link
Owner

rcelyte commented Mar 29, 2023

Might be an IPv6 issue. Try running with ./beatupserver --ipv4

@geman220
Copy link
Author

Thanks, it was due to IPv6 being disabled on my Ubuntu install. Enabling IPv6 resolved the issue. I would assume passing --ipv4 would have resolved it as well. That being said, going to myip:5000 doesn't work (port is forwarded) and in the console I see the following on each page refresh:

[wire.c] wire_accept(9) failed

@rcelyte
Copy link
Owner

rcelyte commented Mar 29, 2023

The website is hosted on port 80. Port 5000 is the lobby host.

@geman220
Copy link
Author

Is it possible to run the website on a different port? With localhost:port?

@rcelyte
Copy link
Owner

rcelyte commented Mar 29, 2023

yes.

@geman220
Copy link
Author

I appreciate the help, just to validate my Beat Together.json should read as follows:

{ "SelectedServer": "SelfHost", "Servers": [ { "ServerName": "SelfHost", "HostName": "MediaServer", "Port": 5000, "StatusUri": "http://myDNS:3131/status", } ] }

@rcelyte
Copy link
Owner

rcelyte commented Mar 29, 2023

  • HostName should be the IP or domain name of the server
  • Port should be 2328
  • drop the /status in StatusUri

@geman220
Copy link
Author

The HostName should be the IP or domain name of the server, where? Like the WAN side IP / Domain or the LAN side IP / Domain name.

@rcelyte
Copy link
Owner

rcelyte commented Mar 29, 2023

The same domain you set in StatusUri

@geman220
Copy link
Author

geman220 commented Mar 29, 2023

Can't connect in Beat Saber, the server is unreachable. It could be a NAT hairpin issue potentially.

I'm assuming this json is accurate at least. If it's a hairpin issue I should be able to use my LAN IPs, and send this config to others.

{ "ServerName": "SelfHost", "HostName": "domainname.duckdns.org", "Port": 2328, "StatusUri": "http://domainname.duckdns.org:3131", "MaxPartySize": 5 } ] }

Edit: Should mention 3131 is forwarded and working, I forwarded 2328 as well.

@rcelyte
Copy link
Owner

rcelyte commented Mar 29, 2023

Did you forward 5000 (note that 5000 and 2328 are UDP ports)?

@geman220
Copy link
Author

Yes 5000, 3131, and 2328 are all forwarded to 192.168.0.37 TCP/UDP

@geman220
Copy link
Author

So I setup the .json to use local IPs on the LAN, which I assume should work (obviously only locally and not over WAN but just to validate configuration). I see this error in the console:

[master.c] BAD MESSAGE TYPE: 0 is spammed a lot followed by:

[master.c] BAD MESSAGE TYPE: 0 [master.c] Invalid serial length: 11864 [pool.c] 1 room open [wire.c] wire_send_local(WireRoomSpawn) [instance.c] opening room (0,0) [instance.c] state (none) -> Lobby.Idle [net.c] MTU 0 -> 445 [instance.c] connect [::ffff:192.168.0.68]:60948 [instance.c] player slots (1/4): [⠁] [wire.c] wire_send_local(WireRoomSpawnResp) [master.c] Sending player to room A

@rcelyte
Copy link
Owner

rcelyte commented Mar 29, 2023

What error (CFR-, MUR-, DCR-) specifically does Beat Saber give you? Does it work with the address field in beatupserver.json set to the server's local IP instead of public?

@geman220
Copy link
Author

domainname.duckdns.org

CFR-3 Server Unreachable

@geman220
Copy link
Author

[master.c] Invalid serial length: 11864
[pool.c] 1 room open
[wire.c] wire_send_local(WireRoomSpawn)
[instance.c] opening room (0,0)
[instance.c] state (none) -> Lobby.Idle
[net.c] MTU 0 -> 445
[instance.c] connect [::ffff:192.168.0.68]:51657
[instance.c] player slots (1/4): [⠁]
[wire.c] wire_send_local(WireRoomSpawnResp)
[master.c] Sending player to room A
[wire.c] wire_accept(6) failed
[instance.c] session timeout
[instance.c] disconnect AF_UNSPEC
[instance.c] player slots (0/4): [⠀]
[instance.c] closing room (0,0)
[wire.c] wire_send_local(WireRoomCloseNotify)
[pool.c] 0 rooms open

Seems like I'm connecting, it's saying 1/4, trying to send me to Room A then fails.

@rcelyte
Copy link
Owner

rcelyte commented Mar 29, 2023

CFR-3 means the instance's address is either set wrong or unreachable due to firewall issues and such.

@geman220
Copy link
Author

Do the session logs not imply that I am successfully connecting here?

[instance.c] connect [::ffff:192.168.0.68]:51657
[instance.c] player slots (1/4): [⠁]
[wire.c] wire_send_local(WireRoomSpawnResp)
[master.c] Sending player to room A

I am certain the ports are forwarded, I've also validated again here https://canyouseeme.org/

@rcelyte
Copy link
Owner

rcelyte commented Mar 29, 2023

All those messages come from the master server connection. Your game's messages are never reaching the instance.

@geman220
Copy link
Author

Resolved, the issue was address on the beatupserver.json was set to my WAN IP. I assumed that wouldn't be an issue since it's a local file I don't care about obscuring it at all, but if you use a DNS in BeatTogether.json you also need to use DNS in beatupserver.json

Thanks for the help!

@rcelyte rcelyte closed this as completed Mar 29, 2023
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

2 participants