Linux Linux help request: error with config, no error without

Jawbone

Terrarian
Hi everyone, not sure if this is where I should go to post for help or not. I am running a dedicated on Ubuntu and can't seem to get it to start and run properly off of a configuration file. I just updated to 1404 today, but it hasn't worked yet. I originally started this venture on 1403.

I can start the server without the config file and it will go through the questions to configure itself - runs no problem, can connect with client and play. With the config file, it throws errors and won't start. Specifically this error:
_______________
Server crash: 5/24/2020 9:54:15 AM
System.NullReferenceException: Object reference not set to an instance of an object
at Terraria.Main.WriteFancyWorldLoadErrorToConsole () [0x00005] in <00f37d15da2a4e5eba21c9d37c478226>:0
at Terraria.Main.DedServ () [0x00b21] in <00f37d15da2a4e5eba21c9d37c478226>:0
at Terraria.Program.LaunchGame (System.String[] args, System.Boolean monoArgs) [0x000ac] in <00f37d15da2a4e5eba21c9d37c478226>:0

Please send crashlog.txt to [email protected]
_______________

The configuration file is as follows:
____________________________


#this is an example config file for TerrariaServer.exe
#use the command 'TerrariaServer.exe -config serverconfig.txt' to use this configuration or run start-server.bat
#please report crashes by emailing crashlog.txt to [email protected]

#the following is a list of available command line parameters:

#-config <config file> Specifies the configuration file to use.
#-port <port number> Specifies the port to listen on.
#-players <number> / -maxplayers <number> Sets the max number of players
#-pass <password> / -password <password> Sets the server password
#-world <world file> Load a world and automatically start the server.
#-autocreate <#> Creates a world if none is found in the path specified by -world. World size is specified by: 1$
#-banlist <path> Specifies the location of the banlist. Defaults to "banlist.txt" in the working directory.
#-worldname <world name> Sets the name of the world when using -autocreate.
#-secure Adds addition cheat protection to the server.
#-noupnp Disables automatic port forwarding
#-steam Enables Steam Support
#-lobby <friends> or <private> Allows friends to join the server or sets it to private if Steam is enabled
#-ip <ip address> Sets the IP address for the server to listen on
#-forcepriority <priority> Sets the process priority for this task. If this is used the "priority" setting below will be i$
#-disableannouncementbox Disables the text announcements Announcement Box makes when pulsed from wire.
#-announcementboxrange <number> Sets the announcement box text messaging range in pixels, -1 for serverwide announcements.
#-seed <seed> Specifies the world seed when using -autocreate

#remove the # in front of commands to enable them.

#Load a world and automatically start the server.
world=/.local/share/Terraria/Worlds/testballs.wld

#Creates a new world if none is found. World size is specified by: 1(small), 2(medium), and 3(large).
#autocreate=1

#Sets the world seed when using autocreate
#seed=AwesomeSeed

#Sets the name of the world when using autocreate
#worldname=Terraria

#Sets the difficulty of the world when using autocreate 0(classic), 1(expert), 2(master), 3(journey)
#difficulty=0

#Sets the max number of players allowed on a server. Value must be between 1 and 255
maxplayers=16

#Set the port number
port=7777

#Set the server password
password=password

#Set the message of the day
#motd=Livile love dem big booty Slimes

#Sets the folder where world files will be stored
worldpath=/.local/share/Terraria/Worlds/

#The location of the banlist. Defaults to "banlist.txt" in the working directory.
#banlist=banlist.txt

#Adds addition cheat protection.
#secure=1

#Sets the server language from its language code.
#English = en-US, German = de-DE, Italian = it-IT, French = fr-FR, Spanish = es-ES, Russian = ru-RU, Chinese = zh-Hans, Portuguese = pt-BR, Polish = pl$
#language=en-US

#Automatically forward ports with uPNP
#upnp=1

#Reduces enemy skipping but increases bandwidth usage. The lower the number the less skipping will happen, but more data is sent. 0 is off.
#npcstream=60

#Default system priority 0:Realtime, 1:High, 2:AboveNormal, 3:Normal, 4:BelowNormal, 5:Idle
priority=1

#Journey mode power permissions for every individual power. 0: Locked for everyone, 1: Can only be changed by host, 2: Can be changed by everyone
#journeypermission_time_setfrozen=2
#journeypermission_time_setdawn=2
#journeypermission_time_setnoon=2
#journeypermission_time_setdusk=2
#journeypermission_time_setmidnight=2
#journeypermission_godmode=2
#journeypermission_wind_setstrength=2
#journeypermission_rain_setstrength=2
#journeypermission_time_setspeed=2
#journeypermission_rain_setfrozen=2
#journeypermission_wind_setfrozen=2
#journeypermission_increaseplacementrange=2
#journeypermission_setdifficulty=2
#journeypermission_biomespread_setfrozen=2
#journeypermission_setspawnrate=2


___________________________________________

Any ideas why it's wrong or what is causing the issue? Thanks!
 
I'm not sure about the error but these paths in your config look like they might be causing an issue (did you really mean /.local?):

#Sets the folder where world files will be stored
worldpath=/.local/share/Terraria/Worlds/
#Load a world and automatically start the server.
world=/.local/share/Terraria/Worlds/testballs.wld

To be safe, you can use absolute paths:
worldpath=/home/USER/.local/share/Terraria/Worlds/
world=/home/USER/.local/share/Terraria/Worlds/testballs.wld

You didn't specify exactly how you are launching the server and the exact arguments you are using so I can't help much more.
 
Thank you for the reply! I am very new to linux, I know some basic stuff but am not well-versed.

I launch with either
./TerrariaServer.bin.x86_64 -config serverconfig.txt
or without config as
./TerrariaServer.bin.x86_64

I haven't yet made it a service to start automatically but that is on the list, I really want to do that somehow, but one step at a time.

interesting about the absolute paths, I don't really know the difference but good call I will change these and test. What does adding the /home/user on the front do differently?
 
Changing these paths fixed it! Now running the server with the config file works great, THANK YOU!!

Do you have any recommendations or direction on where to look to set it up to automatically launch on boot? I have this resource I've looked over How to Setup a Terraria Linux Server but not sure if it's exactly what I want or not. I've never written a service before
 
Are you starting the server as a normal user or with super user privileges? (both before and after it worked)

The config file paths that I typed were just an example. They were not intended to work. Sorry, I should have made that more clear. Based on your needs you will have to decide where you want to store the world files and you will need to update the config file to reflect that.

The Linode guide you linked says that it's compatible with Ubuntu so just make sure that you read each step carefully and research something if you don't understand it. I don't use linode or Ubuntu and I do not run my terraria servers as a service or with superuser privileges so I can't help a whole lot with those specifics.
 
That's no problem, I appreciate the help you have given me. And I know they were just an example that you typed, but I changed them to my specific and it worked. And I start the server with normal user, not sudo both before and after my issue.
 
Last question, sorry. With this command from that service setup guide:

ExecStart=/usr/bin/screen -dmS terraria /bin/bash -c "/opt/terraria/TerrariaServer.bin.x86_64 -config /opt/terraria/serverconfig.txt"

Do I replace opt with my path for each of those things similar to what you wrote above?
 
Back
Top Bottom