Skip to content

BACKUPS_IF_IDLE=false prevents automated backups: player check fails completely (both with and without crossplay) #773

@TorstenAden

Description

@TorstenAden

Bug Description:
When setting BACKUPS_IF_IDLE=false, the automated backups never trigger. The backup script incorrectly assumes the server is empty (0 players) and skips the backup, even when players are actively playing. This happens regardless of whether crossplay is enabled or disabled.

Environment:

  • Image: lloesche/valheim-server
  • Platform: Ugreen NAS (Docker)
  • Network Mode: Host
  • Game clients: PC

The Root Cause:
The backup script relies on checking network sockets (UDP 2456) to determine if players are online. This method no longer works reliably for modern Valheim connections in this environment. The socket check returns 0 active connections, which causes the cron job to abort.

The server log clearly registers the connections correctly:
"Player joined server "ServerName" that has join code XXXXXX, now 1 player(s)"

Expected Behavior:
The backup script should accurately detect connected players. Since checking network ports is no longer reliable for Valheim, a robust fix would be to have the script parse the valheim-server log for the current player count, rather than relying on socket checks.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions