# Build now fails in linux (precise) even though it "exited with 0", works fine in standalone ubuntu 12.04 docker

**URL:** <https://travis-ci.community/t/build-now-fails-in-linux-precise-even-though-it-exited-with-0-works-fine-in-standalone-ubuntu-12-04-docker/11177>\
**Category:** Travis CI Discussions & Feedback\
**Tags:** bug\
**Created:** [February 12, 2021, 4:55am UTC](https://travis-ci.community/t/build-now-fails-in-linux-precise-even-though-it-exited-with-0-works-fine-in-standalone-ubuntu-12-04-docker/11177 "2021-02-12T04:55:32Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![markmoraes](https://sea1.discourse-cdn.com/flex015/user_avatar/travis-ci.community/markmoraes/32/6181_2.png) [@markmoraes](https://travis-ci.community/u/markmoraes)\
**Post date:** [February 12, 2021, 4:55am UTC](https://travis-ci.community/t/build-now-fails-in-linux-precise-even-though-it-exited-with-0-works-fine-in-standalone-ubuntu-12-04-docker/11177/1 "2021-02-12T04:55:32Z")

</div>

[https://travis-ci.org/github/jonmacs/jove/jobs/758492654](https://travis-ci.org/github/jonmacs/jove/jobs/758492654)  
seems to be a failure, but the log says the build exited with 0, nothing in the log appears amiss, and the same build worked fine in xenial. I pulled down an ubuntu:12.04 docker image to my laptop, did an apt-get install for the specified packages and the script ran fine.

Any ideas what I’m doing wrong? The only hint of something wrong is at the start of the raw log, in travis prep:  
indent preformatted text by 4 spaces  
travis\_fold:start:docker\_mtu\_and\_registry\_mirrors  
[0Ktee: /etc/docker/daemon.json: No such file or directory  
sudo: jsonpatch: command not found  
mv: cannot move `daemon.json' to `/etc/docker/daemon.json’: No such file or directory  
docker: unrecognized service  
travis\_fold:end:docker\_mtu\_and\_registry\_mirrors

Thanks,  
Mark.

---

<div class="post-metadata">

**Author:** ![native-api](https://sea1.discourse-cdn.com/flex015/user_avatar/travis-ci.community/native-api/32/430_2.png) [@native-api](https://travis-ci.community/u/native-api)\
**Post date:** [February 12, 2021, 8:23am UTC](https://travis-ci.community/t/build-now-fails-in-linux-precise-even-though-it-exited-with-0-works-fine-in-standalone-ubuntu-12-04-docker/11177/2 "2021-02-12T08:23:46Z")

</div>

> **[Travis CI Documentation](https://docs.travis-ci.com/user/common-build-problems/#my-build-fails-unexpectedly)**
>
> Common Build Problems

---

<div class="post-metadata">

**Author:** ![markmoraes](https://sea1.discourse-cdn.com/flex015/user_avatar/travis-ci.community/markmoraes/32/6181_2.png) [@markmoraes](https://travis-ci.community/u/markmoraes)\
**Post date:** [February 12, 2021, 3:53pm UTC](https://travis-ci.community/t/build-now-fails-in-linux-precise-even-though-it-exited-with-0-works-fine-in-standalone-ubuntu-12-04-docker/11177/3 "2021-02-12T15:53:55Z")

</div>

Re: the “Common Build Problems” document mentioned. The script log shows it executed successfully, errexit was not triggered : the jsonpatch error is not from my script, it is reported from travis code before my script begins to run. Trusty, xenial, bionic and focal all work, as does exactly the same script (with -e) on my own docker with precise (ubuntu 12.04). I also set +e when the script ends, that seems to have happened, so it should not affect travis cleanup code. Here’s an example of the same build working fine on travis precise at the last change. [Travis CI - Test and Deploy Your Code with Confidence](https://travis-ci.org/github/jonmacs/jove/jobs/671334049) (in that older build, travis seems to succeed at killing the agent, but it seems to end more abruptly in the newer build)

---

<div class="post-metadata">

**Author:** ![native-api](https://sea1.discourse-cdn.com/flex015/user_avatar/travis-ci.community/native-api/32/430_2.png) [@native-api](https://travis-ci.community/u/native-api)\
**Post date:** [February 13, 2021, 4:16pm UTC](https://travis-ci.community/t/build-now-fails-in-linux-precise-even-though-it-exited-with-0-works-fine-in-standalone-ubuntu-12-04-docker/11177/4 "2021-02-13T16:16:45Z")

</div>

> [@markmoraes](#):
>
> I also set +e when the script ends

I see “`set +u`” there, not “`set +e`”.

---

<div class="post-metadata">

**Author:** ![markmoraes](https://sea1.discourse-cdn.com/flex015/user_avatar/travis-ci.community/markmoraes/32/6181_2.png) [@markmoraes](https://travis-ci.community/u/markmoraes)\
**Post date:** [February 23, 2021, 1:10am UTC](https://travis-ci.community/t/build-now-fails-in-linux-precise-even-though-it-exited-with-0-works-fine-in-standalone-ubuntu-12-04-docker/11177/5 "2021-02-23T01:10:44Z")

</div>

Oops, right you are, sorry I missed that. Made that set +eu and precise works fine.  
(Needed the +u because some unset variable is being assumed to be blank in some epilog code in travis)  
Have you considered running the travis script in a subshell so user code does not affect into travis internal logic?
