Closed Shawak closed 3 years ago
Thank you for your report.
Couple of things to fix before we dig deeper.
Delete everything in your config directory. There is no need to create any config files. The server will create them for you.
The values you defined like
SERVER_NAME="ServerName"
SERVER_PORT=2456
WORLD_NAME=WorldName
...
those are environment variables. Check https://github.com/lloesche/valheim-server-docker/blob/main/docker-compose.yaml for an example of how to set them.
When you start the server for the first time, make sure that /config
and /opt/valheim
are empty(!) directories and that the container is allowed to write in them.
That should be all to get you going. Let me know if that already fixes it.
those are environment variables. Check https://github.com/lloesche/valheim-server-docker/blob/main/docker-compose.yaml for an example of how to set them.
Yeah I knew that, but I thought you can also set them in the config files. But I guess it doesn't matter, since the default port is the same and I tried to join with my servers IP address and that should work independent from my (missing) config settings.
So I changed my docker-compose.yml file to this:
version: '3.7'
services:
valheim:
image: lloesche/valheim-server
volumes:
- ./config:/config
- server-data-empty:/opt/valheim
ports:
- 2456-2458:2456-2458/udp
#network_mode: host
volumes:
server-data:
server-data-empty:
and moved my config folder to _config so the container can create an empty one; also I created a second volume for the server files in /opt/valheim and restarted everything agin.
But neither of that changed anything:
Mono path[0] = '/opt/valheim/server/valheim_server_Data/Managed'
Mono config path = '/opt/valheim/server/valheim_server_Data/MonoBleedingEdge/etc'
Preloaded 'libsteam_api.so'
Unable to load player prefs
Initialize engine version: 2019.4.20f1 (6dd1c08eedfa)
[Subsystems] Discovering subsystems at path /opt/valheim/server/valheim_server_Data/UnitySubsystems
Forcing GfxDevice: Null
GfxDevice: creating device client; threaded=0
NullGfxDevice:
Version: NULL 1.0 [1.0]
Renderer: Null Device
Vendor: Unity Technologies
Begin MonoManager ReloadAssembly
- Completed reload, in 0.199 seconds
UnloadTime: 1.576323 ms
02/27/2021 13:29:22: Starting to load scene:start
2021-02-27 13:29:33,026 INFO success: valheim-server entered RUNNING state, process has stayed up for > than 10 seconds (startsecs)
valheim-server: started
I got the same log output but the server is still not available, also my netstat output looks the same.
Simultaneously I ordered a new root server with two dedicated cores on a ryzen epyc 7702 and ran the example (which I also did on my other server at first):
docker run -d --name valheim-server -p 2456-2458:2456-2458/udp -e SERVER_NAME="My Server Test" -e WORLD_NAME="Neotopia" -e SERVER_PASS="secret" lloesche/valheim-server
And.. it instantly worked! I noticed that I got far more log output and it wont stuck on valheim-server: started
e.g.:
02/27/2021 13:46:16: Authentication:k_ESteamNetworkingAvailability_Waiting
02/27/2021 13:46:16: Steam game server initialized
02/27/2021 13:46:16: Missing audio clip in music respawn
02/27/2021 13:46:16: Builder started
02/27/2021 13:46:17: Loaded localization English
2021-02-27 13:46:17,134 INFO success: valheim-server entered RUNNING state, process has stayed up for > than 10 seconds (startsecs)
valheim-server: ERROR (not running)
valheim-server: started
Unloading 16 unused Assets to reduce memory usage. Loaded Objects now: 85969.
Total: 61.541711 ms (FindLiveObjects: 5.004483 ms CreateObjectMapping: 12.106630 ms MarkObjects: 44.125385 ms DeleteObjects: 0.294943 ms)
Unloading 6 Unused Serialized files (Serialized files now loaded: 0)
UnloadTime: 11.397881 ms
HDR Render Texture not supported, disabling HDR on reflection probe.
HDR Render Texture not supported, disabling HDR on reflection probe.
02/27/2021 13:46:17: Zonesystem Awake 178
02/27/2021 13:46:17: DungeonDB Awake 178
02/27/2021 13:46:17: Registering lobby
02/27/2021 13:46:17: Initializing world generator seed:Ezj4P0idxL ( -607781686 ) menu:False worldgen version:1
02/27/2021 13:46:17: Using mountain distance: 1000
02/27/2021 13:46:17: Found 512 mountain points
02/27/2021 13:46:17: Remaining mountains:70
02/27/2021 13:46:17: Calc time 21.1 ms
02/27/2021 13:46:17: Found 7986 lake points
02/27/2021 13:46:19: Remaining lakes:118
02/27/2021 13:46:19: Calc time 2095.028 ms
02/27/2021 13:46:19: Rivers:162
02/27/2021 13:46:19: River buckets 15498
02/27/2021 13:46:19: River render time 277.255 ms
02/27/2021 13:46:19: River Calc time 288.993 ms
02/27/2021 13:46:20: River buckets 23946
02/27/2021 13:46:20: River render time 444.832 ms
02/27/2021 13:46:20: Placed 1897 streams
02/27/2021 13:46:20: Stream Calc time 982.649 ms
02/27/2021 13:46:20: Load world Neotopia
02/27/2021 13:46:20: missing world.dat
02/27/2021 13:46:20: Audioman already exist, destroying self
Unloading 490 unused Assets to reduce memory usage. Loaded Objects now: 86302.
Total: 78.566061 ms (FindLiveObjects: 5.053225 ms CreateObjectMapping: 14.928500 ms MarkObjects: 54.881864 ms DeleteObjects: 3.691171 ms)
02/27/2021 13:46:24: Zonesystem Start 178
02/27/2021 13:46:25: Generating locations
02/27/2021 13:46:25: Checking for location duplicates
02/27/2021 13:46:50: Failed to place all MountainWell1, placed 22 out of 25
02/27/2021 13:46:53: Failed to place all Runestone_Mountains, placed 84 out of 100
02/27/2021 13:46:53: Done generating locations, duration:28337.88 ms
02/27/2021 13:46:53: DungeonDB Start 178
02/27/2021 13:46:53: Game server connected
So I guess it was just a resource problem. I hope my issue can help anyone with similar issues.
My final docker-compose.yml looks like this:
version: '3.7'
services:
valheim:
image: lloesche/valheim-server
container_name: valheim-server
restart: unless-stopped
volumes:
- ./config:/config
- server-data:/opt/valheim
ports:
- 2456-2458:2456-2458/udp
environment:
- SERVER_NAME=My server
- SERVER_PASS=secret
- SERVER_PUBLIC=1
- WORLD_NAME=World
volumes:
server-data:
Thanks!
So I just tried to setup a valheim server but the server doesn't start correctly.
valheim/docker-compose.yml
valheim/config/config.cfg (there is also a valheim.cfg with the same content, because I couldn't figure out what the correct naming is)
Log
The CPU then starts running at 100%. It's only a small VPS so that's maybe the problem? But I am kinda curious about netstat not even showing a LISTEN state on desired ports.