Unity Crashing ~10 seconds after loading realtime with a certain name.
Hey guys,
Having a rather strange issue. Recently all of our developers started reporting crashes about ~10 sec after a scene with Realtime in it loads (it connects on start). The room name is 'Cyboracle_Persistent'.
- When changing the room name to anything else, even 'Cyboracle_Persistent2', it works fine. I disabled all other gameobjects other than the realtime room gameobject.
- When making a new scene in the same project, importing the cube example and setting the room to 'Cyboracle_Persistent', it crashes.
- When changing the room in the above test scene to anything else, it works fine.
- When starting a brand new project, importing normcore and the cube player, and setting the room to 'Cyboracle_Persistent', it works fine. (same app key)
So the issue seems to be isolated to this particular room string, in this particular project. I'm happy to just use a different string, but I'm nervous that the same thing would eventually happen with that string in production. At various times there have been other devs connecting to that room, but in this instance it should just join the pre-existing room if i'm not mistaken.
Given that I disabled basically everything in the original project except the realtime, i'm not sure what the difference between the projects is. Cached stuff? Build settings?
We are using WebGL on Unity 2022.2.19f1. Let me know if you need any more info!
Thanks in advance 🙂
17 Replies
Hi @NeuroGoblin. I'm kapa.ai, your friendly support bot. I will try to answer your question by searching through the knowledge base. :wave:
----------------------
Hmm, I don't know enough to give you a confident answer yet. However, I can provide some general troubleshooting steps based on the information provided in the knowledge sources.
1. Check for Compilation Errors: Make sure your project has no compilation errors. If your project has any errors, any changes you make to the model will not be visible to the model editor. source (https://normcore.io/documentation/room/common-questions#i-made-changes-to-my-properties-but-when-i-recompile-the-freshly-compiled-model-isnt-updated-why)
2. Check RealtimeComponent's Model: The model is set by Realtime when you connect to the room. This will only fail if Realtime doesn't receive a reference to the RealtimeComponent. There are several reasons why this could happen, such as using Unity’s Instantiate API instead of Normcore’s
Realtime.Instantiate()
, the prefab in Unity is corrupt, a RealtimeView parent/child relationship is not saved correctly by Unity, etc. source (https://normcore.io/documentation/realtime/common-questions#why-would-a-realtimecomponents-model-remain-null)
3. Check Room Server Shutdown: When the last player leaves a room, the room server will remain running for about 30 seconds before it's shut down. When this happens, any objects that are not flagged to destroy will be written to persistent storage. The next time someone joins this room, they will be restored instantly. source (https://normcore.io/documentation/realtime/common-questions#what-happens-to-my-objects-when-a-room-server-shuts-down)
4. Check Realtime Settings: Make sure the settings for the Realtime component are correct. This includes the room to join on start, whether Realtime will try to automatically connect on Start(), the app settings object reference used when Realtime connects, etc. source (https://normcore.io/documentation/reference/classes/Normal.Realtime.Realtime)
If none of these steps help, I recommend reaching out to the NormalVR support team for further assistance.
----------------------
Note: you can ask me a follow up question by @ mentioning me again :speech_balloon:
----------------------<@196555254496493568> kapa.ai is still learning and improving, please let us know how it did by reacting below
probably some persistent data in that room
there's currently no way to clear all the persistent data in a room
so you either change the room name or change the app key
Thanks for the response. I'm still unsure why connecting to that room in a new project with the same app key works fine though?
And is it possible this would eventually happen again with a new string?
maybe model property mismatch
the new project would ignore models it doesn't have
so long as you are carfeul with more model updates
if you wanted to make a non-breaking model change you can just use a different property ID
Do you mean like this?
We have a few instances of this pattern
model.X = Y
in the model definition there is a property ID
if you wanted to change property 1 from a string to an int you might run into trouble
so instead you make property 2 into an int and ignore property 1
yep - i have redesigned everything to just have a single primitive type and single property to avoid any confusion
the property names are unique within that model as I understand
there have been some times where I changed the types but I followed the docs guide on how to do this and everything compiled correctly and worked functionally
it might compile correctly but the server might contain old data
I'm saying don't make model changes reusing old IDs
just use a different ID
or update the app key every time you release a model changing update
ok makes sense. If I make a new room string (with no data on the server yet) and the models are all using just 1 property i should be fine right? (provided the models don't change)
as the new room will be provided with clean data
or is that corrupted data stored on the app key level?
the data isn't corrupted it's just the local version mismatch, but changing the room name is the easy fix
i see yeah
so then the new room should just store what's in my local from the get go, and as long as that doesn't change, we should be good
yeah
cool, thanks for your help!
hopefully normcore gives us the ability to delete rooms soon