{"record":{"id":"28d3ba1d6bcf5079","repo":"nathanmarz/storm","slug":"topology-with-name-name-already-exists-on-cluster","errorCode":null,"errorMessage":"Topology with name `${name}` already exists on cluster","messagePattern":"Topology with name `(.+?)` already exists on cluster","errorType":"exception","errorClass":"RuntimeException","httpStatus":null,"severity":"error","filePath":"storm-core/src/jvm/backtype/storm/StormSubmitter.java","lineNumber":89,"sourceCode":"     * @throws InvalidTopologyException if an invalid topology was submitted\n     */\n    public static void submitTopology(String name, Map stormConf, StormTopology topology, SubmitOptions opts) throws AlreadyAliveException, InvalidTopologyException {\n        if(!Utils.isValidConf(stormConf)) {\n            throw new IllegalArgumentException(\"Storm conf is not valid. Must be json-serializable\");\n        }\n        stormConf = new HashMap(stormConf);\n        stormConf.putAll(Utils.readCommandLineOpts());\n        Map conf = Utils.readStormConfig();\n        conf.putAll(stormConf);\n        try {\n            String serConf = JSONValue.toJSONString(stormConf);\n            if(localNimbus!=null) {\n                LOG.info(\"Submitting topology \" + name + \" in local mode\");\n                localNimbus.submitTopology(name, null, serConf, topology);\n            } else {\n                NimbusClient client = NimbusClient.getConfiguredClient(conf);\n                if(topologyNameExists(conf, name)) {\n                    throw new RuntimeException(\"Topology with name `\" + name + \"` already exists on cluster\");\n                }\n                submitJar(conf);\n                try {\n                    LOG.info(\"Submitting topology \" +  name + \" in distributed mode with conf \" + serConf);\n                    if(opts!=null) {\n                        client.getClient().submitTopologyWithOpts(name, submittedJar, serConf, topology, opts);                    \n                    } else {\n                        // this is for backwards compatibility\n                        client.getClient().submitTopology(name, submittedJar, serConf, topology);                                            \n                    }\n                } catch(InvalidTopologyException e) {\n                    LOG.warn(\"Topology submission exception\", e);\n                    throw e;\n                } catch(AlreadyAliveException e) {\n                    LOG.warn(\"Topology already alive exception\", e);\n                    throw e;\n                } finally {\n                    client.close();","sourceCodeStart":71,"sourceCodeEnd":107,"githubUrl":"https://github.com/nathanmarz/storm/blob/cdb116e942666973bc4eaa0df098d5bab82739e7/storm-core/src/jvm/backtype/storm/StormSubmitter.java#L71-L107","documentation":"During distributed submission, submitTopology checks topologyNameExists(conf, name) via Nimbus before uploading the jar. If a live topology already uses the given name, it throws a RuntimeException. Storm topology names must be unique on the cluster.","triggerScenarios":"Calling StormSubmitter.submitTopology with a name that is already active on the cluster without SubmitOptions with initialStatus override to kill/restart semantics; re-running a submit script twice.","commonSituations":"Re-deploying an updated topology without killing the old one; CI pipelines re-submitting with a fixed name; accidental duplicate submissions from scripts.","solutions":["Kill the existing topology first: `storm kill <name>` (wait for deactivation to complete).","Use a new unique topology name (e.g. append a version/timestamp).","Script the redeploy: kill, wait for INACTIVE, then submit.","If the old topology is actually dead but listed, check Nimbus state / use `storm list` to verify."],"exampleFix":"# before\nstorm jar mytopology.jar com.mypack.MyTopology my-topology  # second run fails\n# after\nstorm kill my-topology && sleep 20 && storm jar mytopology.jar com.mypack.MyTopology my-topology","handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"try {\n    StormSubmitter.submitTopology(name, conf, topology);\n} catch (RuntimeException e) {\n    if (e.getMessage() != null && e.getMessage().contains(\"already exists on cluster\")) {\n        // kill existing or pick new name, then retry\n        System.err.println(\"Topology '\" + name + \"' already running; run: storm kill \" + name);\n    } else { throw e; }\n}","preventionTips":["Version topology names (my-topology-v3) instead of reusing fixed names.","Automate kill-then-submit in deploy scripts with a wait between them.","Run `storm list` before deploying in CI."],"tags":["duplicate-name","topology-submission","storm"],"backgroundTag":"file-already-exists","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"}