question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

docker-compose task non-zero exit code does not report as failed

See original GitHub issue

Troubleshooting

Checked for alternate preview version of the docker-compose command vsts task, but did not see any. Tried both docker-compose execute command “up” and also the “run services” (which maps to up). Both have the same issue.

Environment

  • Server - VSTS

    • account name: metabolondev
    • team project name: Aperture
    • build definition name/build number: Aperture - CI / 757
  • Agent - Private:

    • Created using docker command:
docker run -d --restart always --name vsts_default_a1 -e VSTS_ACCOUNT=metabolondev -e VSTS_TOKEN=**** -e VSTS_AGENT=a1 -e VSTS_POOL=Default -e USER=root -e VSTS_WORK=/var/vsts --log-opt max-size=5m -v /var/run/docker.sock:/var/run/docker.sock -v /var/vsts:/var/vsts microsoft/vsts-agent:ubuntu-16.04-docker-17.03.0-ce-standard

Issue Description

Docker-Compose task: image

Nothing fancy, just trying to run: docker-compose -f ./docker-compose.ci.build.yaml up

Content of that file is:


services:
  ci-build:
    image: node:8.9.1
    volumes:
      - .:/root/src
      - ${HOME}/.cache:/usr/local/share/.cache
    environment:
      - CI=1
      - USER=${USER}
    working_dir: /root/src
    command: /bin/bash -c "yarn install && yarn lint && yarn test:cover && yarn build"

screenshot from 2017-11-17 10-30-27

My problem is the circled parts. Note that the build task failed on the Install / Test / Build in the output, but that it did not mark the task as error, and did not stop, but continued to the next task, where it failed due to missing files expected to be generated from the prior step.

Please ignore for now, the control/color codes not being interpreted.

Error logs

See above.

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:6 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
jikumacommented, Nov 28, 2017

@jhgoodwin Can you share the build log for Install / Test / Build step. Ensure that you set system.debug variable as true. Meanwhile you can use --exit-code-from option of up command. docker-compose -f ./docker-compose.ci.build.yaml up --exit-code-from ci-build

image

This should work for you. Please share the log so that we can expose --exit-code-from option in UI appropriately.

0reactions
jikumacommented, Nov 28, 2017

Docker-compose process does not exit with an error exit code if one of the containers fails. I tried docker-compose up && echo “Working” || echo “Not working”. It always printed “Working”. Irrespective of container exit code.

This is the reason --exit-code-from was introduced.

Read more comments on GitHub >

github_iconTop Results From Across the Web

How can I fix the Error of Docker-compose up exited with code 1
Exit Code 1 Indicates that the container stopped due to either an application error or an incorrect reference in Dockerfile to a file...
Read more >
Azure DevOps Pipeline - Docker task failing
It seems like that the Docker@2 task got I few breaking updates on Friday. My last build on Thursday at 2:40pm (UTC +11)...
Read more >
Docker Engine release notes
This release of Docker Engine contains updated versions of Docker Compose, Docker Scan, Containerd, and some minor bug fixes and enhancements. Updates ...
Read more >
Bamboo does not respect exit status of docker compose
I'll need more details about the task running the docker-compose command. If you are using a script task, there is an explanation for...
Read more >
Error codes for Visual Studio Container Tools - Microsoft Learn
See the Output window for more detail on why the container is failed to start. DTP1003, No service found while debugging the Docker...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found