{"record":{"id":"c0c79a733780d3af","repo":"dotnet/runtime","slug":"invalid-entry-line-in-exclusion-filename","errorCode":null,"errorMessage":"Invalid Entry {line}in {exclusion_filename}","messagePattern":"Invalid Entry (.+?)in (.+?)","errorType":"exception","errorClass":"Exception","httpStatus":null,"severity":"error","filePath":"src/coreclr/scripts/utilities.py","lineNumber":151,"sourceCode":"    if not os.path.isfile(exclusion_filename):\n        return exclusionInfo\n\n    with open(exclusion_filename,'r') as ExclusionFile:\n\n        for line in ExclusionFile:\n            line = line.strip()\n\n            #remove comments\n            if not line or line.startswith('#'):\n                continue\n\n            tokens = line.split(':')\n            #entries starting with nomac are ignored\n            if \"nomac\" in tokens:\n                continue\n\n            if len(tokens) > 5:\n                raise Exception(\"Invalid Entry \" + line + \"in \"+ exclusion_filename)\n\n            eventProvider = tokens[2]\n            eventTask     = tokens[1]\n            eventSymbol   = tokens[4]\n\n            if eventProvider == '':\n                eventProvider = \"*\"\n            if eventTask     == '':\n                eventTask     = \"*\"\n            if eventSymbol   == '':\n                eventSymbol   = \"*\"\n            entry = eventProvider + \":\" + eventTask + \":\" + eventSymbol\n\n            if tokens[0].lower() == \"nostack\":\n                exclusionInfo.nostack.add(entry)\n            if tokens[0].lower() == \"stack\":\n                exclusionInfo.explicitstack.add(entry)\n            if tokens[0].lower() == \"noclrinstanceid\":","sourceCodeStart":133,"sourceCodeEnd":169,"githubUrl":"https://github.com/dotnet/runtime/blob/290d5ab72cc1102813fbc0406fb186ceadabc340/src/coreclr/scripts/utilities.py#L133-L169","documentation":"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'.)","triggerScenarios":"A line in the exclusion file contains 6+ colon-separated fields, e.g. an extra trailing `:segment`.","commonSituations":"Hand-edited exclusion list with stray colons; copy-paste from an inclusion-format file; invisible trailing ':' from editor; line wrapped with a colon.","solutions":["Open the exclusion file and find the offending line (printed as `{line}`); reduce it to at most 5 colon fields.","Trim trailing whitespace/colons: `sed -i 's/:*$//' <exclusion_filename>` (carefully).","Validate the file format against the expected `type:task:provider::*:symbol` shape before running.","Add `#` comments for any non-conforming lines."],"exampleFix":"// before\nnostack:Task:Provider::Symbol:Extra  // 6 tokens -> raises [198]\n// after\nnostack:Task:Provider::Symbol","handlingStrategy":"validation","validationCode":"with open(exclusion_filename) as fh:\n    for i, raw in enumerate(fh, 1):\n        line = raw.strip()\n        if not line or line.startswith('#') or 'nomac' in line.split(':'): continue\n        if len(line.split(':')) > 5:\n            raise SystemExit(f'exclusion line {i} has >5 fields: {line!r}')","typeGuard":"def exclusion_line_valid(line: str) -> bool:\n    return len(line.split(':')) <= 5","tryCatchPattern":"try:\n    parseExclusionList(exclusion_filename)\nexcept Exception as e:\n    if 'Invalid Entry' in str(e) and exclusion_filename in str(e):\n        print('fix the printed exclusion line, then rerun'); raise","preventionTips":["Lint exclusion files in CI before use","Document the 5-field format at the top of the file","Avoid stray trailing colons"],"tags":["configuration","parsing","utilities","validation"],"analyzedSha":"290d5ab72cc1102813fbc0406fb186ceadabc340","analyzedAt":"2026-08-06T19:57:01.276Z","schemaVersion":2},"datasetVersion":"2026-08-06T23:17:07.152Z"}