ppy/osu · error · IOException
Deserialization of arbitrary type is not supported.
Error message
Deserialization of arbitrary type is not supported.
What it means
Thrown by SerializationReader when the type discriminator byte equals ObjType.OtherType during generic object deserialisation. The reader only supports primitive types, byte/char arrays, DateTime, and ILegacySerializable; an 'OtherType' marker indicates an arbitrary serialised object that this reader deliberately refuses to instantiate.
Source
Thrown at osu.Game/IO/Legacy/SerializationReader.cs:178
return ReadSingle();
case ObjType.DoubleType:
return ReadDouble();
case ObjType.DecimalType:
return ReadDecimal();
case ObjType.DateTimeType:
return ReadDateTime();
case ObjType.ByteArrayType:
return ReadByteArray();
case ObjType.CharArrayType:
return ReadCharArray();
case ObjType.OtherType:
throw new IOException("Deserialization of arbitrary type is not supported.");
default:
return null;
}
}
}
public enum ObjType : byte
{
NullType,
BoolType,
ByteType,
UInt16Type,
UInt32Type,
UInt64Type,
SByteType,
Int16Type,
Int32Type,
View on GitHub (pinned to d9c73e12ad)
Solutions
- Confirm the stream section is meant to be read with the generic object reader; if it's a known ILegacySerializable, use ReadBList<T>/the typed path instead.
- Verify the data source and format version match the reader's expectations; reject incompatible files.
- Catch IOException around deserialisation and treat the payload as unsupported rather than crashing the import.
Example fix
// before
object value = reader.ReadObject(); // throws on OtherType
// after
try
{
object value = reader.ReadObject();
}
catch (IOException ex) when (ex.Message.Contains("not supported"))
{
Logger.Log("Unsupported serialised type encountered; payload skipped.", LoggingTarget.Database);
} Defensive patterns
Strategy: try-catch
Validate before calling
// Before generic read, confirm the expected type byte for this field.
ObjType t = (ObjType)reader.PeekByte();
if (t == ObjType.OtherType) throw new InvalidDataException("Unsupported object type in stream."); Try / catch
try { object value = reader.ReadObject(); }
catch (IOException ex) when (ex.Message.Contains("not supported"))
{ /* skip unsupported payload */ } Prevention
- Use the typed reader methods (ReadBList<T>, primitives) for known fields instead of generic ReadObject.
- Reject data from unknown/incompatible serialiser versions up front.
- Isolate deserialisation failures so one bad record doesn't abort a batch.
When it happens
Trigger: Calling the generic ReadObject/deserialise path on a stream whose type byte is OtherType — i.e. the data was written by a serialiser that embedded a complex type the osu! reader can't reconstruct. A security/integrity guard against unexpected types.
Common situations: Replay or legacy data produced by a different/newer serialiser, a truncated stream where the type byte is garbage, or an attempt to read a section with the wrong reader method.
Related errors
- Bad ticks count read!
- input .lzma is too short
- Can't Read 1
- Unknown hit object type.
- Unknown file format (no content)
AI-assisted analysis of ppy/osu@d9c73e12ad (2026-08-13).
Data as JSON: /api/errors/0b623288a26835b9.
Report an issue: GitHub.