Didstopia / rust-server

Provides a dedicated linux server for Rust (the game) running inside a Docker container.
MIT License
243 stars 105 forks source link

Error: Unable to open log file, exiting. #88

Closed HalfEatenPie closed 3 years ago

HalfEatenPie commented 3 years ago

Describe the bug Unable to start rust-server with base configuration due to an error that seems to be resolved previously but is recurring now. #59

To Reproduce Steps to reproduce the behavior:

  1. Fresh installation of Ubuntu 20.04 64-bit LTS
  2. Follow the instructions in the tutorial: https://rust.didscraft.com/rust-server-on-linux-using-docker/
  3. Get to the phase of running the following command: /usr/bin/docker run -p 28015:28015 -p 28015:28015/udp -p 28016:28016 -p 8080:8080 --name rust-server --env-file /rust.env -v /rust:/steamcmd/rust --rm didstopia/rust-server
  4. Error in the console logs

Expected behavior Vanilla Rust server is up

Screenshots Here is an output of the console logs:


╔═════════════════════════════════════════════════╗
║    _____  _     _     _              _          ║
║   |  __ \(_)   | |   | |            (_)         ║
║   | |  | |_  __| |___| |_ ___  _ __  _  __ _    ║
║   | |  | | |/ _| / __| __/ _ \| |_ \| |/ _| |   ║
║   | |__| | | (_| \__ \ || (_) | |_) | | (_| |   ║
║   |_____/|_|\__|_|___/\__\___/| |__/|_|\__|_|   ║
║                               | |               ║
║                               |_|               ║
╠═════════════════════════════════════════════════╣
║ You are using an image that is based on         ║
║ a base image maintained by Didstopia.           ║
║                                                 ║
║ For more information:                           ║
║ https://github.com/Didstopia/docker-base-images ║
╚═════════════════════════════════════════════════╝

Running as user: docker
Installing/updating steamcmd..
Installing or updating Rust.. (this might take a while, be patient)
Redirecting stderr to '/app/Steam/logs/stderr.txt'
[  0%] Checking for available updates...
[  0%] Downloading update (0 of 77,558 KB)...
[  0%] Downloading update (4,548 of 77,558 KB)...
[  5%] Downloading update (9,200 of 77,558 KB)...
[ 11%] Downloading update (13,244 of 77,558 KB)...
[ 17%] Downloading update (15,958 of 77,558 KB)...
[ 20%] Downloading update (20,093 of 77,558 KB)...
[ 25%] Downloading update (24,227 of 77,558 KB)...
[ 31%] Downloading update (28,393 of 77,558 KB)...
[ 36%] Downloading update (32,503 of 77,558 KB)...
[ 41%] Downloading update (36,657 of 77,558 KB)...
[ 47%] Downloading update (40,752 of 77,558 KB)...
[ 52%] Downloading update (44,784 of 77,558 KB)...
[ 57%] Downloading update (47,597 of 77,558 KB)...
[ 61%] Downloading update (50,049 of 77,558 KB)...
[ 64%] Downloading update (52,128 of 77,558 KB)...
[ 67%] Downloading update (54,148 of 77,558 KB)...
[ 69%] Downloading update (56,243 of 77,558 KB)...
[ 72%] Downloading update (58,322 of 77,558 KB)...
[ 75%] Downloading update (60,613 of 77,558 KB)...
[ 78%] Downloading update (62,675 of 77,558 KB)...
[ 80%] Downloading update (64,743 of 77,558 KB)...
[ 83%] Downloading update (66,804 of 77,558 KB)...
[ 86%] Downloading update (68,874 of 77,558 KB)...
[ 88%] Downloading update (70,948 of 77,558 KB)...
[ 91%] Downloading update (73,211 of 77,558 KB)...
[ 94%] Downloading update (75,272 of 77,558 KB)...
[ 97%] Downloading update (77,356 of 77,558 KB)...
[ 99%] Downloading update (77,558 of 77,558 KB)...
[100%] Download complete.
[----] Installing update...
[----] Extracting package...
[----] Extracting package...
[----] Extracting package...
[----] Extracting package...
[----] Installing update...
[----] Installing update...
[----] Installing update...
[----] Installing update...
[----] Installing update...
[----] Installing update...
[----] Installing update...
[----] Installing update...
[----] Cleaning up...
[----] Update complete, launching %appname%...
Redirecting stderr to '/app/Steam/logs/stderr.txt'
[  0%] Checking for available updates...
[----] Downloading update (0 of 51,663 KB)...
[  0%] Downloading update (1,267 of 51,663 KB)...
[  2%] Downloading update (5,022 of 51,663 KB)...
[  9%] Downloading update (7,919 of 51,663 KB)...
[ 15%] Downloading update (10,387 of 51,663 KB)...
[ 20%] Downloading update (12,858 of 51,663 KB)...
[ 24%] Downloading update (15,330 of 51,663 KB)...
[ 29%] Downloading update (17,804 of 51,663 KB)...
[ 34%] Downloading update (20,272 of 51,663 KB)...
[ 39%] Downloading update (22,758 of 51,663 KB)...
[ 44%] Downloading update (25,238 of 51,663 KB)...
[ 48%] Downloading update (27,713 of 51,663 KB)...
[ 53%] Downloading update (30,173 of 51,663 KB)...
[ 58%] Downloading update (31,492 of 51,663 KB)...
[ 60%] Downloading update (33,217 of 51,663 KB)...
[ 64%] Downloading update (34,461 of 51,663 KB)...
[ 66%] Downloading update (35,695 of 51,663 KB)...
[ 69%] Downloading update (36,928 of 51,663 KB)...
[ 71%] Downloading update (38,161 of 51,663 KB)...
[ 73%] Downloading update (39,399 of 51,663 KB)...
[ 76%] Downloading update (40,755 of 51,663 KB)...
[ 78%] Downloading update (41,993 of 51,663 KB)...
[ 81%] Downloading update (43,224 of 51,663 KB)...
[ 83%] Downloading update (44,457 of 51,663 KB)...
[ 86%] Downloading update (45,685 of 51,663 KB)...
[ 88%] Downloading update (47,042 of 51,663 KB)...
[ 91%] Downloading update (48,275 of 51,663 KB)...
[ 93%] Downloading update (49,508 of 51,663 KB)...
[ 95%] Downloading update (50,742 of 51,663 KB)...
[ 98%] Downloading update (51,663 of 51,663 KB)...
[100%] Download complete.
[----] Installing update...
[----] Extracting package...
[----] Extracting package...
[----] Extracting package...
[----] Extracting package...
[----] Installing update...
[----] Installing update...
[----] Installing update...
[----] Installing update...
[----] Installing update...
[----] Installing update...
[----] Installing update...
[----] Installing update...
[----] Cleaning up...
[----] Update complete, launching Steamcmd...
Redirecting stderr to '/app/Steam/logs/stderr.txt'
[  0%] Checking for available updates...
[----] Verifying installation...
Steam Console Client (c) Valve Corporation
-- type 'quit' to exit --
Loading Steam API...OK.
@sSteamCmdForcePlatformType linux
"@sSteamCmdForcePlatformType" = "linux"

Connecting anonymously to Steam Public...Logged in OK
Waiting for user info...OK
force_install_dir /steamcmd/rust
app_info_update 1
app_update 258550 validate
 Update state (0x3) reconfiguring, progress: 0.00 (0 / 0)
 Update state (0x5) verifying install, progress: 1.46 (62489295 / 4276759132)
 Update state (0x5) verifying install, progress: 11.04 (472151905 / 4276759132)
 Update state (0x5) verifying install, progress: 21.06 (900747659 / 4276759132)
 Update state (0x5) verifying install, progress: 30.75 (1314928287 / 4276759132)
 Update state (0x5) verifying install, progress: 40.32 (1724327913 / 4276759132)
 Update state (0x5) verifying install, progress: 49.95 (2136297849 / 4276759132)
 Update state (0x5) verifying install, progress: 59.52 (2545685148 / 4276759132)
 Update state (0x5) verifying install, progress: 68.92 (2947566113 / 4276759132)
 Update state (0x5) verifying install, progress: 78.94 (3375949985 / 4276759132)
 Update state (0x5) verifying install, progress: 89.32 (3819985959 / 4276759132)
 Update state (0x5) verifying install, progress: 96.02 (4106496680 / 4276759132)
Success! App '258550' fully installed.
quit
Starting web server..
Log rotation disabled!
Disabling internal stdout/stderr logging!
Starting scheduled task manager..
Starting Rust..
Found path: /steamcmd/rust/RustDedicated
Unable to open log file, exiting.
Exiting..

Environment (please complete the following information):

Additional Information:

This is the contents of my rust.env file.

RUST_SERVER_STARTUP_ARGUMENTS=-batchmode -load -logfile /dev/stdout +server.secure 1
RUST_SERVER_IDENTITY=<SERVER IDENTITY NAME>
RUST_SERVER_SEED=12345
RUST_SERVER_NAME=<SERVER NAME>
RUST_SERVER_DESCRIPTION=<SERVER DESCRIPTION>
RUST_RCON_PASSWORD=<PASSWORD>
RUST_UPDATE_CHECKING=1
RUST_SERVER_MAXPLAYERS=200
RUST_SERVER_MAXPLAYERS="<DOMAIN>"
HalfEatenPie commented 3 years ago

Figured out what the issue was.

I tried running the docker file without the /rust.env parameter. It seems there's an error with the following startup argument:

RUST_SERVER_STARTUP_ARGUMENTS=-batchmode -load -logfile /dev/stdout +server.secure 1

logfile the location /dev/stdout does not exist which is causing the failure/error.

I'm not exactly sure how the original instructions were built to support this, but they may need to be updated to reflect the location /dev/stdout may no longer exist or be available in the most recent docker image.

Dids commented 3 years ago

Facepunch updated Rust to use a newer version of Unity, which ones again broke existing linux compatibility, including stdoud/stderr support. This is why the image no longer uses -logfile /dev/stdout by default.

HalfEatenPie commented 3 years ago

Ahh shucks. Got it thanks for the speedy response. I also realized above I have two RUST_SERVER_MAXPLAYERS when I meant the second one to be the server website environment variable.

Regardless, cheers! Thanks for building this!

Olegt0rr commented 3 years ago

Facepunch updated Rust to use a newer version of Unity, which ones again broke existing linux compatibility, including stdoud/stderr support. This is why the image no longer uses -logfile /dev/stdout by default.

So how to setup correct log rotation?

kobechenyang commented 2 years ago

-logfile - works for me