Find and fix YAML and JSON config errors
Spot the broken file from the Console, use the File Manager editor's line numbers and preview, and fix the usual YAML and JSON mistakes.
Plugins, mods and some games keep their settings in YAML (.yml or .yaml) or JSON (.json) files. One stray tab, missing quote or extra comma and the program can't read the whole file, so it may ignore your settings or refuse to start. The File Manager editor won't check these formats for you, but it gives you enough to spot most mistakes yourself.
Back up before you edit
- Open the Backups tab and select Create backup, or download the file you're about to change from the File Manager.
- Keep that copy until the server has restarted cleanly.
Create and restore backups covers restoring one if an edit goes badly.
Find which file is broken
- Restart the server and watch the Console tab. Scroll to the first error after the restart. If the error names a file and a line number, note both. Fix the first error before the later ones, since later errors can be a knock-on from it.
- Open the File Manager, go to the file and select its name to open it in the editor. Manage your server's files shows how to get around.
The editor helps in three ways:
- Line numbers run down the left side for files of up to 1500 lines, so you can go straight to the line the error names. Longer files open without them.
- Colours mark keys, strings, numbers and comments in YAML and JSON. If the colours change unexpectedly part-way down a file, check just above that point for a missing quote. Files over 80,000 characters aren't coloured.
- The Preview pane appears beside the editor on wide screens (it's hidden on a phone or narrow window). For a
.jsonfile of up to 400,000 characters it shows "Not valid JSON yet" until the text parses, then shows the file's contents in a viewer. It updates as you type, before you save.
Typical files are Geyser's config.yml and Terraria's tshock/config.json. If a tab such as Server Settings already edits a file for you, use that tab rather than the raw file where you can.
Common YAML mistakes
The YAML 1.2.2 specification sets these rules:
- Indent with spaces, never tabs. The spec says tab characters must not be used in indentation. The editor is a plain text box, so press the space bar.
- Keep the levels straight. Each node must be indented further than its parent, and all siblings must use exactly the same indentation.
- Put a space after the colon. Mappings use a colon and a space (
:), soname:Steveis not a setting butname: Steveis. A list entry is a dash and a space (-). - Quote values with
:or#in them. Plain values must never contain those combinations. Writemotd: "Welcome: have fun"and notmotd: Welcome: have fun. - Leave a space before a comment. A
#comment must be separated from other tokens by white space.
Common JSON mistakes
These come from the JSON standard, RFC 8259:
- Double quotes only. A string begins and ends with quotation marks, and names are strings too. Single quotes are not valid.
- Commas between entries, but not after the last one. A comma after the final item in an object or list breaks the file, and so does a missing comma between two items.
- No comments. JSON has no comment syntax, so remove any
//or/* */lines. - Escape backslashes. A backslash inside a string must be written twice, so
C:\GamesbecomesC:\\Games. - Match every bracket. Every
{needs a}and every[needs a].
Save and check
- Select Save. A dot beside the file name shows unsaved changes.
- Restart the server from the Console tab and watch for the same error. If it's gone, you're done.
- If the server now won't start, restore the backup, or paste the original file contents back, and change one thing at a time.
If you're stuck, open a ticket with the file name, the first error from the Console and what you changed. Contact support and open a ticket shows how.
Was this guide helpful?
Related guides
Failed to load properties from file: fix server.properties
Minecraft server missing its server.properties file? Restart it once, then check the port and bring back any settings that went to defaults.
Fix a Console stuck on Reconnecting
What the Reconnecting and Error chips on the Console mean, the quick fixes in order, and what happens to commands typed while it's down.
Fix a server missing after checkout
Paid but no server on your dashboard? Check the setting-up screen, the account you paid with, Billing and the fix-attempt button.