dotnet/runtime · error · Exception

Invalid Entry {line}in {exclusion_filename}

Error message

Invalid Entry {line}in {exclusion_filename}

What it means

Raised by parseExclusionList in utilities.py for a line whose `:`-split yields more than 5 tokens. Exclusion entries have a fixed 0..4 token layout (type:task:provider:*:symbol); anything longer is malformed. (Note the message has a missing-space bug before 'in'.)

Source

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

    if not os.path.isfile(exclusion_filename):
        return exclusionInfo

    with open(exclusion_filename,'r') as ExclusionFile:

        for line in ExclusionFile:
            line = line.strip()

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

            tokens = line.split(':')
            #entries starting with nomac are ignored
            if "nomac" in tokens:
                continue

            if len(tokens) > 5:
                raise Exception("Invalid Entry " + line + "in "+ exclusion_filename)

            eventProvider = tokens[2]
            eventTask     = tokens[1]
            eventSymbol   = tokens[4]

            if eventProvider == '':
                eventProvider = "*"
            if eventTask     == '':
                eventTask     = "*"
            if eventSymbol   == '':
                eventSymbol   = "*"
            entry = eventProvider + ":" + eventTask + ":" + eventSymbol

            if tokens[0].lower() == "nostack":
                exclusionInfo.nostack.add(entry)
            if tokens[0].lower() == "stack":
                exclusionInfo.explicitstack.add(entry)
            if tokens[0].lower() == "noclrinstanceid":

View on GitHub (pinned to 290d5ab72c)

Solutions

  1. Open the exclusion file and find the offending line (printed as `{line}`); reduce it to at most 5 colon fields.
  2. Trim trailing whitespace/colons: `sed -i 's/:*$//' <exclusion_filename>` (carefully).
  3. Validate the file format against the expected `type:task:provider::*:symbol` shape before running.
  4. Add `#` comments for any non-conforming lines.

Example fix

// before
nostack:Task:Provider::Symbol:Extra  // 6 tokens -> raises [198]
// after
nostack:Task:Provider::Symbol
Defensive patterns

Strategy: validation

Validate before calling

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

Type guard

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

Try / catch

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

Prevention

When it happens

Trigger: A line in the exclusion file contains 6+ colon-separated fields, e.g. an extra trailing `:segment`.

Common situations: Hand-edited exclusion list with stray colons; copy-paste from an inclusion-format file; invisible trailing ':' from editor; line wrapped with a colon.

Related errors


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