Hackebein / docker-garrysmod

Dockerfiles for Garry's Mod
https://hub.docker.com/r/hackebein/garrysmod/
28 stars 2 forks source link

Server stuck at the "Network: ..." line #18

Closed Slebby closed 3 months ago

Slebby commented 3 months ago

Hi, I tried to start the server but it ends up stuck at the "Network: ..." line. I believe the output should end up with VAC secure mode.

Here is the output when i start the server:

************** WARNING ***************
Running the dedicated server as root  
is highly discouraged. It is generally
unnecessary to use root privileges to 
execute the dedicated server.         
**************************************

Auto detecting CPUntinue to launch in 1 secondss
Using default binary: ./srcds_linux
Server will auto-restart if there is a crash.
mount.cfg adding path: '/opt/steam/Steam'
mount.cfg adding path: '/opt/steam/cstrike'
mount.cfg adding path: '/opt/steam/hl2'
mount.cfg adding path: '/opt/steam/linux64'
Game_srv.so loaded for "Garry's Mod"
Setting breakpad minidump AppID = 4000
Initializing Steam libraries for Workshop..
[S_API] SteamAPI_Init(): Loaded local 'steamclient.so' OK.
CAppInfoCacheReadFromDiskThread took 0 milliseconds to initialize
SteamInternal_SetMinidumpSteamID:  Caching Steam ID:  76561197960265728 [API loaded no]
[S_API FAIL] Tried to access Steam interface SteamUser023 before SteamAPI_Init succeeded.
WS: No +host_workshop_collection or it is invalid!
Unknown command "cl_cmdrate"
Unknown command "cl_updaterate"
Unknown command "rate"
WARNING: Port 27015 was unavailable - bound to port 27016 instead
WARNING: Port 27005 was unavailable - bound to port 27006 instead
WARNING: Port 27020 was unavailable - bound to port 27021 instead
Network: IP 172.25.0.2, mode MP, dedicated Yes, ports 27016 SV / 27006 CL
_            <== When it reached to this point, it ends up not doing anything

Also, here is my docker compose file (the format might be a bit confusing due to that I use CasaOS):

name: reverent_chorok
services:
  main_app:
    cpu_shares: 90
    command: []
    container_name: garrys-mod-server
    deploy:
      resources:
        limits:
          memory: 31972M
    environment:
      - AUTHKEY=(removed)
      - MAP=gm_genesis
      - MAXPLAYERS=4
      - WORKSHOP=3297227676
      - WORKSHOPDL=3297227676
    hostname: garrys-mod-server
    image: hackebein/garrysmod:latest
    labels:
      icon: https://icon.casaos.io/main/all/garrysmod.png
    ports:
      - target: 27015
        published: "27015"
        protocol: ""
      - target: 27016
        published: "27016"
        protocol: ""
    restart: unless-stopped
    volumes:
      - type: bind
        source: /mnt/Storage1/CasaShare/garry-mod-server
        target: /opt/steam
    devices: []
    cap_add: []
    network_mode: bridge
    privileged: false
x-casaos:
  author: self
  category: self
  hostname: ""
  icon: https://icon.casaos.io/main/all/garrysmod.png
  index: /
  is_uncontrolled: false
  port_map: ""
  scheme: http
  store_app_id: reverent_chorok
  title:
    custom: Garry's Mod Server
Hackebein commented 3 months ago

At this point in log garrysmod loads your workshop collection. Try loading without workshop collection

Slebby commented 3 months ago

Alright, I will try. Can I just remove the ID in environment variable? or I need to remove addons in the directory folder?

Edit: can i add the addons later after the server works fine?

Hackebein commented 3 months ago

Yes you can remove the ID from both variables. Create a new container for each test. Garrysmod loads what is in the folder. doesn't matter where it comes from.

This will not work because of how steam works:

    source: /mnt/Storage1/CasaShare/garry-mod-server
    target: /opt/steam

unsupported behaviour. You can mount your config (ex. /opt/steam/garrysmod/cfg/server.cfg) or any other file or mount /opt/overlay (which is only copied into the server but not out).

Slebby commented 3 months ago

I tried doing what you said on mounting parts. The problem is that everytime I restart the server the volumes would change and download the assets again, which cause so much time just to start a same server and consume more storage. Is it intentional behaviors?

Here is what it looks like when I try to mount the file and folder according to your suggestion and from the example:

Screenshot 2024-07-28 022205

also, I tried install in a new container. The same issues still occurs.

Hackebein commented 3 months ago

The problem is that everytime I restart the server the volumes would change and download the assets again, which cause so much time just to start a same server and consume more storage. Is it intentional behaviors?

On restart the server updates. Do to it's nature of Garrysmod you have to update 2 packages which partially overwritting each other. But the server is not download all data. Only verify/update files. The Server downloads all files only on (re)creation.

APPS="4020 -language en,232330 -language en" if you set this, it starts a bit faster because it skips validation

I tried to start the server with your parameters. It works on my system.

Slebby commented 3 months ago

On restart the server updates. Do to it's nature of Garrysmod you have to update 2 packages which partially overwritting each other. But the server is not download all data. Only verify/update files. The Server downloads all files only on (re)creation.

Apparently, docker ends up create a new volumes for it. which make the Garrysmod download the packages again.

The unused one is the previous one (mark as red), while the other one (mark as black) is a new one that create after I restart docker or update some environment variable like this command below.

APPS="4020 -language en,232330 -language en"

here is the screenshot of it image

I tried to start the server with your parameters. It works on my system.

I have tried set the env APPS="4020 -language en,232330 -language en" as you said, the same issues still happened meaning there might be something wrong on my ends, which kinda odds since you said that it works fine on your system.

Hackebein commented 3 months ago

Docker should create a new volume if you create/recreate a new docker container (this happens already if you change an env variable). The Volume should be reused if you pull a newer container image.

I never used CasaOS. Sorry that i can't help you with that more. If you find anything new, let me know

Slebby commented 3 months ago

No Problem, Thanks for your time. I will try another way. I appreciated your helps.