lloesche / valheim-server-docker

Valheim dedicated gameserver with automatic update, World backup, BepInEx and ValheimPlus mod support
https://hub.docker.com/r/lloesche/valheim-server
Apache License 2.0
1.94k stars 272 forks source link

Question - (DEBUG) Valheim Server is not yet downloaded - waiting #184

Closed chrsolr closed 3 years ago

chrsolr commented 3 years ago

I use Docker for Mac and I keep getting "(DEBUG) Valheim Server is not yet downloaded - waiting" message on the logs.

docker-compose.yaml:

version: "3"

services: 
  valheim: 
    image: lloesche/valheim-server
    cap_add:
      - sys_nice
    volumes: 
      - $HOME/Documents/valheim/valheim-server/config:/config
      - $HOME/Documents/valheim/valheim-server/data:/opt/valheim
    ports: 
      - "2456-2458:2456-2458/udp"
      - "9001:9001/tcp"
    env_file:
      - $HOME/Documents/valheim/valheim-server/valheim.env
    restart: always

and valheim.env:

SERVER_NAME="Z8OTester"
WORLD_NAME=WORLD
SERVER_PASS=secret
SERVER_PUBLIC=true
lloesche commented 3 years ago

Can you paste the entire log? Without it I can just guess. Could it be one of OSX' new security features where not every process is allowed to read and write every directory on the system?

chrsolr commented 3 years ago
Creating network "valheim-server_default" with the default driver
Creating valheim-server_valheim_1 ... done
Attaching to valheim-server_valheim_1
valheim_1  | 2021-03-06 22:48:25,319 WARN No file matches via include "/etc/supervisor/conf.d/*.conf"
valheim_1  | 2021-03-06 22:48:25,320 INFO Set uid to user 0 succeeded
valheim_1  | 2021-03-06 22:48:25,335 INFO RPC interface 'supervisor' initialized
valheim_1  | 2021-03-06 22:48:25,336 INFO supervisord started with pid 1
valheim_1  | 2021-03-06 22:48:26,341 INFO spawned: 'valheim-bootstrap' with pid 13
valheim_1  | 2021-03-06 22:48:26 [13] (INFO) Setting timezone Etc/UTC
valheim_1  | 2021-03-06 22:48:26,373 INFO success: valheim-bootstrap entered RUNNING state, process has stayed up for > than 0 seconds (startsecs)
valheim_1  | 2021-03-06 22:48:26 [13] (DEBUG) Creating cron to do world backups using schedule 0 * * * *
valheim_1  | 2021-03-06 22:48:26 [13] (DEBUG) Creating cron to check for updates using schedule */15 * * * *
valheim_1  | 2021-03-06 22:48:26 [13] (DEBUG) Creating cron to restart valheim-server using schedule 0 5 * * *
valheim_1  | 2021-03-06 22:48:26,538 INFO spawned: 'syslogd' with pid 27
valheim_1  | Mar  6 22:48:26 118f478bf9a3 syslog.info syslogd started: BusyBox v1.32.1
valheim_1  | 2021-03-06 22:48:27,545 INFO success: syslogd entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
valheim_1  | syslogd: started
valheim_1  | 2021-03-06 22:48:27,698 INFO spawned: 'crond' with pid 29
valheim_1  | Mar  6 22:48:27 118f478bf9a3 cron.info crond[29]: crond (busybox 1.32.1) started, log level 8
valheim_1  | 2021-03-06 22:48:28,711 INFO success: crond entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
valheim_1  | crond: started
valheim_1  | 2021-03-06 22:48:28,861 INFO spawned: 'valheim-updater' with pid 31
valheim_1  | 2021-03-06 22:48:28 [31] (DEBUG) Running Valheim Server updater as user root uid 0
valheim_1  | 2021-03-06 22:48:29 [31] (DEBUG) Valheim updater was just started - skipping connected players check
valheim_1  | 2021-03-06 22:48:29 [31] (INFO) Downloading/updating/validating Valheim server from Steam
valheim_1  | Unable to determine CPU Frequency. Try defining CPU_MHZ.
valheim_1  |
valheim_1  | 2021-03-06 22:48:29 [31] (INFO) Valheim Server is already the latest version
valheim_1  | 2021-03-06 22:48:29 [31] (DEBUG) Writing file to start Valheim server
valheim_1  | 2021-03-06 22:48:29,542 INFO spawned: 'valheim-server' with pid 67
valheim_1  | 2021-03-06 22:48:29 [67] (DEBUG) Valheim Server is not yet downloaded - waiting
valheim_1  | 2021-03-06 22:48:30,584 INFO success: valheim-updater entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
valheim_1  | valheim-updater: started
valheim_1  | 2021-03-06 22:48:30,736 INFO spawned: 'valheim-backup' with pid 73
valheim_1  | 2021-03-06 22:48:30 [73] (INFO) Backing up Valheim server worlds to /config/backups/worlds-20210306-224830.zip
valheim_1  |   adding: worlds/ (stored 0%)
valheim_1  |   adding: worlds/BumVille.db (deflated 69%)
valheim_1  |   adding: worlds/BumVille.db.old (deflated 69%)
valheim_1  |   adding: worlds/BumVille.fwl2021-03-06 22:48:32,536 INFO success: valheim-backup entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
valheim_1  | valheim-backup: started
valheim_1  |  (deflated 5%)
valheim_1  |   adding: worlds/BumVille.fwl.old (deflated 5%)
valheim_1  |   adding: worlds/steam_autocloud.vdf2021-03-06 22:48:32,564 INFO exited: valheim-bootstrap (exit status 0; expected)
valheim_1  |  (stored 0%)
valheim_1  | 2021-03-06 22:48:32 [73] (INFO) Removing backups older than 3 days
valheim_1  | 2021-03-06 22:48:36 [67] (DEBUG) Valheim Server is not yet downloaded - waiting
valheim_1  | 2021-03-06 22:48:39,609 INFO success: valheim-server entered RUNNING state, process has stayed up for > than 10 seconds (startsecs)
valheim_1  | valheim-server: started
valheim_1  | 2021-03-06 22:48:43 [67] (DEBUG) Valheim Server is not yet downloaded - waiting

Can this be it? Unable to determine CPU Frequency. Try defining CPU_MHZ. ?

lloesche commented 3 years ago

Yea so the issue for you is that Steam is unable to download Valheim dedicated server on your system for whatever reason. It is straight up refusing to run.

The bug for me to fix is that we're not detecting the failed download correctly and instead of aborting the entire startup process think that Steam was successful in downloading the Valheim server.

What kind of system are you running the container on?

chrsolr commented 3 years ago

MacBook with Fresh install of macOS 10.15.7 Processor: 2.9 GHz Dual-Core Intel Core i7 Memory: 8GB

I'm using Docker for Mac to run the container. I don't know if that is what you need. Let me know if there anything else I can provide.

EDIT: In Docker for Mac I went to Preference -> Resources and increased the swap from 2 to 4 and now is downloading. Here are my current Resources:


CPUs: 2
Memory: 6GB
Swap: 4GB
Disk: 60GB
lloesche commented 3 years ago

Check https://github.com/lloesche/valheim-server-docker#system-requirements for our recommendations re hardware resources. Valheim server is pretty demanding, even when idle.

I'm still confused by the whole Unable to determine CPU Frequency. Try defining CPU_MHZ. thing. And even more that adding more swap changed something on Steams ability of determining your CPU Frequency 🙂

I pushed a PR that fixes the whole "not detecting when Steam fails to download" thing.

Is the container now working for you or are there still other issues?

lloesche commented 3 years ago

So according to "the Internet" this error Unable to determine CPU Frequency. Try defining CPU_MHZ. happens when /proc is not mounted and Steam can't read /proc/cpuinfo.

From https://www.reddit.com/r/Crostini/wiki/howto/install-steam

**Steam for Linux Errors:**  

Error: *Unable to determine CPU Frequency. Try defining CPU_MHZ.*  
Fix:  `export CPU_MHZ=<CPU_SPEED_in_MHZ>` 
Example: 1.5GHz owners would enter: *export CPU_MHZ=1500.000*  
Explanation: Error occurs when clock calibration fails on boot and cpu MHz output of /proc/cpuinfo is 0.000. This can be confirmed by `dmesg | grep -i tsc`. Steam doesn't like when the /proc/cpuinfo MHZ output is 0.000 and errors out but fortunately allows us to, instead, define the CPU_MHZ value. Seems this lack of cpu MHz output in /proc/cpuinfo is due to a race condition. At this time it is unknown if there is a way to force the clock calibration to try again, this would be ideal as it would correct the 0.000 cpu MHz output in /proc/cpuinfo and truly fix the issue rather than working around it by defining a superficial CPU_MHZ value just to make Steam happy.

So I might submit a PR that tries to read and set CPU_MHZ itself. I'm assuming the issue is resolved for you and will close it. If not feel free to open a new one. Hope the server works for you now and lots of fun playing Valheim! 🙂

chrsolr commented 3 years ago

The issue is resolved. I don't exactly why. I'mma do a new image download and run to see how it goes. Thanks for the help.

publicvirtualvoid commented 3 years ago

I'm currently seeing the same thing on a dual xeon. I've tried to recreate and change /opt/valheim into a volume. Anyone get to the bottom of this?

lloesche commented 3 years ago

@publicvirtualvoid can you attach the complete logs? From startup to error.