Skip to content

Enshrouded 1.0 is out! 🎉 Get 25% OFF your next Enshrouded Server today!

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.

Updated 4 min read

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

  1. Open the Backups tab and select Create backup, or download the file you're about to change from the File Manager.
  2. 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

  1. 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.
  2. 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 .json file 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.
Tip

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 (: ), so name:Steve is not a setting but name: Steve is. A list entry is a dash and a space (- ).
  • Quote values with : or # in them. Plain values must never contain those combinations. Write motd: "Welcome: have fun" and not motd: 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:\Games becomes C:\\Games.
  • Match every bracket. Every { needs a } and every [ needs a ].

Save and check

  1. Select Save. A dot beside the file name shows unsaved changes.
  2. Restart the server from the Console tab and watch for the same error. If it's gone, you're done.
  3. 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?

Still stuck?

Talk to a real person, we answer fast.

  • Open a ticket

    Paste the exact error and name your server, so we can look at it from our side.

  • Ask on Discord

    Chat with the team and other server owners.

  • Browse the Help Centre

    Versions, mods, plugins, backups and RAM sizing, all in plain English.