1

I am using Classic release pipelines in Azure DevOps and configured simple SSH task what calls docker-compose:

cd /home/asem/platform/$(ServiceName) && sudo docker-compose up -d --force-recreate

Azure DevOps SSH release pipeline task

Azure DevOps SSH release pipeline task configuration

Issue: task fails with errors:

SSH task errors

Docker-compose returns 0 exit code, but write some messages in STDERR. Pipeline task treat them as errors and fails.

Questions:

  1. Why docker-compose designed that way what EXIT code = 0, but there are some errors were written in STDERR ?
  2. Any good solution (please see found workarounds in my answer below) ?
1
  • 1
    Hi @Aleksei, thanks for your sharing! Just a remind, you could accept your answer, and this may help others find the answer quickly. Commented Dec 26, 2022 at 1:55

2 Answers 2

1

Will a stderr redirect + grep work for you?

docker compose up -d 2> >(grep -i error)

Happy path: enter image description here

With error: enter image description here

Sign up to request clarification or add additional context in comments.

Comments

0

Workaround 1: pipe docker compose STDERR to STDOUT like cd /home/asem/platform/$(ServiceName) && sudo docker-compose up -d --force-recreate 2 >&1

sudo docker-compose up -d --force-recreate 2 >&1

That works, but I don’t like it because it can hide some real errors

Workaround 2: Uncheck “Fail on STDERR” for task

SSH task unchecked Fail on STDERR

That works, but release stage displays errors which is not good though.

release stage errors

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question