{"record":{"id":"6a01af553613a102","repo":"nathanmarz/storm","slug":"could-not-find-component-common-for-componentid","errorCode":null,"errorMessage":"Could not find component common for ${componentId}","messagePattern":"Could not find component common for (.+?)","errorType":"exception","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"storm-core/src/jvm/backtype/storm/utils/ThriftTopologyUtils.java","lineNumber":56,"sourceCode":"\n    public static ComponentCommon getComponentCommon(StormTopology topology, String componentId) {\n        for(StormTopology._Fields f: StormTopology.metaDataMap.keySet()) {\n            Map<String, Object> componentMap = (Map<String, Object>) topology.getFieldValue(f);\n            if(componentMap.containsKey(componentId)) {\n                Object component = componentMap.get(componentId);\n                if(component instanceof Bolt) {\n                    return ((Bolt) component).get_common();\n                }\n                if(component instanceof SpoutSpec) {\n                    return ((SpoutSpec) component).get_common();\n                }\n                if(component instanceof StateSpoutSpec) {\n                    return ((StateSpoutSpec) component).get_common();\n                }\n                throw new RuntimeException(\"Unreachable code! No get_common conversion for component \" + component);\n            }\n        }\n        throw new IllegalArgumentException(\"Could not find component common for \" + componentId);\n    }\n}\n","sourceCodeStart":38,"sourceCodeEnd":59,"githubUrl":"https://github.com/nathanmarz/storm/blob/cdb116e942666973bc4eaa0df098d5bab82739e7/storm-core/src/jvm/backtype/storm/utils/ThriftTopologyUtils.java#L38-L59","documentation":"ThriftTopologyUtils.getComponentCommon looks up the storm.thrift component-common (StormTopology._fields_to_component_common) entry for a given component id inside a Thrift topology. It throws IllegalArgumentException when the component id is not a key in the topology's component map. This indicates the caller passed a component id that does not exist in the given topology.","triggerScenarios":"Calling getComponentCommon(topology, componentId) with a componentId absent from the topology's spouts/bolts/state_spouts maps — typically a typo, stale id, or querying a different topology instance than the one that defined the component.","commonSituations":"Storm internals or custom metric/coordination code resolving stream->component->common mappings after topology repartitioning or renaming; YAML-driven topology definitions where a 'to:' reference points at a nonexistent component name; code written against a modified topology graph that removed a component.","solutions":["Verify the componentId exactly matches a component name defined in the topology (spout/bolt declarations) — check spelling and case.","Regenerate or re-submit the topology so its _fields_to_component_common map is populated, instead of using a stale deserialized/modified Thrift topology object.","If building topologies programmatically, ensure every id referenced by wiring (fieldsGrouping, shuffleGrouping targets) is the same id used at declaration time.","Guard calls by checking topology.get_bolts()/get_spouts() for the id before calling getComponentCommon."],"exampleFix":"// before\nComponentCommon common = ThriftTopologyUtils.getComponentCommon(topology, componentId);\n// after\nMap<String, Bolt> bolts = topology.get_bolts();\nif (!bolts.containsKey(componentId)) {\n    throw new IllegalArgumentException(\"Unknown component: \" + componentId);\n}\nComponentCommon common = ThriftTopologyUtils.getComponentCommon(topology, componentId);","handlingStrategy":"validation","validationCode":"boolean exists = topology.get_bolts().containsKey(componentId)\n    || topology.get_spouts().containsKey(componentId)\n    || (topology.get_state_spouts() != null && topology.get_state_spouts().containsKey(componentId));\nif (!exists) throw new IllegalArgumentException(\"component not in topology: \" + componentId);","typeGuard":"boolean isKnownComponent(StormTopology topo, String id) {\n    return topo.get_bolts().containsKey(id) || topo.get_spouts().containsKey(id);\n}","tryCatchPattern":"try {\n    common = ThriftTopologyUtils.getComponentCommon(topology, componentId);\n} catch (IllegalArgumentException e) {\n    LOG.warn(\"Unknown component id \" + componentId + \", skipping: \" + e.getMessage());\n    common = null;\n}","preventionTips":["Derive component ids from the same constants/variables used at declaration time — never retype ids.","When wiring groups, validate target names against the declared component map before submit.","After programmatic topology mutation (removals/renames), re-verify all references.","Check YAML topology definitions with a validator that cross-references 'to:'/'from:' names with declared components."],"tags":["thrift","topology","storm","lookup-failure"],"backgroundTag":"entity-not-found","analyzedSha":"cdb116e942666973bc4eaa0df098d5bab82739e7","analyzedAt":"2026-09-12T14:30:00.714Z","contentChangedAt":"2026-09-12T14:30:00.714Z","schemaVersion":2},"datasetVersion":"2026-09-16T09:17:16.951Z"}