JamesIves / hlds-docker

🐋 📦 Half-Life Dedicated Server powered by Docker. It supports all the classic GoldSrc Half-Life games and mods, including the ability to add custom configurations and plugins.
https://jamesiv.es/blog/experiment/docker/2024/06/20/half-life-dedicated-server-with-docker
MIT License
18 stars 1 forks source link

bug 🐝: config directory isn't passing nested directories properly #33

Closed csd-was-taken closed 1 month ago

csd-was-taken commented 1 month ago

What happened?

first off, it's entirely possible this is user error. im not super familiar with linux stuff or docker. but according to the docs, the config folder should be mapped to the game's directory (in my case, the valve folder).

motd.txt works properly, but any maps i place inside refuse to load (vanilla maps work fine). i've tried both dm_rats (which is entirely self contained in the bsp), and my doom e1m1 map (which has additional files beyond the map, that would need sent to the client)

image

image

image

image

Approach

I am using a pre-built image on Dockerhub (jives/hlds)

What games are you trying to run?

Half-Life Deathmatch (valve)

Do you have custom server configs or mods installed?

Docker Logs

{"log":"rsync: link_stat \"/temp/mods/*\" failed: No such file or directory (2)\n","stream":"stderr","time":"2024-09-19T01:42:02.79340289Z"}
{"log":"rsync error: some files/attrs were not transferred (see previous errors) (code 23) at main.c(1196) [sender=3.1.2]\n","stream":"stderr","time":"2024-09-19T01:42:02.795442038Z"}
{"log":"skipping directory gfx\n","stream":"stdout","time":"2024-09-19T01:42:02.797352297Z"}
{"log":"skipping directory maps\n","stream":"stdout","time":"2024-09-19T01:42:02.79740253Z"}
{"log":"skipping directory models\n","stream":"stdout","time":"2024-09-19T01:42:02.797405556Z"}
{"log":"skipping directory sound\n","stream":"stdout","time":"2024-09-19T01:42:02.797436903Z"}
{"log":"skipping directory sprites\n","stream":"stdout","time":"2024-09-19T01:42:02.797441252Z"}
{"log":"\n","stream":"stdout","time":"2024-09-19T01:42:02.799204618Z"}
{"log":"                          ..::::::..              \n","stream":"stdout","time":"2024-09-19T01:42:02.799223643Z"}
{"log":"                      :-=++++++++++++=-:          \n","stream":"stdout","time":"2024-09-19T01:42:02.799226999Z"}
{"log":"                  :=++++=--::...::-=++++=:       \n","stream":"stdout","time":"2024-09-19T01:42:02.799229764Z"}
{"log":"                :=+++=:              :-++++:     \n","stream":"stdout","time":"2024-09-19T01:42:02.7992327Z"}
{"log":"                =+++-     =====:         -+++=    \n","stream":"stdout","time":"2024-09-19T01:42:02.799235335Z"}
{"log":"              ++++.      ===+++.         .=+++   \n","stream":"stdout","time":"2024-09-19T01:42:02.799243721Z"}
{"log":"              =+++           :+++           =+++  \n","stream":"stdout","time":"2024-09-19T01:42:02.799246295Z"}
{"log":"            :+++.           -+++=          .+++: \n","stream":"stdout","time":"2024-09-19T01:42:02.7992488Z"}
{"log":"            =++=           =+++++-          =++= \n","stream":"stdout","time":"2024-09-19T01:42:02.799251395Z"}
{"log":"            =++-         .=++-:+++:         -+++ \n","stream":"stdout","time":"2024-09-19T01:42:02.79925389Z"}
{"log":"            =++=        .+++-  -+++.        =++= \n","stream":"stdout","time":"2024-09-19T01:42:02.799256414Z"}
{"log":"            :+++.      :+++.    =+++       .+++: \n","stream":"stdout","time":"2024-09-19T01:42:02.799258979Z"}
{"log":"              =+++     =++=.      ++++++=   =++=  \n","stream":"stdout","time":"2024-09-19T01:42:02.799261534Z"}
{"log":"              =+++.  -==-        .+++=-: .=+++   \n","stream":"stdout","time":"2024-09-19T01:42:02.799264119Z"}
{"log":"                =+++-.                   -+++=    \n","stream":"stdout","time":"2024-09-19T01:42:02.799266624Z"}
{"log":"                :=+++=:              :=+++=:     \n","stream":"stdout","time":"2024-09-19T01:42:02.799269128Z"}
{"log":"                  :=+++++=-::..::-=+++++=:       \n","stream":"stdout","time":"2024-09-19T01:42:02.799271663Z"}
{"log":"                      :-=++++++++++++=-:          \n","stream":"stdout","time":"2024-09-19T01:42:02.799274168Z"}
{"log":"                          ..::::::..              \n","stream":"stdout","time":"2024-09-19T01:42:02.799276682Z"}
{"log":"\n","stream":"stdout","time":"2024-09-19T01:42:02.799279196Z"}
{"log":"                          hlds-docker \n","stream":"stdout","time":"2024-09-19T01:42:02.799281661Z"}
{"log":"\n","stream":"stdout","time":"2024-09-19T01:42:02.799284185Z"}
{"log":"====================================================================\n","stream":"stdout","time":"2024-09-19T01:42:02.79928664Z"}
{"log":"💿 Image: jives/hlds:valve-v1.3.0\n","stream":"stdout","time":"2024-09-19T01:42:02.799289315Z"}
{"log":"📎 Version: v1.3.0\n","stream":"stdout","time":"2024-09-19T01:42:02.799292661Z"}
{"log":"🎮 Game: valve\n","stream":"stdout","time":"2024-09-19T01:42:02.799295196Z"}
{"log":"====================================================================\n","stream":"stdout","time":"2024-09-19T01:42:02.799297701Z"}
{"log":"\n","stream":"stdout","time":"2024-09-19T01:42:02.799300286Z"}
{"log":"â–„â–„ LINKS â–„â–„â–„â–„â–„â–„â–„â–„â–„â–„â–„â–„â–„â–„â–„â–„â–„â–„â–„â–„â–„â–„â–„â–„â–„â–„â–„â–„â–„â–„â–„â–„â–„â–„â–„â–„â–„â–„â–„â–„â–„â–„â–„â–„â–„â–„â–„â–„â–„â–„â–„â–„â–„â–„â–„â–„â–„â–„â–„\n","stream":"stdout","time":"2024-09-19T01:42:02.79930278Z"}
{"log":"â–ˆ                                                                  â–ˆ\n","stream":"stdout","time":"2024-09-19T01:42:02.799323599Z"}
{"log":"█  🔧 Maintained by Jives: https://jives.dev                       █\n","stream":"stdout","time":"2024-09-19T01:42:02.799326435Z"}
{"log":"█  💖 Support: https://github.com/sponsors/JamesIves               █\n","stream":"stdout","time":"2024-09-19T01:42:02.79932907Z"}
{"log":"█  🔔 Feedback / Issues: https://github.com/JamesIves/hlds-docker  █\n","stream":"stdout","time":"2024-09-19T01:42:02.799331695Z"}
{"log":"â–ˆ                                                                  â–ˆ\n","stream":"stdout","time":"2024-09-19T01:42:02.799334259Z"}
{"log":"▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀\n","stream":"stdout","time":"2024-09-19T01:42:02.799336903Z"}
{"log":"\n","stream":"stdout","time":"2024-09-19T01:42:02.799339859Z"}
{"log":"\u001b[32mStarting Half-Life Dedicated Server...\u001b[0m\n","stream":"stdout","time":"2024-09-19T01:42:02.799405501Z"}
{"log":"Auto-restarting the server on crash\n","stream":"stdout","time":"2024-09-19T01:42:02.802715861Z"}
{"log":"\n","stream":"stdout","time":"2024-09-19T01:42:02.805854211Z"}
{"log":"Console initialized.\n","stream":"stdout","time":"2024-09-19T01:42:02.805905097Z"}
{"log":"Using breakpad crash handler\n","stream":"stderr","time":"2024-09-19T01:42:02.80592325Z"}
{"log":"Setting breakpad minidump AppID = 70\n","stream":"stderr","time":"2024-09-19T01:42:02.805981849Z"}
{"log":"Forcing breakpad minidump interfaces to load\n","stream":"stderr","time":"2024-09-19T01:42:02.805995444Z"}
{"log":"Looking up breakpad interfaces from steamclient\n","stream":"stderr","time":"2024-09-19T01:42:02.835542758Z"}
{"log":"Calling BreakpadMiniDumpSystemInit\n","stream":"stderr","time":"2024-09-19T01:42:02.83557613Z"}
{"log":"09/19 01:42:02 minidumps folder is set to /tmp/dumps\n","stream":"stderr","time":"2024-09-19T01:42:02.835580869Z"}
{"log":"09/19 01:42:02 Init: Installing breakpad exception handler for appid(70)/version(9907)/tid(19)\n","stream":"stderr","time":"2024-09-19T01:42:02.835584586Z"}
{"log":"Protocol version 48\n","stream":"stdout","time":"2024-09-19T01:42:02.846580415Z"}
{"log":"Exe version 1.1.2.2/Stdio (valve)\n","stream":"stdout","time":"2024-09-19T01:42:02.846630138Z"}
{"log":"Exe build: 23:25:09 Dec  9 2023 (9907)\n","stream":"stdout","time":"2024-09-19T01:42:02.846635177Z"}
{"log":"STEAM Auth Server\r\n","stream":"stdout","time":"2024-09-19T01:42:02.846931357Z"}
{"log":"Server logging data to file logs/L0919000.log\n","stream":"stdout","time":"2024-09-19T01:42:02.847854302Z"}
{"log":"L 09/19/2024 - 01:42:02: Log file started (file \"logs/L0919000.log\") (game \"valve\") (version \"48/1.1.2.2/Stdio/9907\")\n","stream":"stdout","time":"2024-09-19T01:42:02.847867356Z"}
{"log":"Server IP address 172.18.0.2:27015\n","stream":"stdout","time":"2024-09-19T01:42:02.848331919Z"}
{"log":"map change failed: 'dm_rats' not found on server.\n","stream":"stdout","time":"2024-09-19T01:42:02.855646749Z"}
{"log":"\n","stream":"stdout","time":"2024-09-19T01:42:02.855732659Z"}
{"log":"L 09/19/2024 - 01:42:02: Server cvar \"sv_contact\" = \"https://github.com/JamesIves/hlds-docker/issues\"\n","stream":"stdout","time":"2024-09-19T01:42:02.856773141Z"}

Docker Command

hlds:
    # 📣 Adjust the image value here with the desired game you want the server to use. Options include:
    # 🔧 jives/hlds:valve (Half-Life Deathmatch)
    # 🔧 jives/hlds:cstrike (Counter-Strike)
    # 🔧 jives/hlds:czero (Counter-Strike: Condition Zero)
    # 🔧 jives/hlds:dmc (Deathmatch Classic)
    # 🔧 jives/hlds:gearbox (Half-Life Opposing Force)
    # 🔧 jives/hlds:ricochet (Ricochet)
    # 🔧 jives/hlds:dod (Day of Defeat)
    # 🔧 jives/hlds:tfc (Team Fortress Classic)
    # 🔧 jives/hlds:valve-legacy (Half-Life Deathmatch) (Pre 25th Anniversary Edition)
    # 🔧 jives/hlds:cstrike-legacy (Counter-Strike) (Pre 25th Anniversary Edition)
    # 🔧 jives/hlds:czero-legacy (Counter-Strike: Condition Zero) (Pre 25th Anniversary Edition)
    image: jives/hlds:valve
    # 📣 Learn more about these volumes in the advanced setup guides: https://github.com/JamesIves/hlds-docker?tab=readme-ov-file#advanced-setup-%EF%B8%8F
    volumes:
      - "./config:/temp/config"
      - "./mods:/temp/mods"
    ports:
      - "27015:27015/udp"
      - "27015:27015"
      - "26900:2690/udp"
    environment:
      - GAME=valve
    # 📣 Modify your server startup commands here, you can add more FLAG as needed (see: https://developer.valvesoftware.com/wiki/Half-Life_Dedicated_Server),
    # 📣 Remember: Stating map is based on the game, and will likely be different between images.
    # 📣 You should also modify the rcon_password value so you can use server admin commands.
    command: +log on +rcon_password "test123" +maxplayers 12 +map dm_rats
JamesIves commented 1 month ago

Can you try creating a file named mapcycle.txt in your config directory and add the map name to it minus the file extension? The files should be properly mapped especially if the motd.txt file worked 🤔. It could be that the map startup command only recognizes items in the mapcycle.

If that doesn't work, run:

  1. "docker ps" with the container running and get the container id
  2. "docker exec it -bash " - this will ssh into the container.
  3. Run cd "hlds/valve/maps"
  4. Verify the map files are actually there. If they aren't, it might be that something else is missing.
csd-was-taken commented 1 month ago

added them to the mapcycle, still doesn't load properly

docker exec it -bash [ID] spits me the error OCI runtime exec failed: exec failed: unable to start container process: exec: "-bash": executable file not found in $PATH: unknown, but docker exec -it [ID] sh gets me into it

and yup, looks like my maps aren't getting put into the proper folder (dm_rats.bsp, doom_E1M1.bsp, and doom_E1M1.res should all be in here)

image

JamesIves commented 1 month ago

Ah yeah, got a hunch on the cause of this. Can you try the jives/hlds-beta image and try again? I made a patch against the rsync command but I'm not near a computer to validate myself.

csd-was-taken commented 1 month ago

jives/hlds-beta doesn't seem to exist on dockerhub?

JamesIves commented 1 month ago

Oh oops sorry, tag name should be jives/hlds:valve-beta

csd-was-taken commented 1 month ago

yup! that works perfectly

JamesIves commented 1 month ago

Pushed up a fix for this in 1.4.0: https://github.com/JamesIves/hlds-docker/releases/tag/v1.4.0

You can pull the changes automatically by doing a fresh docker pull on jives/hlds:valve