Skip to main content

Job response

Format​

{
"trace_id": "tr-123",
"status": "success",
"stdout": "42\n",
"stderr": null,
"exception": null,
"executionTime": 34,
"exit_code": 0
}

The executionTime value is illustrative.

Fields​

FieldTypeDescription
trace_idstringthe same as the job's
statusstring"success" when the guest ran the job; "failed" when it rejected it (unknown language, stdin too large) or could not prepare the directory
stdoutstringstandard output
stderrstring or nullnull when empty
exceptionstring or null"Timeout", "Compilation failed" or a preparation error
executionTimeintegerms measured inside the guest, from the start of compilation/execution to the end
exit_codeintegerthe program's exit code; omitted when 0
errorstringrejection reason; omitted when empty

How to read the result​

"status": "success" says the execution happened, not that the program succeeded.

Situationstatusexceptionstderrexit_code
program finished finesuccessnullwhat the program wrote, or null0
program exited with an errorsuccessnullthe error≠ 0
compilation failuresuccess"Compilation failed"compiler output—
timeout exceededsuccess"Timeout"whatever there is—

Go is the exception on the compilation row: it runs through go run, which compiles and executes in one step, so a compilation error arrives only in stderr, with exception null.

What the API does with the result​

In /api/v1/run and /api/v1/execute, the API passes through status, stdout, stderr, exception, executionTime and error; exit_code does not appear. It appears as exitCode in the result event of /api/v1/execute/stream and in the machine exec response. The CLI shows it on the summary line of rc run and exits with rc 1 when it is non-zero; rc machine exec exits with the command's own code.

If the guest does not respond within the job's timeout plus a host grace period, the VM is killed and the API returns "status": "failed" with "error": "E001: operation timed out".