paperclipai/paperclip · error

CreateOS process stream reported an error.

Error message

CreateOS process stream reported an error.

What it means

The CreateOS sandbox provider streams process events over an HTTP SSE-like connection. When the server sends an event of type 'error' that is not the recognized 'output_offset_expired' case, execute() throws this generic stream-error message. It signals the remote sandbox reported a failure while running the process and there is no more-specific classification available.

Solutions

  1. Inspect the sandbox logs / lease state in CreateOS to find the underlying process failure reason.
  2. Retry the command on a freshly created sandbox lease in case the previous sandbox was unhealthy.
  3. Capture stdout/stderr accumulated so far (they are thrown away by this throw) by wrapping the call and logging before propagation.
  4. Check sandbox resource limits (memory, CPU) and reduce workload or increase the lease size.

Example fix

// before
throw new Error("CreateOS process stream reported an error.");
// after
throw new Error(`CreateOS process stream reported an error: ${event.error ?? "unknown"}`);
Defensive patterns

Strategy: try-catch

Try / catch

try {
  const result = await execute(lease, cmd, { signal });
} catch (e) {
  if (e.message === "CreateOS process stream reported an error.") {
    log.warn("sandbox stream error, consider recreating lease", { leaseId: lease.id });
    throw new TransientSandboxError(e);
  }
  throw e;
}

Prevention

When it happens

Trigger: A process event with type === 'error' and event.error !== 'output_offset_expired' arrives while reading the stream in execute(). This happens on sandbox-side failures: the process was killed by the host, an internal sandbox error occurred, or the runtime could not continue the process.

Common situations: Sandbox instance crashed or was recycled mid-run; CreateOS runtime internal error; process killed by OOM or host policy; server-side bug emitting an unrecognized error code.

Related errors


AI-assisted analysis of paperclipai/paperclip@3f1d897a7c (2026-09-18). Data as JSON: /api/errors/e97f668a4769659b. Report an issue: GitHub.

Appendix: source

Thrown at packages/plugins/sandbox-providers/createos/src/execute.ts:180

            output.write(event.stream, Buffer.from(event.data_base64, "base64"));
            cursor = seq;
          } else if (event.type === "exit") {
            const exitCode = event.exit_code;
            const exitSignal = event.signal;
            if (!(typeof exitCode === "number" && Number.isInteger(exitCode)) &&
                !(typeof exitSignal === "string" && /^SIG[A-Z0-9]+$/.test(exitSignal))) {
              throw new Error("CreateOS process exit status is missing.");
            }
            completed = true;
            output.finish();
            return {
              exitCode: typeof exitCode === "number" ? exitCode : null,
              signal: typeof exitSignal === "string" ? exitSignal : null,
              timedOut: false, stdout: output.stdout, stderr: output.stderr,
              metadata: { processId, outputTruncated: output.truncated },
            };
          } else if (event.type === "error") {
            throw new Error(event.error === "output_offset_expired"
              ? "CreateOS process output was evicted before it could be read."
              : "CreateOS process stream reported an error.");
          } else {
            throw new Error("CreateOS returned an unknown process event.");
          }
        }
      } catch (error) {
        // Network read failures can resume from the last accepted sequence.
        // Protocol errors must fail closed rather than reconnect past bad data.
        if (!(error instanceof TypeError) || signal.aborted) throw error;
      }
      if (++reconnects > 3) throw new Error("CreateOS process stream ended without an exit status.");
      await delay(250, undefined, { signal });
    }
  } catch (error) {
    if (creationMayHaveSucceeded && !processId) {
      throw new CreateosCleanupError("CreateOS process creation could not be confirmed; destroy the lease before reusing it.");
    }

View on GitHub (pinned to 3f1d897a7c)