Tutorials
Configuring and managing your server

How to fix Watchdog error ?

In this article, we will delve into the topic of Watchdog on your Minecraft server, what it is, how it works, and what you can do in case it crashes.


What is Watchdog?

The Watchdog is a built-in component of the Minecraft server that monitors the time taken by each game loop, also known as a tick. The Watchdog checks if a single tick takes longer than expected and crashes the server deliberately to prevent world corruption.


What is a Tick?

In Minecraft, a tick refers to one game loop, which occurs every 0.05 seconds or 20 times per second, i.e., 20 Ticks Per Second (TPS). The game loop executes different actions like spawning mobs, growing crops, changing blocks, and calculating damage results.


Watchdog Crash Time

The Watchdog is programmed to trigger a server crash when a single tick exceeds the maximum allowed time. By default, the Watchdog triggers a crash when a tick takes more than 50 milliseconds, but the maximum allowed time is 60 milliseconds.


How to Identify a Watchdog Error?

When the Watchdog crashes your Minecraft server, you will see an error message in your server console that reads:

[FATAL]: A single server tick took 60.00 seconds (should be max 0.05)
[FATAL]: Considering it to be crashed, server will forcibly shutdown.

Additionally, a crash report will be generated, starting with the line "Minecraft Crash Report."


How to Solve a Watchdog Error? 

To resolve a Watchdog error, you need to identify the source of the lag that causes the tick to take longer than usual.

After identifying the issue, you can take appropriate action, depending on the case. The cause of the problem could be a ticking entity, block, or even the world, which can generate significant lag and lead to server crashes.

You can refer to our guide on resolving ticking entity errors.


Disabling Watchdog 

Disabling the Watchdog is a last resort and not recommended because it crashes the server when it detects that a tick has taken longer than expected, indicating that the server is already unplayable or crashed. You can disable the Watchdog by setting the max-tick-time value to -1 in the server.properties file, but this is not recommended.


How to Change Watchdog Crash Time 

You can change the maximum time allowed for a tick before the Watchdog crashes the server by modifying the max-tick-time option in the server.properties file. The default value is 60000 milliseconds or 60 seconds, you can configure -1 for unlimited time, sometimes this will delay the issue.


Conclusion

Watchdog is a vital component of your Minecraft server that monitors game loops to prevent world corruption. If it crashes, you can identify the cause of the problem and take appropriate action or seek assistance from your hosting provider. Remember not to disable the Watchdog unless it is a last resort.