Cannot get windows server to work.

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.
Locked
Khameleon21
Burner Inserter
Burner Inserter
Posts: 6
Joined: Sat May 06, 2017 4:30 am
Contact:

Cannot get windows server to work.

Post by Khameleon21 »

Hi there,

New to Factorio (only have 100 hrs in so far). I have been trying all night to setup a windows based server. I can get the server to run without pointing the batch file to a server-settings file. Whenever I put in a link to the server settings i get a crash.
Press any key to continue . . .
0.001 2017-05-06 00:32:47; Factorio 0.15.9 (build 29504, win64, steam)
0.001 Operating system: Windows 10 (version 1607)
0.001 Program arguments: "factorio.exe" "--start-server" "C:\Users\Adam\AppData\Roaming\Factorio\saves\ MP.zip" "--server-settings" "server-settings.json set ServerSettingsLocation=D:\Steam\SteamApps\common\Factorio\data""
0.001 Read data path: D:/Steam/SteamApps/common/Factorio/data
0.001 Write data path: C:/Users/Adam/AppData/Roaming/Factorio
0.001 Binaries path: D:/Steam/SteamApps/common/Factorio/bin
0.008 System info: [CPU: Intel(R) Core(TM) i7-4770 CPU @ 3.40GHz, 8 cores, RAM: 16321MB]
0.008 Running in headless mode
0.013 Loading mod core 0.0.0 (data.lua)
0.018 Loading mod base 0.15.9 (data.lua)
0.117 Loading mod base 0.15.9 (data-updates.lua)
0.179 Checksum for core: 3409166051
0.180 Checksum of base: 3769930138
0.291 Info PlayerData.cpp:55: Local player-data.json available, timestamp 1494044520
0.291 Info PlayerData.cpp:62: Cloud player-data.json unavailable
0.293 Custom inputs active: 0
0.298 Factorio initialised
0.299 Info ServerMultiplayerManager.cpp:139: Quitting multiplayer connection.
0.299 Info ServerMultiplayerManager.cpp:663: mapTick(-1) changing state from(Ready) to(Closed)
0.317 Goodbye
0.000 Error Util.cpp:58: Error when opening server-settings.json set ServerSettingsLocation=D:\Steam\SteamApps\common\Factorio\data" for reading: Invalid argument
Here is a copy of my server file. It was a direct copy from the sample, but in attempts to get this working I have cleaned out stuff I wasn't using. The error is exactly the same.
{
"name": "Khameleon21",
"description": "My Game",
"tags": ["tag1", "tag2"],
"max_players": "4",

"visibility": "public",

"username": "Khameleon21",
"password": "Something",


"game_password": "test",

"verify_user_identity": "true",
}
The example I found in the forum had no "" or a , on the true statement on the verify user identity. I have tried it both ways.

Here is my server batch file.
@echo off
::==============================================================================================================
:: Replace the appropriate entries below to suit your installation (Default install example shown) ::==============================================================================================================
set FactorioExeLocation=D:\STEAM\STEAMAPPS\COMMON\Factorio\bin\x64\
set SaveFileName=MP.zip
set SaveLocation=C:\Users\Adam\AppData\Roaming\Factorio\saves\
set ServerSettingsFileName=server-settings.json set ServerSettingsLocation=D:\Steam\SteamApps\common\Factorio\data\
::==============================================================================================================
cd %FactorioExeLocation%
echo.
echo.
echo PREPARING TO LAUNCH FACTORIO SERVER...
echo.
echo Save to be loaded:
echo %SaveLocation%%SaveFileName%
echo.
echo Server Settings to load:
echo %ServerSettingsLocation%%ServerSettingsFileName%
echo.
echo.
echo *** Remember to use Ctrl+C to ensure saving when finished instead of simply closing this window ***
echo.
echo.
pause 3
::==============================================================================================================
:: ***NOTE: The line below launches factorio in headless mode with desired server settings, add any other
:: desired arguments to end of the line. Use "factorio.exe --help" for a list of all supported arguments.
::==============================================================================================================
factorio.exe --start-server "%SaveLocation%%SaveFileName%" --server-settings "%ServerSettingsLocation%%ServerSettingsFileName%"
pause 3
It will work if I comment out the server settings.

I am using 15.9. I have also tried this a stand alone download of the game from this site, and always the same error.

Any help would be greatly appreciated..

Thanks in advanced

daniel34
Global Moderator
Global Moderator
Posts: 2761
Joined: Thu Dec 25, 2014 7:30 am
Contact:

Re: Cannot get windows server to work.

Post by daniel34 »

Khameleon21 wrote:

Code: Select all

  "visibility": "public",
Visibility should be defined like this (changed sometime in 0.14.x):

Code: Select all

  "visibility":
  {
    "public": true,
    "lan": true
  },
quick links: log file | graphical issues | wiki

Khameleon21
Burner Inserter
Burner Inserter
Posts: 6
Joined: Sat May 06, 2017 4:30 am
Contact:

Re: Cannot get windows server to work.

Post by Khameleon21 »

I am not at home for right now, will try it tomorrow. \\

Thank you very much for helping

Khameleon21
Burner Inserter
Burner Inserter
Posts: 6
Joined: Sat May 06, 2017 4:30 am
Contact:

Re: Cannot get windows server to work.

Post by Khameleon21 »

Did what you said and exact same error.
{
"name": "Khameleon21",
"description": "My Game",
"tags": ["tag1", "tag2"],
"max_players": "4",

"visibility":
{
"public": true,
"lan": true
}
"username": "Khameleon",
"password": "test",


"game_password": "password",

"verify_user_identity": true
}
Any other thoughts?

User avatar
prg
Filter Inserter
Filter Inserter
Posts: 947
Joined: Mon Jan 19, 2015 12:39 am
Contact:

Re: Cannot get windows server to work.

Post by prg »

Put a comma after the closing curly brace of the "visibility" block.
Automatic Belt (and pipe) Planner—Automate yet another aspect of constructing your factory!

Khameleon21
Burner Inserter
Burner Inserter
Posts: 6
Joined: Sat May 06, 2017 4:30 am
Contact:

Re: Cannot get windows server to work.

Post by Khameleon21 »

Wish I could say it work, but no joy! does anyone have a working one with a current version they could share?

Here is the lastest attempt.
{
"name": "Khameleon21",
"description": "My Game",
"tags": ["tag1", "tag2"],
"max_players": "4",

"visibility":
{
"public": true,
"lan": true
},
"username": "Khameleon",
"password": "test",


"game_password": test",

"verify_user_identity": true
}

User avatar
prg
Filter Inserter
Filter Inserter
Posts: 947
Joined: Mon Jan 19, 2015 12:39 am
Contact:

Re: Cannot get windows server to work.

Post by prg »

"game_password": test",
Now there's a double quote missing...
Automatic Belt (and pipe) Planner—Automate yet another aspect of constructing your factory!

Khameleon21
Burner Inserter
Burner Inserter
Posts: 6
Joined: Sat May 06, 2017 4:30 am
Contact:

Re: Cannot get windows server to work.

Post by Khameleon21 »

Sorry that was my fault, I erased the password i was using and put test for the post The original did have the password in quotes,

User avatar
prg
Filter Inserter
Filter Inserter
Posts: 947
Joined: Mon Jan 19, 2015 12:39 am
Contact:

Re: Cannot get windows server to work.

Post by prg »

Okay, just read your first post again.
0.001 Program arguments: "factorio.exe" "--start-server" "C:\Users\Adam\AppData\Roaming\Factorio\saves\ MP.zip" "--server-settings" "server-settings.json set ServerSettingsLocation=D:\Steam\SteamApps\common\Factorio\data""
The thing after "--server-settings" should probably just be something like "D:\Steam\SteamApps\common\Factorio\data\server-settings.json" or wherever you put that file.
Automatic Belt (and pipe) Planner—Automate yet another aspect of constructing your factory!

Khameleon21
Burner Inserter
Burner Inserter
Posts: 6
Joined: Sat May 06, 2017 4:30 am
Contact:

Re: Cannot get windows server to work.

Post by Khameleon21 »

Thanks so much! I just took out the set commands and after server settings I put the actual location and file name instead of the %ServerSettingsLocation%%ServerSettingsFileName%..

Thanks again!

noliVe
Filter Inserter
Filter Inserter
Posts: 327
Joined: Tue May 24, 2016 7:46 am
Contact:

Re: Cannot get windows server to work.

Post by noliVe »

spaces in mapname or inside wont work too. keep that in mind

User avatar
prg
Filter Inserter
Filter Inserter
Posts: 947
Joined: Mon Jan 19, 2015 12:39 am
Contact:

Re: Cannot get windows server to work.

Post by prg »

Spaces in file names work fine if they are properly quoted or escaped. You just need to pass the actual file name instead of some gibberish.
Automatic Belt (and pipe) Planner—Automate yet another aspect of constructing your factory!

kynelongtail
Burner Inserter
Burner Inserter
Posts: 10
Joined: Sat Oct 24, 2015 8:20 pm
Contact:

Re: Cannot get windows server to work.

Post by kynelongtail »

I'm having a problem getting my server going again. giving me an 'invalid arguement' error with the server settings command line.

This is my serverstart.bat

Code: Select all

 start /wait Factorio.exe --start-server C:\Users\Dyne\AppData\Roaming\Factorio\saves\server.zip --server-settings E:\Steam\steamapps\common\Factorio\data\server.json\ --no-log-rotation
and the error itself

Code: Select all

Error when opening E:\Steam\Steamapps\common\Factorio\data\server.json for reading: invalid arguement
can anyone help?

Loewchen
Global Moderator
Global Moderator
Posts: 8337
Joined: Wed Jan 07, 2015 5:53 pm
Contact:

Re: Cannot get windows server to work.

Post by Loewchen »

Make a new topic in technical help please.

Locked

Return to “Technical Help”