LsHallo / ets2-dedicated-convoy-server

Provides a docker container for ETS2/ATS multiplayer dedicated server.
Apache License 2.0
57 stars 11 forks source link

Server not visible in Convoy Browser #4

Closed dowmeister closed 1 year ago

dowmeister commented 1 year ago

Disclaimer i'm not using this project but came to same idea with a different implementation.

I'm hosting multiple servers in docker containers with --network host parameter but, not all of them are visible on Convoy Browser, i'm wondering if you have same experience and maybe can point me in the right direction.

Both virtual machines are with public IP and directly connected to Internet, same Datacenter, the Hosting provider assured they are not blocking anything on their side, traffic goes directly to the machine.

The Docker Container are running also an ExpressJs Server on port 80 and on both container HTTP traffic is working, the NodeJS app returns data so the traffic, in both case, is going to the container, at least on port 80.

I've tried also disabling completely UFW.

Both servers are naturally using a Server Token.

Working server:

UFW status:

ufw status verbose
Status: active
Logging: on (low)
Default: deny (incoming), allow (outgoing), allow (routed)
New profiles: skip

To                         Action      From
--                         ------      ----
22/tcp                     LIMIT IN    Anywhere                  
2375/tcp                   ALLOW IN    Anywhere                  
2376/tcp                   ALLOW IN    Anywhere                  
80                         ALLOW IN    Anywhere                  
27015                      ALLOW IN    Anywhere                  
27016                      ALLOW IN    Anywhere                  
22/tcp (v6)                LIMIT IN    Anywhere (v6)             
2375/tcp (v6)              ALLOW IN    Anywhere (v6)             
2376/tcp (v6)              ALLOW IN    Anywhere (v6)             
80 (v6)                    ALLOW IN    Anywhere (v6)             
27015 (v6)                 ALLOW IN    Anywhere (v6)             
27016 (v6)                 ALLOW IN    Anywhere (v6)   

Netstat:

sudo netstat -tulpn | grep LISTEN
tcp        0      0 0.0.0.0:22              0.0.0.0:*               LISTEN      775/sshd: /usr/sbin 
tcp        0      0 127.0.0.53:53           0.0.0.0:*               LISTEN      632/systemd-resolve 
tcp6       0      0 :::80                   :::*                    LISTEN      8153/node           
tcp6       0      0 :::22                   :::*                    LISTEN      775/sshd: /usr/sbin

Not visible server

UFW status (even more ports allowed):

ufw status verbose
Status: active
Logging: on (medium)
Default: allow (incoming), allow (outgoing), allow (routed)
New profiles: skip

To                         Action      From
--                         ------      ----
22/tcp                     LIMIT IN    Anywhere                  
2375/tcp                   ALLOW IN    Anywhere                  
2376/tcp                   ALLOW IN    Anywhere                  
80                         ALLOW IN    Anywhere                  
27015                      ALLOW IN    Anywhere                  
27016                      ALLOW IN    Anywhere                  
100                        ALLOW IN    Anywhere                  
101                        ALLOW IN    Anywhere                  
27015:27020/udp            ALLOW IN    Anywhere                  
27015:27020/tcp            ALLOW IN    Anywhere                  
100:101/tcp                ALLOW IN    Anywhere                  
100:101/udp                ALLOW IN    Anywhere                  
22/tcp (v6)                LIMIT IN    Anywhere (v6)             
2375/tcp (v6)              ALLOW IN    Anywhere (v6)             
2376/tcp (v6)              ALLOW IN    Anywhere (v6)             
80 (v6)                    ALLOW IN    Anywhere (v6)             
27015 (v6)                 ALLOW IN    Anywhere (v6)             
27016 (v6)                 ALLOW IN    Anywhere (v6)             
100 (v6)                   ALLOW IN    Anywhere (v6)             
101 (v6)                   ALLOW IN    Anywhere (v6)             
27015:27020/udp (v6)       ALLOW IN    Anywhere (v6)             
27015:27020/tcp (v6)       ALLOW IN    Anywhere (v6)             
100:101/tcp (v6)           ALLOW IN    Anywhere (v6)             
100:101/udp (v6)           ALLOW IN    Anywhere (v6)   

Netstat:

sudo netstat -tulpn | grep LISTEN
tcp        0      0 0.0.0.0:22              0.0.0.0:*               LISTEN      776/sshd: /usr/sbin 
tcp        0      0 127.0.0.53:53           0.0.0.0:*               LISTEN      633/systemd-resolve 
tcp6       0      0 :::22                   :::*                    LISTEN      776/sshd: /usr/sbin 
tcp6       0      0 :::80                   :::*                    LISTEN      36400/node       

The strange thing is, also using --network host, would expect to have the SteamCMD server listening on 27015 and 27016 from the host system but no, only the 80 is listening, but in the first case the server is visible in Convoy Sessions Browser.

Thanks for your time

LsHallo commented 1 year ago

I can see my ETS2 server port with netstat -tulpn. It is just not listed with LISTEN: udp 768 0 0.0.0.0:27016 0.0.0.0:* 1680859/eurotrucks2

Quick Notice: Your UFW seems a little pointless since your default rules allow everything. You don't need to open ports with your current settings.

My UFW settings:

root@ncp:~# ufw status verbose
Status: active
Logging: on (low)
Default: deny (incoming), allow (outgoing), deny (routed)
New profiles: skip

To                         Action      From
--                         ------      ----
[...]        
27015:27016/udp            ALLOW IN    Anywhere                   # ETS2
27015:27016/tcp            ALLOW IN    Anywhere                   # ETS2
[...]     
27015:27016/udp (v6)       ALLOW IN    Anywhere (v6)              # ETS2
27015:27016/tcp (v6)       ALLOW IN    Anywhere (v6)              # ETS2

Have you tried joining the invisible server using the search token displayed in the logs on startup? So you can verify that the server is even playable on?

For reference, my docker-compose.yml:

version: '3'

services:
  ets2:
    image: lshallo/ets2-convoy-server
    container_name: ets2
    restart: unless-stopped
    network_mode: host
    tty: true
    environment:
      - "ETS_SERVER_UPDATE_ON_START=true"
      - "ETS_SERVER_NAME=LsHallos Server"
      - "ETS_SERVER_DESCRIPTION=My Server"
      - "ETS_SERVER_PASSWORD=abc"
      - "ETS_SERVER_SERVICE_NO_COLLISION=false"
      - "ETS_SERVER_LOGON_TOKEN=abc"
      - "ETS_SERVER_MODERATORS=123"
dowmeister commented 1 year ago

Thanks for the quick reply.

I know that on the second server UFW rules are too broad, were only a lot of tentatives to open progressively ports and checking if it works.

Non visible server are totally playable.

image

Also on my side with only -tupln i can see it

netstat -tulpn
udp      768      0 0.0.0.0:27016           0.0.0.0:*                           1035/eurotrucks2_se 
udp        0      0 0.0.0.0:41430           0.0.0.0:*                           1035/eurotrucks2_se 

Adjusted UFW rules like yours cleaning the mess i've done before.. but nothing..

i see also traffic on 27016 when connected to the server.

netstat -tulpn
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address           Foreign Address         State       PID/Program name    
udp     1536      0 0.0.0.0:27016           0.0.0.0:*                           3409/eurotrucks2_se 
udp        0      0 0.0.0.0:51646           0.0.0.0:*                           3409/eurotrucks2_se 
LsHallo commented 1 year ago

I don't really know how to debug this properly. There is not really any logs. Maybe you have more luck in the ets2 official forums? It seems you already did: https://forum.scssoft.com/viewtopic.php?t=317287

While you're there you can maybe ask what the requirements are to get on the server list? It's vary vague at the moment.

dowmeister commented 1 year ago

Thank you anyway for your time. I'll try to get as much information i can :)

dowmeister commented 1 year ago

After few days i've discovered the trick (but forget to report it also here, sorry)

if you enable mods_optioning flag the server is visibile only with these settings:

https://media.discordapp.net/attachments/956994787091812382/1067900088732618864/image.png?width=1202&height=676

LsHallo commented 1 year ago

Okay that is interesting. Makes sense. But they could maybe grey out servers you can't join. But then again it's only relevant when trying to set up a new server. Thanks for the info!

marcaddeo commented 3 months ago

After few days i've discovered the trick (but forget to report it also here, sorry)

if you enable mods_optioning flag the server is visibile only with these settings:

https://media.discordapp.net/attachments/956994787091812382/1067900088732618864/image.png?width=1202&height=676

I'm having the same issue with my server not showing up in the server browser... But this image is no longer available, so not sure what the fix is 😅

LsHallo commented 3 months ago

I think it had something to do with the setting "Only show servers with mods" or something similar. Sadly I also don't remember the specifics. Otherwise the same advice still applies.

marcaddeo commented 3 months ago

I think it had something to do with the setting "Only show servers with mods" or something similar. Sadly I also don't remember the specifics. Otherwise the same advice still applies.

  • Try opening your firewall (UDP is important).
  • Try to join the server using the server search token displayed in the logs on startup.
  • Use docker host networking.
  • Check your router port forwarding.

What does the server search token look like? I don't see anything that says that in the logs.

LsHallo commented 3 months ago

Like this:

ets2  | [MP] Server created.
ets2  | [MP] =========================================================================
ets2  | [MP]
ets2  | [MP] Session search id: 85568392929016792/101
ets2  | [MP] Session name: LsHallos Server
ets2  | [MP] Session description: My Server
marcaddeo commented 3 months ago

Like this:

ets2  | [MP] Server created.
ets2  | [MP] =========================================================================
ets2  | [MP]
ets2  | [MP] Session search id: 85568392929016792/101
ets2  | [MP] Session name: LsHallos Server
ets2  | [MP] Session description: My Server

Interesting, mine does not include that. This is what I'm seeing:

uset g_rain_reflect_traffic "1"
uset g_rain_reflect_cache "1"
uset g_rain_reflection "3"
uset g_reflection_scale "0"
uset g_reflection "3"
uset g_grass_density "2"
uset g_veg_detail "2"
uset g_save_indicator "1"
uset g_game_version "0"
uset g_force_online_lscrs "0"
uset g_hw_info "1"
uset g_glass_debugging_level "0"
uset g_line_sort "0"
uset g_cargo_sort "0"
uset g_bloom_standard_deviation "0.5"
uset g_bloom_override "0"
uset g_bloom "1.0"
uset g_global_force_load_selector "0"
uset g_desktop_fadeout "60"
uset g_item_check_speed "-1"
uset g_debug_allocators "-1"
uset g_suspension_auto_reset "1"
uset g_upshift_coef "0.3"
uset g_downshift_coef "0.8"
uset g_minicon "0"
uset g_console_state "0"
uset g_console "0"
uset g_fps "0"
uset ui_tooltip_delay "0.4"
uset r_imgui_scale "1.0"
uset r_output "-1"
uset r_adapter "-1"
uset r_vsync "1"
uset r_color_space "auto"
uset r_color_mode "sdr"
uset r_anisotropy_factor "0.25"
uset r_texture_detail "0"
uset v_bug_break "0"
uset t_limit_fps_inactive "30"
uset t_limit_fps "300"
uset t_locked_fps "0"
uset t_averaging_window_duration "100"
uset t_averaging_window_length "10"
storing cvars
storing cvars
[lang] Language autodetection: 0
Selected language: en_gb
American Truck Simulator init ver.1.50.1.2s (rev. 81ebe9d276ec)
storing cvars
Banlist loading...
=== BAN LIST ===
================
dispatch
server_cfg
server
[mods] Active 0 mods (local: 0, workshop: 0)
[bullet] Starting physics server: Bullet
Trailer loading started...
Loaded trailers: 103
Loaded traffic trailers of type 'truck_semi': 33
Loaded traffic trailers of type 'truck_long': 5
Loaded traffic trailers of type 'train_cargo': 21
Loaded traffic trailers of type 'car': 12
Loaded traffic trailers of type 'bus': 0
Loaded traffic trailers of type 'truck': 91
Loaded traffic trailers of type 'tram': 15
Loaded traffic trailers of type 'train': 17
Loaded traffic trailers of type 'special': 0
Loaded traffic vehicles of type 'car': 37
Loaded traffic vehicles of type 'car_custom': 36
Loaded traffic vehicles of type 'truck': 0
Loaded traffic vehicles of type 'truck_light': 27
[S_API] SteamAPI_Init(): Loaded local 'steamclient.so' OK.
Loaded traffic vehicles of type 'truck_medium': 7
Loaded traffic vehicles of type 'truck_heavy': 5
Loaded traffic vehicles of type 'truck_long': 0
Loaded traffic vehicles of type 'truck_custom': 26
Loaded traffic vehicles of type 'bus': 5
Loaded traffic vehicles of type 'bus_custom': 6
Loaded traffic vehicles of type 'tram': 7
Loaded traffic vehicles of type 'train': 5
Loaded traffic vehicles of type 'train_wire': 1
Loaded traffic vehicles of type 'train_custom': 1
Loaded traffic vehicles of type 'police': 40
Loaded traffic vehicles of type 'fire': 14
Loaded traffic vehicles of type 'medical': 16
Loaded traffic vehicles of type 'escort_front': 0
Loaded traffic vehicles of type 'escort_back': 0
Loaded traffic vehicles of type 'special': 3
Loaded addon hookups: 37
[MP] =========================================================================
[MP] Session automated start
[MP] -------------------------------------------------------------------------
[MP] DLC - us_arizona
[MP] DLC - us_nevada
[MP] -------------------------------------------------------------------------
[MP] Server init
CAppInfoCacheReadFromDiskThread took 4 milliseconds to initialize
Setting breakpad minidump AppID = 270880
SteamInternal_SetMinidumpSteamID:  Caching Steam ID:  7xxxxxxxxxxxxxxx8 [API loaded no]
LsHallo commented 3 months ago

Hm that would at least explain why it is not visible. Seems like it is not starting correctly. I'm not at home right now so can't debug. Will get to it tomorrow. I also noticed you are using the ATS server? I didn't really test that one fully. If you could share a full log as a gist or attached file that would be good.

marcaddeo commented 3 months ago

@LsHallo thanks for your help. Here's a gist of the full output from a new container creation: https://gist.github.com/marcaddeo/73390f845a7cc339f4037f50acc9d90e

marcaddeo commented 3 months ago

@LsHallo okay, I believe I've resolved this by not setting the ETS_SERVER_BRANCH environment variable. And I was able to see that search string, but only when attaching to the container and checking the /home/steam/.local/share/American Truck Simulator/server.log.txt file. It never appears in the docker log even after I've gotten it working.

Alternatively, it may have been a combination of me making networking changes and possibly servers taking a minute to register in the browser?

LsHallo commented 3 months ago

Okay that seems somewhat strange. I'll still look into validating ATS more thoroughly. Glad that you could solve it. Setting the ETS_BRANCH variable should only be required if you want to play test (beta) versions.

LsHallo commented 3 months ago

I just verified ATS and it works for me without problem. So it really was that you set the ETS_SERVER_BRANCH variable.