jenkinsci/jenkins · error · AbortException

Error occurred while performing this command, see previous s

Error message

Error occurred while performing this command, see previous stderr output.

What it means

The constant `CLI_LISTPARAM_SUMMARY_ERROR_TEXT` ('Error occurred while performing this command, see previous stderr output.') is thrown as an AbortException by `ConnectNodeCommand.run()` after iterating a comma-separated list of agents when at least one failed. Per-node failures are caught, printed to stderr as `'<node>: <message>'`, and set `errorOccurred`; after the loop the summary abort terminates the command with a non-zero exit. It is shared by all multi-valued node/job CLI commands.

Source

Thrown at core/src/main/java/hudson/cli/ConnectNodeCommand.java:80

        for (String node_s : hs) {
            try {
                Computer computer = Computer.resolveForCLI(node_s);
                computer.cliConnect(force);
            } catch (Exception e) {
                if (hs.size() == 1) {
                    throw e;
                }

                final String errorMsg = node_s + ": " + e.getMessage();
                stderr.println(errorMsg);
                errorOccurred = true;
                continue;
            }
        }

        if (errorOccurred) {
            throw new AbortException(CLI_LISTPARAM_SUMMARY_ERROR_TEXT);
        }
        return 0;
    }
}

View on GitHub (pinned to 2e228ff40b)

Solutions

  1. Read the preceding stderr lines: each prints `<node>: <root message>` identifying which node failed and why; fix those specific nodes.
  2. Retry the failed nodes individually (`connect-node <singleNode>`) to get the precise exception instead of the summary.
  3. Validate node names exist (`jenkins get-node` / the nodes view) and confirm the agent launch configuration before batch reconnecting.

Example fix

// before: batch reconnect hides per-node cause in summary
//   java -jar jenkins-cli.jar connect-node agent1,agent2,typoAgent
//   -> AbortException: 'Error occurred while performing this command...'
//
// after: run failing node alone to see the real error, then reconnect the batch
//   java -jar jenkins-cli.jar connect-node typoAgent
//   java -jar jenkins-cli.jar connect-node agent1,agent2
Defensive patterns

Strategy: try-catch

Validate before calling

// Validate node names exist before batch connecting:
//   for n in nodeA,nodeB,nodeC; do java -jar jenkins-cli.jar get-node "$n" >/dev/null || echo "missing: $n"; done

Try / catch

// Multi-node commands print per-node errors to stderr then abort;
// capture stderr to map failures back to nodes.
Process p = new ProcessBuilder("java", "-jar", "jenkins-cli.jar",
        "connect-node", String.join(",", nodes)).redirectErrorStream(false).start();
int rc = p.waitFor();
List<String> nodeErrors = readLines(p.getErrorStream()); // each: "<node>: <msg>"
if (rc != 0 && nodeErrors.stream().noneMatch(l -> l.contains(CLI_LISTPARAM_SUMMARY_ERROR_TEXT))) {
    // not just a summary; rethrow/log the real per-node causes
}

Prevention

When it happens

Trigger: Running `java -jar jenkins-cli.jar connect-node nodeA,nodeB,nodeC` (more than one node) where at least one `Computer.resolveForCLI(node_s)` or `computer.cliConnect(force)` throws (unknown node, agent launch failure, already-connected). With exactly one node the original exception is rethrown instead.

Common situations: Typo'd agent names, agents that are offline/unreachable, launchers misconfigured, mixed valid/invalid node names in a batch reconnect.

Related errors


AI-assisted analysis of jenkinsci/jenkins@2e228ff40b (2026-08-14). Data as JSON: /api/errors/942a9050d28949db. Report an issue: GitHub.