{"record":{"id":"765e7aaa23b4a84f","repo":"nathanmarz/storm","slug":"topology-already-alive-exception","errorCode":null,"errorMessage":"Topology already alive exception","messagePattern":"Topology already alive exception","errorType":"console","errorClass":"AlreadyAliveException","httpStatus":null,"severity":"error","filePath":"storm-core/src/jvm/backtype/storm/StormSubmitter.java","lineNumber":104,"sourceCode":"            } 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();\n                }\n            }\n            LOG.info(\"Finished submitting topology: \" +  name);\n        } catch(TException e) {\n            throw new RuntimeException(e);\n        }\n    }\n    \n    private static boolean topologyNameExists(Map conf, String name) {\n        NimbusClient client = NimbusClient.getConfiguredClient(conf);\n        try {\n            ClusterSummary summary = client.getClient().getClusterInfo();\n            for(TopologySummary s : summary.get_topologies()) {\n                if(s.get_name().equals(name)) {  \n                    return true;","sourceCodeStart":86,"sourceCodeEnd":122,"githubUrl":"https://github.com/nathanmarz/storm/blob/cdb116e942666973bc4eaa0df098d5bab82739e7/storm-core/src/jvm/backtype/storm/StormSubmitter.java#L86-L122","documentation":"StormSubmitter.submitTopology() catches AlreadyAliveException thrown by Nimbus when a topology with the same name is already actively running on the cluster. It logs 'Topology already alive exception' and rethrows it, failing the submission. Storm topology names must be unique among active topologies; to replace a running topology you must kill it first or use a different name.","triggerScenarios":"Calling StormSubmitter.submitTopology(name, ...) when a topology named `name` is already ACTIVE on the cluster; also resubmitting the same topology from a restarted script without killing the old one first.","commonSituations":"CI/CD redeploy scripts that submit without killing; running `storm jar` twice; topology stuck in a non-dead state after a failed kill; accidental duplicate submission from two operator terminals.","solutions":["Kill the existing topology first: `storm kill <name>` (allow time for it to deactivate) then resubmit.","Or submit under a new unique name if parallel instances are intended.","If kill seems done but error persists, check `storm list` — topology may be in KILLED transition; wait and retry.","Use `storm deactivate` + kill if workers must drain first, then submit the new version.","Automate deploys as kill-then-submit (with wait) to make resubmission idempotent."],"exampleFix":"// before\nStormSubmitter.submitTopology(\"my-topology\", conf, builder.createTopology()); // fails if already running\n// after\n// run first:\n//   storm kill my-topology && sleep 60\n// then:\nStormSubmitter.submitTopology(\"my-topology\", conf, builder.createTopology());","handlingStrategy":"try-catch","validationCode":"// before submitting, check whether the name is taken\nNimbusClient client = NimbusClient.getConfiguredClient(conf);\nboolean alive = client.getClient().activeTopologies().contains(name);\nclient.close();\nif (alive) { /* kill first, wait, or pick a new name */ }","typeGuard":null,"tryCatchPattern":"try {\n    StormSubmitter.submitTopology(name, conf, topology);\n} catch (AlreadyAliveException e) {\n    LOG.warn(\"Topology \" + name + \" already running; kill it or choose a new name\", e);\n}","preventionTips":["Script deploys as `storm kill <name>` + wait-for-inactive + submit.","Include a version/build suffix in topology names when parallel runs are acceptable.","Check `storm list` before submitting in interactive workflows.","Guard CI against concurrent deploys of the same topology name."],"tags":["topology","submission","duplicate","nimbus","name-conflict"],"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"}