Error: Loop svMain Seems Hung in FiveM: What It Means and How to Fix It
The svMain watchdog message means the FiveM server thread stopped responding. Read the stack line, find the resource behind it, then fix or remove it.
The message Error: Loop svMain seems hung! (last checkin 45 seconds ago) means the main server thread did not report back for a while, so the watchdog stopped the server process. The part that matters is the stack line printed with it. It usually names the resource or event that was running when the thread froze.
What the message means
FXServer runs your server logic on one main thread, called svMain. A watchdog checks that the thread keeps running. If it stops checking in for too long, the watchdog reports the hang and the server is restarted or closed. The number in brackets is how long the thread had been silent.
This is not the same as a lag spike. A hitch warning means one tick took too long and the server kept going. The svMain message means the thread stopped for long enough that the watchdog gave up on it. For the difference, read our server thread hitch warning guide.
Read the watchdog stack first
Open the server console, or the log file your host keeps, and find the line that starts with Detected FXServer thread svMain hung with stack or similar. The text after it is the stack. Look for:
- a resource name, such as a folder name from your
resourcesdirectory, - an event name, such as a txAdmin or framework event,
- a file and line, if the stack includes one.
If the stack names a resource, that resource is the first suspect. If it only shows root or nothing useful, the cause is harder to find and the next steps below apply.
Common causes reported by server owners
The cases below come from forum threads on forum.cfx.re. They are reports from individual owners, not confirmed causes from Cfx.re.
- An old or broken script. One owner found that an older script with native DLL code was blocking the thread. Updating that script, and later the host operating system, stopped the hangs.
- A loop without a wait. A script that loops over players, vehicles or objects every tick and never yields can freeze the thread. Check your own scripts for loops that run without a
Waitcall. - Long-running work on the main thread. Large JSON encoding or decoding, slow database calls made inside a tick loop, or heavy file reads can take long enough to trigger the watchdog.
- Abuse from the client console. One poster reported that players pasting Lua commands into the F8 console caused the freeze. This is a single report, so treat it as something to check, not a known cause.
Steps to fix it
- Note the resource and the time. Write down the resource or event from the stack line, and when the hang happened.
- Update the resource. Check the author's release page for a newer version, and read the changelog for fixes to loops or threads.
- Remove or disable it to test. If the hang stops with the resource off, you have confirmed the cause. Fix the resource or replace it.
- Add waits to long loops. In your own code, make sure each loop yields with a wait, so the thread can check in.
- Profile the server. If the stack names no resource, record a profile during the problem and look for the resource with the highest time. The profiler guide shows how.
- Update the artifact and the host OS. Use a recommended build from the artifacts guide, and keep the operating system updated.
If the stack shows only root and disabling resources one by one does not help, ask on forum.cfx.re in the server owner section and include the full stack line and your artifact version.
Frequently asked questions
Does this mean my server is broken?
Not by itself. It means the main thread stopped for long enough to be detected. If it happens once after a restart, check the logs. If it repeats, find the resource named in the stack.
Can players cause this?
Some owners have reported it, but the cause is not confirmed. Check your own resources first, then review what players can run from the console.
Is restarting enough?
A restart brings the server back, but if the same resource runs again, the hang can come back. A restart is a workaround, not a fix.
Sources
- Error: Loop svMain seems hung! (forum.cfx.re, last checkin 45 seconds ago)
- Need help "Error: Loop svMain seems hung!" (forum.cfx.re)
- Detected FXServer thread svMain hung with stack (forum.cfx.re)
- Client issues (FiveM documentation)
Last checked: 29 November 2026. The forum threads above describe individual cases; we did not find an official Cfx.re page that lists the causes.
FiveM.tools was founded with sponsorship from Nyru.