ppy/osu · error · InvalidDataException

Unknown hit object type: {split[3]}

Error message

Unknown hit object type: {split[3]}

What it means

Thrown as InvalidDataException by ConvertHitObjectParser when, after dispatching on the type flags, no branch produced a hit object (result is still null). The type field did not match any known LegacyHitObjectType combination the parser handles.

Source

Thrown at osu.Game/Rulesets/Objects/Legacy/ConvertHitObjectParser.cs:181

            }
            else if (type.HasFlag(LegacyHitObjectType.Hold))
            {
                // Note: Hold is generated by BMS converts

                double endTime = Math.Max(startTime, Parsing.ParseDouble(split[2]));

                if (split.Length > 5 && !string.IsNullOrEmpty(split[5]))
                {
                    string[] ss = split[5].Split(':');
                    endTime = Math.Max(startTime, Parsing.ParseDouble(ss[0]));
                    readCustomSampleBanks(string.Join(':', ss.Skip(1)), bankInfo);
                }

                result = createHold(pos, endTime + offset - startTime);
            }

            if (result == null)
                throw new InvalidDataException($"Unknown hit object type: {split[3]}");

            result.StartTime = startTime;
            result.LegacyType = type;

            if (result.Samples.Count == 0)
                result.Samples = convertSoundType(soundType, bankInfo);

            firstObject = false;

            return result;
        }

        private void readCustomSampleBanks(string str, SampleBankInfo bankInfo, bool banksOnly = false)
        {
            if (string.IsNullOrEmpty(str))
                return;

            string[] split = str.Split(':');

View on GitHub (pinned to d9c73e12ad)

Solutions

  1. Use a valid, non-corrupt beatmap file.
  2. Update the parser/client to a version supporting the beatmap's format.
  3. Catch InvalidDataException during import and skip the malformed beatmap.
Defensive patterns

Strategy: try-catch

Validate before calling

// type-field validity depends on the full LegacyHitObjectType flag set;
// pre-validate that the type contains a recognised base flag before parsing.

Type guard

bool HasRecognisedType(LegacyHitObjectType t)
    => t.HasFlag(LegacyHitObjectType.Circle) || t.HasFlag(LegacyHitObjectType.Slider)
       || t.HasFlag(LegacyHitObjectType.Spinner) || t.HasFlag(LegacyHitObjectType.Hold);

Try / catch

try { parser.ParseLine(line); }
catch (InvalidDataException) { /* unknown type: skip or quarantine beatmap */ }

Prevention

When it happens

Trigger: A beatmap hit-object line whose type field (split[3]) does not contain a recognized combination of flags (circle/slider/spinner/hold), or contains an unsupported combination.

Common situations: Corrupt beatmap; beatmap authored by a newer editor using type flags this parser version does not recognise; truncated/garbled line.

Related errors


AI-assisted analysis of ppy/osu@d9c73e12ad (2026-08-13). Data as JSON: /api/errors/29f9e5d4cf167a26. Report an issue: GitHub.