"Not running script because past shutdown deadline (x8)" after 30 seconds, when stopping a debug

This problem started, I think, after I started to use DataStore (DataStore2).

Currently, every time I set a breakpoint and start debugging, when I stop the game in Studio, it freezes for 30 seconds and then I get this error:

Not running script because past shutdown deadline (x8)

Reproduction Steps

  1. Open the project (sent via DM to https://devforum.roblox.com/g/bug-files - https://devforum.roblox.com/t/project-file-log-about-studio-bug/713985)
  2. Open StarterGui -> LocalScript
  3. Set a breakpoint in some line (for example 444)
  4. Play (F5)
  5. After the program pauses at the breakpoint, stop the game

Here you might have the same symptom, ie, Studio freezes for 30 seconds and then shows that error message.

7 Likes

i’ve had this happen to me, but it happened when i left studio open over night or for a long time. I did not use DataStore2.

and i was in play mode when it happened ^

This happens if a script is doing something outside the 30 second server shutdown limit.

I think I managed to get around (at least in my case) the current bug.
Just repeating my scenario:

  1. I use DataStore2, so to test my case, my project has to be published / online.
  2. If I define a breakpoint, for example, inside a RenderStepped, when the program starts and stops at the breakpoint, then if at this moment I press the Stop button, Studio shows these errors and freezes for 30 seconds:

Not running script because past shutdown deadline
Stack Begin
Script ‘Script Context.ServerCoreScripts/ServerLeaderstats’, Line 57 - function waitUntilRemoved
Script ‘Script Context.ServerCoreScripts/ServerLeaderstats’, Line 142 - function playerAdded
Stack End
Not running script because past shutdown deadline

However, to get around this bug while trying to stop while debugging, after the program stops in the breakpoint:

  1. Disable de breakpoint by clicking on the red circle:

  2. Resume (F5), then stop:

After this, Studio will not freeze for 30 seconds.

So, for the Roblox Staff, this is a clue to fixing this bug.

1 Like

More than 40 days have passed since I opened this topic.
Several versions of Studio have passed.
I already sent logs and dumps.
The problem persists today, and it gets in the way of the debugging process too much.
What else is missing?
When will this problem be analyzed by the Roblox team?

1 Like

Almost 2 months without response from Roblox …
In the meantime, I have to be extremely patient to be able to debug …
While I have to deal with this “mutism” of the Roblox team, I am trying to deal with the problem directly in a radical way…

As I said in the OP, the following error occurs:

Script ‘Script Context.ServerCoreScripts/ServerLeaderstats’, Line 57 - function waitUntilRemoved

So I found the said script in

C:\Program Files (x86)\Roblox\Versions\version-21bbda4ee1da4889\ExtraContent\scripts\CoreScripts\ServerCoreScripts\ServerLeaderstats.lua

Line 57 indicated in the error is this:

		local _, parent = instance.AncestryChanged:Wait()

… and belongs to this function:

local function waitUntilRemoved(instance)
	repeat
		local _, parent = instance.AncestryChanged:Wait()
	until not parent
end

I tried to comment and even completely remove the entire function, however, Studio keeps showing the error on line 57, which means that this .lua script is not being directly read by Studio.

How can I modify this internal Studio script, and have this modification working?

2 Likes

The option to open a debug window every time an error occurs is excellent:

The irony of this is that, while this option is extremely useful, however, now I have to wait 30 seconds after stopping the script each time an error occurs …

Roblox, when will anyone fix this problem?

1 Like

This has been happening to me lately too, studio freezes for around 30 seconds after pausing in studio. Sometimes the output errors the “Not running script because past shutdown deadline” with stack of a while loop code. It doesn’t happen every time but it’s still really annoying.

1 Like

Same issue for me:


16:52:30.091 - Not running script because past shutdown deadline (x19)

[16:52:30.098 - Not running script because past shutdown deadline](rbxopenscript://www.dummy.com/dummy?scriptGuid=%7Be129f09b-850c-4c20-8cc9-29597329fdb0%7D&gst=3#57)

16:52:30.099 - Stack Begin

[16:52:30.099 - Script 'Script Context.ServerCoreScripts/ServerLeaderstats', Line 57 - function waitUntilRemoved](rbxopenscript://www.dummy.com/dummy?scriptGuid=%7Be129f09b-850c-4c20-8cc9-29597329fdb0%7D&gst=3#57)

[16:52:30.100 - Script 'Script Context.ServerCoreScripts/ServerLeaderstats', Line 142 - function playerAdded](rbxopenscript://www.dummy.com/dummy?scriptGuid=%7Be129f09b-850c-4c20-8cc9-29597329fdb0%7D&gst=3#142)

16:52:30.100 - Stack End

I agree that it is frustrating to have to wait 30 seconds to be able to code again.

other notes:

a) It only seems to happen for me when when a bug happens (not when I click stop).
b) It only happens when Security/Enable Studio Access to API is switched on.
c) Mac OS / Mac Book Pro

2 Likes

Same bug here
Absolutely spammed as well.
image

1 Like

Unfortunately, I can’t disable this option, since I use DataStore2…

Hey Roblox! The problems have been going on for almost 3 months! Several clues have already been given. Several users are being affected.
This gets in the way, slows down development, concentration and focus are lost.
When will someone be willing to analyze and mainly solve this problem?

1 Like

I decided to abandon DataStore2 and convert all my code to the native Datastore.
And?
The SAME!!!
However, the problem resides in BindToClose.
When BindToClose is active and I stop debugging, the error mentioned in the OP also happens.

Repro

  1. Create any empty project inside Studio
  2. Paste this code inside ServerScriptService:
local DataStoreService = game:GetService("DataStoreService")
local RunService = game:GetService("RunService")
local Jogo -- player's data

game.Players.PlayerAdded:Connect(function(Player)
	local JogoStore = DataStoreService:GetDataStore("Jogo", Player)
	Jogo = JogoStore:GetAsync("Jogo") or {}
	print("breakpoint")
end)

game.Players.PlayerRemoving:Connect(function(Player)
	local JogoStore = DataStoreService:GetDataStore("Jogo", Player)
	JogoStore:SetAsync("Jogo", Jogo)
end)

game:BindToClose(function()
	if RunService:IsStudio() then wait(3) end
end)
  1. Set a breakpoint at line 8 (print):
    image
  2. Publish (because DataStore)
  3. Run
  4. When the debug stops on line 8, stop the game
  5. Here it will give the same errors:
    image
  6. Now, remove the BindToClose function:
    image
  7. Run again
  8. Stop
  9. Now, the problem will be solved (no more 30 seconds waiting)

So, what now?

1 Like

It seems this problem is older than me!

Two years!
And nothing so far!

1 Like

I think I have found the (alternative) solution to this problem.
After so many trials and errors, I will summarize the problem and the solution:

The problem:

  • Studio freezes for 30 seconds after stopping a debugging

The Cause:

  • It’s because BindToClose has a yield instruction inside it, like wait(3)

The Solution:

  • Inside BindToClose, test if RunService:IsRunning() and put all yielding instructions there.

For example:

  1. I use DataStore and want to save the player’s data when the player exits the game
  2. I want this data to be saved even when running the project in Studio
  3. For this I use:
-- when a player exits the game
game.Players.PlayerRemoving:Connect(function(Player) 
	FlushCache(Player) -- my function to SetAsync all data
end)

 -- game:BindToClose will run when there are no more users (server Shutdown)
game:BindToClose(function()
    --  if the Stop button is pressed, "IsRunning()" will be false...
    -- ... so the wait(3) bellow will not be executed, avoiding the 30 seconds problem
	if RunService:IsRunning() and RunService:IsStudio() then
        -- this will force Studio to wait 3 seconds to complete SetAsync in PlayerRemoving
		wait(3)
    end
end)
´´´
1 Like

Thanks for the report! We’ve filed a ticket to our internal database and we’ll follow up when we have an update for you.

3 Likes

It is amazing to see that, after 1 year, the problem is still not resolved…

3 Likes


sorry for necroposting but I got this error as well. I am not yielding at all nor are there any bindtoclose events in my game, even with the ctrl+shift+f

This happens to me alot aswell but I don’t really have a screenshot or video proof of it, I usually get this when studio lags alot for me or when I press the stop button or Shift + F5 button(s), I usually get this with many many other Roblox errors in my output! But mostly its just the problem of lag for me… [Happens quite often but not all the time]. But i don’t think it is a bug, studio stops the script because it didn’t stop in time… M not sure. just Roblox if you see this, Please fix it Asap, it kinda really lags my studio!