nathanmarz/storm · error · RuntimeException

Topology with name ` ` already exists on cluster

Error message

Topology with name `${name}` already exists on cluster

What it means

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.

Solutions

  1. Kill the existing topology first: `storm kill <name>` (wait for deactivation to complete).
  2. Use a new unique topology name (e.g. append a version/timestamp).
  3. Script the redeploy: kill, wait for INACTIVE, then submit.
  4. If the old topology is actually dead but listed, check Nimbus state / use `storm list` to verify.

Example fix

# before
storm jar mytopology.jar com.mypack.MyTopology my-topology  # second run fails
# after
storm kill my-topology && sleep 20 && storm jar mytopology.jar com.mypack.MyTopology my-topology
Defensive patterns

Strategy: try-catch

Try / catch

try {
    StormSubmitter.submitTopology(name, conf, topology);
} catch (RuntimeException e) {
    if (e.getMessage() != null && e.getMessage().contains("already exists on cluster")) {
        // kill existing or pick new name, then retry
        System.err.println("Topology '" + name + "' already running; run: storm kill " + name);
    } else { throw e; }
}

Prevention

When it happens

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

Common situations: Re-deploying an updated topology without killing the old one; CI pipelines re-submitting with a fixed name; accidental duplicate submissions from scripts.

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/28d3ba1d6bcf5079. Report an issue: GitHub.

Appendix: source

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

     * @throws InvalidTopologyException if an invalid topology was submitted
     */
    public static void submitTopology(String name, Map stormConf, StormTopology topology, SubmitOptions opts) throws AlreadyAliveException, InvalidTopologyException {
        if(!Utils.isValidConf(stormConf)) {
            throw new IllegalArgumentException("Storm conf is not valid. Must be json-serializable");
        }
        stormConf = new HashMap(stormConf);
        stormConf.putAll(Utils.readCommandLineOpts());
        Map conf = Utils.readStormConfig();
        conf.putAll(stormConf);
        try {
            String serConf = JSONValue.toJSONString(stormConf);
            if(localNimbus!=null) {
                LOG.info("Submitting topology " + name + " in local mode");
                localNimbus.submitTopology(name, null, serConf, topology);
            } 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();

View on GitHub (pinned to cdb116e942)