{"record":{"id":"9d43477347886696","repo":"dotnet/runtime","slug":"error-processing-event-id-this-file-mu","errorCode":null,"errorMessage":"{}: Error processing event :{}(ID{}): This file must contain either ALL versions of this event or NO versions of this event. Currently some, but not all, versions of this event are present\n","messagePattern":"(.+?): Error processing event :(.+?)\\(ID(.+?)\\): This file must contain either ALL versions of this event or NO versions of this event\\. Currently some, but not all, versions of this event are present\n","errorType":"exception","errorClass":"Exception","httpStatus":null,"severity":"error","filePath":"src/coreclr/scripts/genEtwProvider.py","lineNumber":144,"sourceCode":"            # and some versions are not on either the nostack or stack list,\n            # then developer likely forgot to specify one of the versions\n\n            eventStackBitFromNoStackList       = getStackWalkBit(eventProvider, taskName, eventSymbol, exclusionInfo.nostack)\n            eventStackBitFromExplicitStackList = getStackWalkBit(eventProvider, taskName, eventSymbol, exclusionInfo.explicitstack)\n            sStackSpecificityError = exclusion_filename + \": Error processing event :\" + eventSymbol + \"(ID\" + str(eventValue) + \"): This file must contain either ALL versions of this event or NO versions of this event. Currently some, but not all, versions of this event are present\\n\"\n\n            if not stackSupportSpecified.get(eventValue):\n                 # Haven't checked this event before.  Remember whether a preference is stated\n                if ( not eventStackBitFromNoStackList) or ( not eventStackBitFromExplicitStackList):\n                    stackSupportSpecified[eventValue] = True\n                else:\n                    stackSupportSpecified[eventValue] = False\n            else:\n                # We've checked this event before.\n                if stackSupportSpecified[eventValue]:\n                    # When we last checked, a preference was previously specified, so it better be specified here\n                    if eventStackBitFromNoStackList and eventStackBitFromExplicitStackList:\n                        raise Exception(sStackSpecificityError)\n                else:\n                    # When we last checked, a preference was not previously specified, so it better not be specified here\n                    if ( not eventStackBitFromNoStackList) or ( not eventStackBitFromExplicitStackList):\n                        raise Exception(sStackSpecificityError)\n\ndef genEtwMacroHeader(manifest, exclusion_filename, intermediate):\n    provider_dirname = os.path.join(intermediate, etw_dirname + \"_temp\")\n\n    if not os.path.exists(provider_dirname):\n        os.makedirs(provider_dirname)\n\n    tree                      = DOM.parse(manifest)\n    numOfProviders            = len(tree.getElementsByTagName('provider'))\n    nMaxEventBytesPerProvider = 64\n\n    exclusionInfo = parseExclusionList(exclusion_filename)\n\n    with open_for_update(os.path.join(provider_dirname, macroheader_filename)) as header_file:","sourceCodeStart":126,"sourceCodeEnd":162,"githubUrl":"https://github.com/dotnet/runtime/blob/60108ba66eb7d1d12f595480091b4ad80a24b172/src/coreclr/scripts/genEtwProvider.py#L126-L162","documentation":"Raised by checkConsistency() in genEtwProvider.py at line 144 when processing events with version numbers. The ETW manifest can have multiple versions of the same event (same value/ID, different versions). The exclusion list's nostack and explicitstack lists control which events collect stack walks. This error fires when a previously-encountered event value had a stack preference specified, but a subsequent version of the same event has NO preference — meaning the developer inconsistently specified stack support across versions.","triggerScenarios":"Triggered when: the code has already processed one version of an event (by its numeric 'value') and recorded stackSupportSpecified[eventValue]=True (meaning a preference was found in nostack or explicitstack), then encounters another version of the same event value where BOTH eventStackBitFromNoStackList and eventStackBitFromExplicitStackList are True (meaning getStackWalkBit returned True for both, i.e., the event is NOT found in either list). The inconsistency between versions triggers the error.","commonSituations":"A developer adds a new version of an event to the manifest but forgets to add the new version's symbol to the nostack or explicitstack exclusion list. The exclusion list uses wildcards that match one version but not another. The event versioning scheme changed and the exclusion list wasn't updated.","solutions":["Add ALL versions of the event symbol to either the nostack or explicitstack list in the exclusion file, or remove ALL versions from both lists.","Use wildcard patterns (e.g., 'Provider:Task:*') in the exclusion list to cover all versions of the event.","Check the manifest for all event elements sharing the same 'value' attribute and ensure consistent exclusion list coverage.","Review the exclusion list syntax: entries are 'provider:task:symbol' triplets."],"exampleFix":"# before (exclusion list has only one version):\n# noclrinstance:\n#   Microsoft-Windows-DotNETRuntime:GC:GCHeapStats_V1\n\n# after (add all versions):\n# nostack:\n#   Microsoft-Windows-DotNETRuntime:GC:GCHeapStats_V1\n#   Microsoft-Windows-DotNETRuntime:GC:GCHeapStats_V2","handlingStrategy":"validation","validationCode":"def validate_stack_version_consistency(manifest_path: str, exclusion_path: str) -> bool:\n    \"\"\"Check that all versions of each event are consistently in/out of stack lists.\"\"\"\n    import xml.dom.minidom as DOM\n    from utilities import parseExclusionList\n\n    tree = DOM.parse(manifest_path)\n    exclusion_info = parseExclusionList(exclusion_path)\n\n    for provider_node in tree.getElementsByTagName('provider'):\n        event_provider = provider_node.getAttribute('name')\n        stack_specified = {}\n        for event_node in provider_node.getElementsByTagName('event'):\n            task = event_node.getAttribute('task')\n            symbol = event_node.getAttribute('symbol')\n            value = int(event_node.getAttribute('value'))\n\n            in_nostack = _check_list(event_provider, task, symbol, exclusion_info.nostack)\n            in_explicitstack = _check_list(event_provider, task, symbol, exclusion_info.explicitstack)\n            has_pref = (not in_nostack) or (not in_explicitstack)\n\n            if value in stack_specified:\n                if stack_specified[value] != has_pref:\n                    print(f\"Inconsistent stack preference for event ID {value} ({symbol})\")\n                    return False\n            else:\n                stack_specified[value] = has_pref\n    return True\n\ndef _check_list(provider, task, symbol, stack_list):\n    for entry in stack_list:\n        tokens = entry.split(':')\n        if (tokens[0] in (provider, '*') and tokens[1] in (task, '*') and tokens[2] in (symbol, '*')):\n            return False  # found = getStackWalkBit returns False\n    return True","typeGuard":"null","tryCatchPattern":"try:\n    checkConsistency(manifest, exclusion_filename)\nexcept Exception as e:\n    if 'ALL versions' in str(e):\n        print(f\"Stack version inconsistency: {e}\")\n        print(\"Fix: ensure ALL versions of the event are in nostack/explicitstack, or NONE are.\")\n    raise","preventionTips":["When adding event versions to exclusion lists, add ALL versions consistently.","Use wildcards in exclusion list entries to cover all versions uniformly.","Run checkConsistency as a pre-commit validation step.","Document the version-to-exclusion-list mapping for each event.","Group event versions logically in the manifest to make exclusion management easier."],"tags":["etw","manifest","eventing","coreclr","exclusion-list"],"backgroundTag":null,"analyzedSha":"60108ba66eb7d1d12f595480091b4ad80a24b172","analyzedAt":"2026-08-10T18:54:11.478Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}