nathanmarz/storm · error · AlreadyAliveException

Topology already alive exception

Error message

Topology already alive exception

What it means

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.

Solutions

  1. Kill the existing topology first: `storm kill <name>` (allow time for it to deactivate) then resubmit.
  2. Or submit under a new unique name if parallel instances are intended.
  3. If kill seems done but error persists, check `storm list` — topology may be in KILLED transition; wait and retry.
  4. Use `storm deactivate` + kill if workers must drain first, then submit the new version.
  5. Automate deploys as kill-then-submit (with wait) to make resubmission idempotent.

Example fix

// before
StormSubmitter.submitTopology("my-topology", conf, builder.createTopology()); // fails if already running
// after
// run first:
//   storm kill my-topology && sleep 60
// then:
StormSubmitter.submitTopology("my-topology", conf, builder.createTopology());
Defensive patterns

Strategy: try-catch

Validate before calling

// before submitting, check whether the name is taken
NimbusClient client = NimbusClient.getConfiguredClient(conf);
boolean alive = client.getClient().activeTopologies().contains(name);
client.close();
if (alive) { /* kill first, wait, or pick a new name */ }

Try / catch

try {
    StormSubmitter.submitTopology(name, conf, topology);
} catch (AlreadyAliveException e) {
    LOG.warn("Topology " + name + " already running; kill it or choose a new name", e);
}

Prevention

When it happens

Trigger: 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.

Common situations: 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.

Understand the failure class

Background: "already exists" / EEXIST / FileAlreadyExistsException: what the 'file already exists' error means and how to fix it — this error's family across 37 libraries.

Related errors


AI-assisted analysis of nathanmarz/storm@cdb116e942 (2026-09-12). Data as JSON: /api/errors/765e7aaa23b4a84f. Report an issue: GitHub.

Appendix: source

Thrown at storm-core/src/jvm/backtype/storm/StormSubmitter.java:104

            } else {
                NimbusClient client = NimbusClient.getConfiguredClient(conf);
                if(topologyNameExists(conf, name)) {
                    throw new RuntimeException("Topology with name `" + name + "` already exists on cluster");
                }
                submitJar(conf);
                try {
                    LOG.info("Submitting topology " +  name + " in distributed mode with conf " + serConf);
                    if(opts!=null) {
                        client.getClient().submitTopologyWithOpts(name, submittedJar, serConf, topology, opts);                    
                    } else {
                        // this is for backwards compatibility
                        client.getClient().submitTopology(name, submittedJar, serConf, topology);                                            
                    }
                } catch(InvalidTopologyException e) {
                    LOG.warn("Topology submission exception", e);
                    throw e;
                } catch(AlreadyAliveException e) {
                    LOG.warn("Topology already alive exception", e);
                    throw e;
                } finally {
                    client.close();
                }
            }
            LOG.info("Finished submitting topology: " +  name);
        } catch(TException e) {
            throw new RuntimeException(e);
        }
    }
    
    private static boolean topologyNameExists(Map conf, String name) {
        NimbusClient client = NimbusClient.getConfiguredClient(conf);
        try {
            ClusterSummary summary = client.getClient().getClusterInfo();
            for(TopologySummary s : summary.get_topologies()) {
                if(s.get_name().equals(name)) {  
                    return true;

View on GitHub (pinned to cdb116e942)