Accessing stderr for a job using the API

Hello,

I have a job that is failing from time to time, and the command that’s failing outputs to stderr.

When I look at the job transcript in the Gitlab UI, I see the stderr output along with the stdout one.

However, when I get the transcript through the API with GET /projects/:id/jobs/:job_id/trace, per the documentation, only the stdout appears. I’m using the API to send e-mail to a specific set of people for that job, and these e-mails are hard to understand when the meat of the problem is missing…

I don’t see any option in the API docs to request stderr be included in the response. Any help is appreciated :slight_smile:

Thanks,

Clément

You can redirect stderr to stdout with 2>&1.

Example:
echo hi && failing_command_both_stderr_stdout

Then use:
echo hi && failing_command_both_stderr_stdout 2>&1

Could not reproduce, API gives me stdout and stderr. The job log in the UI is the same as the one I get from the API call.

Please provide minimal working example.