{"record":{"id":"42b84fbce1f54af5","repo":"nathanmarz/storm","slug":"no-output-fields-defined-for-component-stream-componentid","errorCode":null,"errorMessage":"No output fields defined for component:stream ${componentId}:${streamId}","messagePattern":"No output fields defined for component:stream (.+?):(.+?)","errorType":"exception","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"storm-core/src/jvm/backtype/storm/task/GeneralTopologyContext.java","lineNumber":113,"sourceCode":"    }\n\n    /**\n     * Gets the task ids allocated for the given component id. The task ids are\n     * always returned in ascending order.\n     */\n    public List<Integer> getComponentTasks(String componentId) {\n        List<Integer> ret = _componentToTasks.get(componentId);\n        if(ret==null) return new ArrayList<Integer>();\n        else return new ArrayList<Integer>(ret);\n    }\n\n    /**\n     * Gets the declared output fields for the specified component/stream.\n     */\n    public Fields getComponentOutputFields(String componentId, String streamId) {\n        Fields ret = _componentToStreamToFields.get(componentId).get(streamId);\n        if(ret==null) {\n            throw new IllegalArgumentException(\"No output fields defined for component:stream \" + componentId + \":\" + streamId);\n        }\n        return ret;\n    }\n\n    /**\n     * Gets the declared output fields for the specified global stream id.\n     */\n    public Fields getComponentOutputFields(GlobalStreamId id) {\n        return getComponentOutputFields(id.get_componentId(), id.get_streamId());\n    }    \n    \n    /**\n     * Gets the declared inputs to the specified component.\n     *\n     * @return A map from subscribed component/stream to the grouping subscribed with.\n     */\n    public Map<GlobalStreamId, Grouping> getSources(String componentId) {\n        return getComponentCommon(componentId).get_inputs();","sourceCodeStart":95,"sourceCodeEnd":131,"githubUrl":"https://github.com/nathanmarz/storm/blob/cdb116e942666973bc4eaa0df098d5bab82739e7/storm-core/src/jvm/backtype/storm/task/GeneralTopologyContext.java#L95-L131","documentation":"GeneralTopologyContext.getComponentOutputFields looks up the declared output Fields for a component/stream pair in the topology definition. If the map has no entry for that (componentId, streamId), it throws this IllegalArgumentException. It means the code asked for output fields of a stream the component never declared, or the stream id is misspelled (including the default stream).","triggerScenarios":"Calling getComponentOutputFields(componentId, streamId) for a component that exists but declared no fields on that stream; using a stream name not passed to declareStream in the bolt/spout's declareOutputFields; wrong default stream id when component only declares named streams; looking up a component that isn't part of the topology.","commonSituations":"Typos in stream ids between declareStream/emit(streamId,...) and consumer lookups; a bolt emitting to a custom stream the consumer queries under the default \"default\" id; topology rebalancing/version mismatch where the running topology differs from expected; programmatic topology wiring using wrong component name.","solutions":["Declare the stream explicitly in declareOutputFields via OutputFieldsDeclarer.declareStream(streamId, fields) before emitting on it","Verify the exact stream id string matches (including \"default\") between producer declaration and the getComponentOutputFields call","Check the componentId matches the name given when setBolt/setSpout in the TopologyBuilder","If relying on default stream, use declarer.declare(fields) rather than mixing named and default streams"],"exampleFix":"// before\n// bolt never declares the stream \"metrics\"\n_collector.emit(\"metrics\", tuple, values);\n\n// after\npublic void declareOutputFields(OutputFieldsDeclarer declarer) {\n    declarer.declareStream(\"metrics\", new Fields(\"name\", \"value\"));\n}","handlingStrategy":"validation","validationCode":"// before emitting/consuming a named stream, ensure it is declared:\nTopologies topo = ...; // your built topology\nFields f = topo.getBolt(\"mybolt\").getDeclaredFields(\"metrics\"); // or inspect the declared component config\n// or in the bolt itself: always declare before use\n// declarer.declareStream(\"metrics\", new Fields(\"name\",\"value\"));","typeGuard":null,"tryCatchPattern":"try {\n    Fields fields = context.getComponentOutputFields(componentId, streamId);\n    ...\n} catch (IllegalArgumentException e) {\n    LOG.error(\"Undeclared stream {}:{} for component\", streamId, componentId, e);\n    throw e; // fail fast; declaration bug must be fixed\n}","preventionTips":["Declare every custom stream in declareOutputFields before emitting on it","Centralize stream id constants instead of string literals","Verify component names match TopologyBuilder.setBolt/setSpout names exactly","Smoke-test the full topology wiring in LocalCluster before deploying"],"tags":["storm","topology","streams"],"backgroundTag":"resource-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"}