Realtime (native): Client: Failed to send reliable datastore message. Disconnecting.
So I have a realtime dictionary which I use to store serialized objects. I serialiaze my custom data structure into a byte array and then stor it inside a byte array model which then goes into a real time dictionary. But in a certain context i just seem to be getting this error and it disconnects me. I'm try to understand why. I don't think the data is to long because it's fine setting it in different contexts.
3 Replies
Hi @RonJames. I'm kapa.ai, your friendly support bot. I will try to answer your question by searching through the knowledge base. :wave:
----------------------
The error message "Client: Failed to send reliable datastore message. Disconnecting." typically indicates that something went wrong when trying to synchronize your data with the Normcore server. Based on your description—using a RealtimeDictionary to store serialized objects as byte arrays—there are a few likely causes, supported by the documentation:
1. Datastore or Update Size Limits
Normcore imposes strict size limits:
- Datastore limit: 10 MB total.
- Single datastore update limit: 125 KB.
If your serialized byte array, or the total size of the update packet (which may include multiple changes), exceeds 125 KB, the server will reject the update, which can result in a disconnect. This can happen even if it works in other contexts, depending on what else is being updated in the same frame or what the current state of the datastore is. The documentation specifically warns about this:
Supported Primitives 3. Contextual Differences If it works in some contexts but not others, consider: - Are you updating more data at once in the failing context? - Are there more simultaneous changes, causing the update packet to exceed the size limit? - Is the RealtimeDictionary being modified by multiple clients at once, causing conflicts or excessive data to be sent? 4. Disconnect Events Normcore will disconnect the client if it cannot send a reliable message, which can be triggered by exceeding size limits or other serialization errors. You can listen for disconnect events and inspect the
Disconnect Events --- Recommendations: - Check the size of your serialized byte arrays and the total size of all updates in a single frame. - Use logging to inspect the size of the data being sent. - Consider storing large data externally and only synchronizing references/keys in Normcore. - Ensure you are using
Datastores are limited to 10mb, and a single datastore update is limited to 125kb. The Normcore datastore is designed to hold data that changes in real-time. If you need to store textures or large blobs, write them to S3 or Google Cloud Storage and store the key in the Normcore datastore.Room: Common Questions 2. Unsupported Data Types or Serialization Issues Only certain primitives and collections are supported for synchronization. While
byte[]
is supported, you must ensure you are using the correct attributes and settings, especially regarding equality checks. If you are not updating the reference to the byte array, Normcore may not detect the change unless you set includeEqualityCheck: false
in your [RealtimeProperty]
attribute.Supported Primitives 3. Contextual Differences If it works in some contexts but not others, consider: - Are you updating more data at once in the failing context? - Are there more simultaneous changes, causing the update packet to exceed the size limit? - Is the RealtimeDictionary being modified by multiple clients at once, causing conflicts or excessive data to be sent? 4. Disconnect Events Normcore will disconnect the client if it cannot send a reliable message, which can be triggered by exceeding size limits or other serialization errors. You can listen for disconnect events and inspect the
DisconnectEvent
for more details on why the disconnect occurred.Disconnect Events --- Recommendations: - Check the size of your serialized byte arrays and the total size of all updates in a single frame. - Use logging to inspect the size of the data being sent. - Consider storing large data externally and only synchronizing references/keys in Normcore. - Ensure you are using
includeEqualityCheck: false
if you are mutating the contents of a byte[]
without changing its reference.
If you continue to have issues, try to isolate the context where it fails and compare the data being sent to when it succeeds. This will help you pinpoint if it's a size, serialization, or logic issue.
If you need more specific debugging, capturing the disconnect event and its message can provide more insight into the exact cause of the failure.
----------------------
Note: you can ask me a follow up question by @ mentioning me again :speech_balloon:
----------------------<@378869779668140042> Kapa.ai is still learning and improving, please let me know how I did by reacting below.
My wild guess would be the data is indeed too long. Can you log the size of the last byte array it tries to send before Normcore disconnects? I'll check with the team if it's within the expected range for a RealtimeProperty.
After we check the length I'd be happy to look into a repro project