My linux headless server won't run

Anything that prevents you from playing the game properly. Do you have issues playing for the game, downloading it or successfully running it on your computer? Let us know here.
Gefo
Burner Inserter
Burner Inserter
Posts: 5
Joined: Thu Dec 01, 2016 5:50 pm
Contact:

My linux headless server won't run

Post by Gefo »

I set up a VM on google cloud and installed everything there, the headless client, factorio-init and updater scripts. I followed the guide that's on reddit step by step and configured every json accordingly.

The server won't launch when I use the factorio-init commands. Well, actually it says it launches, and it generates a log but when I check the status it says it's offline. I'm guessing I messed up some of the json files, but I really can't tell where I messed up, so I need some help troubleshooting.

I made a user called factorio that is the one running the scripts, and I made it the owner of every folder, so I'm guessing it's not a permissions issue.

I'll put every json I know I configured and checked, and the current-log

Current log
0.000 2016-12-12 23:29:29; Factorio 0.14.21 (build 25327, linux64, headless)
0.045 Operating system: Linux (Ubuntu 16.04)
0.045 Program arguments: "/opt/factorio/bin/x64/factorio" "--config" "/opt/factorio/config/config.ini" "--port" "34197" "--start-server-load-latest" "--server-settings" "/opt/factorio/data/server-settings.json"
0.045 Read data path: /opt/factorio/data
0.045 Write data path: /opt/factorio
0.045 Binaries path: /opt/factorio/bin
0.054 System info: [CPU: Intel(R) Xeon(R) CPU @ 2.30GHz, 1 core, RAM: 1696MB]
0.054 Running in headless mode
0.056 Loading mod core 0.0.0 (data.lua)
0.059 Loading mod base 0.14.21 (data.lua)
0.134 Checksum for core: 1291735968
0.134 Checksum for mod base: 786624017
0.474 Info PlayerData.cpp:55: Local player-data.json available, timestamp 1481221014
0.474 Info PlayerData.cpp:62: Cloud player-data.json unavailable
0.475 Custom inputs active: 0
0.475 Info Updater.cpp:749: Downloading https://updater.factorio.com/get-availa ... iVersion=2
0.710 0 packages available to download (experimental updates disabled).
0.714 Factorio initialised
0.714 Error Util.cpp:57: Error while reading file /opt/factorio/data/server-settings.json: /opt/factorio/data/server-settings.json(60): expected value
Server settings:
{
"name": "Gefo",
"description": "Vanilla+",
"tags": ["game", "tags"],

"_comment_max_players": "Maximum number of players allowed, admins can join even a full server. 0 means unlimited.",
"max_players": 0,

"_comment_visibility": ["public: Game will be published on the official Factorio matching server",
"lan: Game will be broadcast on LAN"],
"visibility":
{
"public": true,
"lan": true
},

"_comment_credentials": "Your factorio.com login credentials. Required for games with visibility public",
"username": "Gefo",
"password": "mypassword",

"_comment_token": "Authentication token. May be used instead of 'password' above.",
# "token": "",

"game_password": "",

"_comment_require_user_verification": "When set to true, the server will only allow clients that have a valid Factorio.com account",
"require_user_verification": false,

"_comment_max_upload_in_kilobytes_per_second" : "optional, default value is 0. 0 means unlimited.",
"max_upload_in_kilobytes_per_second": 0,

"_comment_minimum_latency_in_ticks": "optional one tick is 16ms in default speed, default value is 0. 0 means no minimum.",
"minimum_latency_in_ticks": 100,

"_comment_ignore_player_limit_for_returning_players": "Players that played on this map already can join even when the max player limit was reached.",
"ignore_player_limit_for_returning_players": false,

"_comment_allow_commands": "possible values are, true, false and admins-only",
"allow_commands": "admins-only",

"_comment_autosave_interval": "Autosave interval in minutes",
"autosave_interval": 10,

"_comment_autosave_slots": "server autosave slots, it is cycled through when the server autosaves.",
"autosave_slots": 1,

"_comment_afk_autokick_interval": "How many minutes until someone is kicked when doing nothing, 0 for never.",
"afk_autokick_interval": 0,

"_comment_auto_pause": "Whether should the server be paused when no players are present.",
"auto_pause": true,

"only_admins_can_pause_the_game": true,

"_comment_autosave_only_on_server": "Whether autosaves should be saved only on server or also on all connected clients. Default is true.",
"autosave_only_on_server": true,

"_comment_admins": "List of case insensitive usernames, that will be promoted immediately",
"admins":
}
Config file on factorio-init
#!/bin/bash

# Enable debugging, useful when you want to figure out why
# this script is not behaving the way you expect it to do
DEBUG=0

# What do you want to call this service?
SERVICE_NAME="Factorio"

# Which user/group is running factorio?
# Running any public service as "root" is generally not recommended
USERNAME=factorio
USERGROUP=factorio

# The absolute path to the factorio directory
FACTORIO_PATH=/opt/factorio
# Server settings file, see data/server-settings.example.json
SERVER_SETTINGS=${FACTORIO_PATH}/data/server-settings.json

# Port on which you want to run the server
PORT=34197

# Save the command/chat/log on server start? Default location /opt/factorio/server.out
# Setting this to 0 will cause the script to erase the log file on each start
# If you set this to 1 you might want to apply logrotate on the log or it will eventually fill your disk
SAVELOG=0

# Factorio comes packaged in a tarball containing the directory named "factorio"
# when using this scripts update/install command we expect to see this very
# directory. If you want to supply your own update/install tar other than what you can download
# from factorio.com/downloads you can use this option to tell the script this is ok.
#
# If you place your factorio install within a directory named "factorio" and you update/install
# with the official tarball you can safely ignore this option.
PACKAGE_DIR_NAME=factorio

#
# narcotiq made a sweet update script for factorio and by cloning into this
# you can simply run "factorio update" provided you configure the below arguments
# To install the updater:
#
# git clone https://github.com/narc0tiq/factorio-updater
#

# absolute path to the factorio-updater script
UPDATE_SCRIPT=/opt/factorio-updater/update_factorio.py
# Note that if you set HEADLESS=1 the username/token will not be used as the headless
# download is provided free of charge
HEADLESS=1
UPDATE_USERNAME=Gefo
UPDATE_TOKEN=MyPassword
UPDATE_EXPERIMENTAL=0
UPDATE_TMPDIR=/tmp

# Extras
# Additional binary arguments, these will be sent to the binary when issuing the "start" command
EXTRA_BINARGS=""
Nexela
Smart Inserter
Smart Inserter
Posts: 1828
Joined: Wed May 25, 2016 11:09 am
Contact:

Re: My linux headless server won't run

Post by Nexela »

Take a peek at the last line in the log file

0.714 Error Util.cpp:57: Error while reading file /opt/factorio/data/server-settings.json: /opt/factorio/data/server-settings.json(60): expected value

It is telling you that server-settings line 60 expected a value and didn't get one.

My guess is this is line 60 of your server settings: might be able to fix by either adding an in-game username to the list or adding a blank string "" or by commenting out the admins line. I don't run headless so I can't say for 100% sure this is the problem.

"_comment_admins": "List of case insensitive usernames, that will be promoted immediately",
"admins":
Gefo
Burner Inserter
Burner Inserter
Posts: 5
Joined: Thu Dec 01, 2016 5:50 pm
Contact:

Re: My linux headless server won't run

Post by Gefo »

You are right. I fixed it but I got another error:
1.475 Info ServerMultiplayerManager.cpp:658: mapTick(-1) changing state from(PreparedToHostGame) to(CreatingGame)
1.480 Loading map /opt/factorio/saves/..zip
1.509 Error ServerMultiplayerManager.cpp:93: MultiplayerManager failed: "File /opt/factorio/saves/..zip/info.json not found"
1.509 Info ServerMultiplayerManager.cpp:658: mapTick(-1) changing state from(CreatingGame) to(InitializationFailed)
1.530 Error Main.cpp:509: Couldn't load the game for MP: File /opt/factorio/saves/..zip/info.json not found
I looked into the save's info.json file and it's empy, it says:

{
}
Gefo
Burner Inserter
Burner Inserter
Posts: 5
Joined: Thu Dec 01, 2016 5:50 pm
Contact:

Re: My linux headless server won't run

Post by Gefo »

Oh shit I think I got it running, I kept running into errors and fixing them, I think it was an issue with the save, so I deleted everything and created a new save and it launched successfully.
Post Reply

Return to “Technical Help”