Rust Oxide Woes
Why does it keep breaking?
Recently my Rust server has been giving me issues. Seemingly randomly the server restarts and when it comes back up none of my wonderful plugins work. This required a quick fix as the server I run has custom stack sizes amongst other things. With Oxide broken my poor players are relegated to vanilla rust (and upkeep on those monster bases gets tricky).
Symptoms
- Random restarts
- On restart Oxide breaks
- The map and associated save data disappears.
Investigation
Does updating Oxide resolve the issue?
Unfortunately not, this would be a simple fix, automate an oxide update on restart. Not so lucky..
Does manually specifying our seed restore our lost map and save data?
Yes, once we manually specify the seed in the configuration file our save file gets pulled and we are back in business.
Does removing and reinstalling Oxide resolve the issue?
*Yes! But Why?!?
Why does this keep happening?
The first time the issue happened was when the server force wiped. This is not too surprising as oxide requires an update on force wipe. After a little digging it seems like the problematic restarts happen when facepunch releases a hotfix. This looks like our trigger.
Resolution
Our first port of call is to disable the cron job that checks for updates and applies them automatically. This gives us some breathing space to implement a solution.
Next we need some code to automate repairing the oxide installation. We can run this code every time we detect an update and restart the server.
Note: I am using LGSM on a linux host to run my rust server.
Get the seed
- Navigate to /home/user/serverfiles/server/rustserver
- Find the .sav file that was generated on wipe (By time and date)
- Eg proceduralmap.4000.1355844589.221.sav
- Take the seed from the filename (eg 1355844589)
- Navigate to /home/user/lgsm/config-lgsm/rustserver
- Download the rustserver.cfg file
- Edit this file and enter the seed you noted in the appropriate section
- Eg seed=“SEED HERE” # range: 1-2147483647, used to reproduce a procedural map.
- Replace the rustserver.cfg file on the server with your updated file
Script the rest
Note:
echo 'rustoxide \nes'
Is used to automate the prompt to confirm which plugin to modify.
Backup plugins folder
mv /home/user/serverfiles/oxide /home/user/serverfiles/oxidesav
Remove Oxide
echo 'rustoxide \nes' | ./rustserver mr
Reinstall Oxide
echo 'rustoxide \nes' | ./rustserver mi
Remove stock oxide plugins folder
rm -rf /home/user/serverfiles/oxide
Restore backup of plugins folder
mv /home/user/serverfiles/oxidesav /home/user/serverfiles/oxide
Restart server
./rustserver restart