apache/beam · error · Error
Aborted with error
Error message
Aborted with error ${this.process.exitCode} What it means
While waiting for an external service (Java/Python expansion or job service) to expose its port, the launcher polls the child process. If the process has already exited (non-zero exitCode), there is no point waiting for the port, so portReady throws immediately with the exit code. It usually means the underlying server crashed on startup.
Solutions
- Inspect the service process's stderr/stdout (captured streams) for the real startup failure.
- Verify the jar/python entry point exists and the Beam versions of SDK and service match.
- Check that the configured port/host is free and reachable.
- Re-run with the service binary manually to reproduce the crash outside the SDK.
Defensive patterns
Strategy: try-catch
Validate before calling
// before start(): verify binary and free port
if (!fs.existsSync(jarPath)) throw new Error('service jar missing');
const inUse = await isPortOpen(host, port); // expect false Try / catch
try {
await service.start();
} catch (e) {
if (/Aborted with error/.test(String(e))) {
// read captured stderr/logs, fix startup, retry once
logServiceStderr(service);
}
throw e;
} Prevention
- Capture and log the subprocess stderr on every start.
- Keep SDK and service jar versions aligned.
- Pre-validate the service binary path and port availability.
When it happens
Trigger: Calling service.start() (e.g. starting an expansion service or JavaJarService) where the spawned process exits during the port-wait loop, commonly because the jar/python entry point failed, a bad classpath/main class was given, or the port was taken and the process died.
Common situations: Mismatched Beam versions between the SDK and the service jar; missing JVM/dependencies; invalid service arguments; the external process writing an error to stderr then dying.
Understand the failure class
Background: ECONNREFUSED and "connection refused" / "could not connect to server" errors: what they mean and how to fix them — this error's family across 44 libraries.
Related errors
- Full trace: , \n output of the failed child process
- Can't find a Python executable.
- Could not generate external transform wrappers due to error
- Could not generate protos due to error
- error in startAutomatedJavaExpansionService
AI-assisted analysis of apache/beam@12126d8942 (2026-09-13).
Data as JSON: /api/errors/87b7782992ae6d8b.
Report an issue: GitHub.
Appendix: source
Thrown at sdks/typescript/src/apache_beam/utils/service.ts:177
}
return this.address!;
}
async stop() {
if (this.cached) {
return;
}
console.info(`Tearing down ${this.name}.`);
this.address = undefined;
this.process.kill();
}
async portReady(port, host, timeoutMs, iterMs = 100) {
const start = Date.now();
let connected = false;
while (!connected && Date.now() - start < timeoutMs) {
if (this.process.exitCode) {
throw new Error("Aborted with error " + this.process.exitCode);
}
await new Promise((r) => setTimeout(r, iterMs));
try {
await new Promise<void>((resolve, reject) => {
const socket = net.createConnection(port, host, () => {
connected = true;
socket.end();
resolve();
});
socket.on("error", (err) => {
reject(err);
});
});
} catch (err) {
// go around again
}
}
if (!connected) {View on GitHub (pinned to 12126d8942)