Skip to content

Troubleshooting

GeheimagentNr1 edited this page Oct 11, 2026 · 3 revisions

Rented servers / server panels (i.e. Pterodactyl, Multicraft, BisectHosting)

On a rented server you usually can't run your own scripts, because the server panel starts the Minecraft server.
In this case:

  1. Enable the option of your server panel, that restarts the server automatically when it stops or crashes (often called "Auto Restart", "Crash Detection" or "Restart on crash").
  2. Set use_external_restart_script = true in the "auto_restart-server.toml" config. The restart_command is not used then.

When the mod restarts the server, it stops the server and the server panel starts it again.
Note: Many server panels can't tell a restart from a normal stop, so the server is started again after the /stop command too. To stop the server completely, use the stop button of the server panel.

The server stops, but doesn't start again

  • Check the server log ("logs/latest.log") for lines starting with "Restart failed". They show, why the restart_command couldn't be started.
  • restart_command must only contain the path of the script, without any other commands or arguments (i.e. "/opt/minecraft/start.sh", not "bash /opt/minecraft/start.sh" or "/opt/minecraft/start.sh nogui"). The whole value is used as the name of the program to start.
  • Use the absolute path of the script.
  • On Windows, all "\" in the path have to be "\\" in the config, i.e. "C:\\Minecraft\\start.cmd".
  • With use_external_restart_script = false, a crashed server is only restarted, if auto_restart.on_crash is true.
  • Test the script by running it yourself, while the server is stopped. The server must start in the background (Linux: in a screen, Windows: in a new window) and the script must end directly.

Linux: "Permission denied"

The script is not executable. Run chmod +x <Name of your script>.sh.

Linux: /bin/bash^M: bad interpreter or $'\r': command not found

The script was saved with Windows line endings (CRLF), i.e. because it was edited on Windows. Convert it to Linux line endings (LF) with sed -i 's/\r$//' <Name of your script>.sh or dos2unix <Name of your script>.sh, or change the line endings in your editor (i.e. in Notepad++ with "Edit" > "EOL Conversion" > "Unix (LF)").

Linux: cd: too many arguments or the server starts in the wrong folder

The path contains spaces. Put it in double quotes: cd "/opt/minecraft/servers/Minecraft Server".

The restart script hangs or the server is never started

Don't use pause (Windows) or read (Linux) in the script for the restart_command. The script is started by the stopping server and has no console, so it would wait forever or end before starting the server.
This only applies to the script for the restart_command. The restart_loop script of an external restart script runs in its own console and reads only the "auto_restart/restart" file.

The external restart script always restarts the server, even after /stop

The mod writes "0" to the "auto_restart/restart" file in the server folder, if the server was stopped with /stop.

  • The script must be started in the server folder (see the cd in the "restart_start" script), otherwise it reads a wrong or missing file.
  • If the server was stopped by closing the console window or killing the process, the mod can't write the file and the file still contains "-1" (crash), so the script restarts the server.

Home (Overview)

How to set up the mod?

Setup Guide

Versions

Scripts

Changelogs

Download

Clone this wiki locally