dotnet/runtime · error · Exception

Invalid Entry {line}in {inclusion_filename}

Error message

Invalid Entry {line}in {inclusion_filename}

What it means

Raised by parseInclusionList in utilities.py for a line whose `:`-split yields more than 2 tokens. Inclusion entries are either `eventName` or `providerName:eventName`; a third field is invalid. (Note the missing-space-before-'in' message bug, identical to the exclusion variant.)

Source

Thrown at src/coreclr/scripts/utilities.py:195

    if not os.path.isfile(inclusion_filename):
        return inclusion_list

    with open(inclusion_filename,'r') as InclusionFile:
        for line in InclusionFile:
            line = line.strip()

            #remove comments
            if not line or line.startswith('#'):
                continue

            tokens = line.split(':')

            if len(tokens) == 0:
                continue

            if len(tokens) > 2:
                raise Exception("Invalid Entry " + line + "in "+ inclusion_filename)

            providerName = ""
            eventName = ""

            if len(tokens) == 2:
                providerName = tokens[0]
                eventName = tokens[1]

            if len(tokens) == 1:
                providerName = "*"
                eventName = tokens[0]

            if providerName not in inclusion_list:
                inclusion_list[providerName] = set()

            inclusion_list[providerName].add(eventName)

    return inclusion_list

View on GitHub (pinned to 290d5ab72c)

Solutions

  1. Open the inclusion file and fix the printed `{line}` to at most 2 colon fields.
  2. Confirm you are editing the inclusion file, not the exclusion file (different field counts).
  3. Strip trailing colons and re-validate line-by-line.
  4. Comment out (`#`) any line you can't immediately classify.

Example fix

// before
Provider:Task:Event  // 3 tokens -> raises [199]
// after
Provider:Event
Defensive patterns

Strategy: validation

Validate before calling

with open(inclusion_filename) as fh:
    for i, raw in enumerate(fh, 1):
        line = raw.strip()
        if not line or line.startswith('#'): continue
        if len(line.split(':')) > 2:
            raise SystemExit(f'inclusion line {i} has >2 fields: {line!r}')

Type guard

def inclusion_line_valid(line: str) -> bool:
    return len(line.split(':')) <= 2

Try / catch

try:
    parseInclusionList(inclusion_filename)
except Exception as e:
    if 'Invalid Entry' in str(e) and inclusion_filename in str(e):
        print('fix the printed inclusion line, then rerun'); raise

Prevention

When it happens

Trigger: An inclusion-file line contains 3+ colon-separated fields, e.g. `Provider:Task:Event` copied from exclusion syntax.

Common situations: Mixing exclusion (5-field) syntax into the inclusion (2-field) file; stray colons; editor auto-wrap inserting ':'; copy-paste from the wrong template.

Related errors


AI-assisted analysis of dotnet/runtime@290d5ab72c (2026-08-06). Data as JSON: /api/errors/078b59f37b30dcd1. Report an issue: GitHub.