StarterPlayerScripts seems to not replicate sometimes
In the past few days I have had two reports of the UI not loading, accompanied by the following error (or similar errors)
Infinite yield possible on 'StarterPlayer:WaitForChild("StarterPlayerScripts")'
Stack Begin
Script 'CoreGui.RobloxGui.Modules.Settings.SettingsHub', Line 1161 - function getOverridesPlayerScripts
Script 'CoreGui.RobloxGui.Modules.Settings.SettingsHub', Line 1223
Stack End
Here is an example stack.
I suspect this issue is not caused by CoreScripts misbehaving, but rather the core scripts also fail to execute the StarterPlayerScripts as they don’t get replicated.
Volume of Infinite Yield Errors
Here are the volume of any error related to InfiniteYield, of which this issue is only one (most are bits on the player’s character.) However, those infinite yields do not break the game as they execute in EventHandlers, so theoretically it should allow the UI code to work as normal.
Other Posts on DevForum
The most similar other report I found on the DevForum is this particular issue from from @Randy_Moss and their game Last To Leave, which had an extremely similar stack trace.
Replication Attempts
I have never seen this bug despite playing my game many times a day. I will attempt to use a link conditioner to worsen my network conditions (increase ping, packet loss, reduce speed, etc.) to reproduce this if it is related to the network.
Hypotheses
I think this could be a few things:
- The size of our game. We keep our StarterPlayerScripts folder very light, so I’m not sure why that isn’t replicating. One possibility is that our ReplicatedStorage is huge and that we reference ReplicatedStorage scripts from StarterPlayerScripts. If StarterPlayerScripts didn’t replicate with priority versus ReplicatedStorage (or there was some kind of implicit dependency), it might be taking a while to replicate that and that would block other code from running. However, we don’t see infinite yield warnings on the ReplicatedStorage dependencies, so the logs don’t support the hypothesis that the starter player scripts are running, but just waiting on ReplicatedStorage.
- Bad network conditions cause this. From the screenshot above, you can see that the average ping was 609ms for the affected user. We were on opposite sides of the planet, and so perhaps being on a server very far away geographically contributes to this.
- Some bug with replication or CoreScripts. I don’t think this is the primary cause but could be contributing to it.
Potential ways to further investigate this
I need more metrics on this to investigate. I’m thinking about putting a script in ReplicatedFirst
which will time when StarterPlayerScripts
replicates and logs some more information, so we can try and deduce patterns. If there are any debugging utilities we can turn on to help figure this out, please let me know!
Thanks for your help in investigating this issue!
Expected behavior
StarterPlayerScripts should replicate and run very quickly, or at least provide an informative error message about why they don’t.
A private message is associated with this bug report