# No output logged when using \`travis\_wait\` command

**URL:** <https://travis-ci.community/t/no-output-logged-when-using-travis-wait-command/1909>\
**Category:** Travis CI Discussions & Feedback\
**Created:** [January 18, 2019, 4:15pm UTC](https://travis-ci.community/t/no-output-logged-when-using-travis-wait-command/1909 "2019-01-18T16:15:57Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![gkrizek](https://sea1.discourse-cdn.com/flex015/user_avatar/travis-ci.community/gkrizek/32/1051_2.png) [@gkrizek](https://travis-ci.community/u/gkrizek)\
**Post date:** [January 18, 2019, 4:15pm UTC](https://travis-ci.community/t/no-output-logged-when-using-travis-wait-command/1909/1 "2019-01-18T16:15:57Z")

</div>

We are running CI on Xenial with Python 3.4 and are having issues with the `travis_wait` command. The command that we are trying to extend has been failing as soon as it’s executed. (It can’t persist). As soon as the command fails, the CI run does fail as whole as well, which is expected. However, there is never any output logged. This has been failing for a while now and we haven’t been able to figure it out because there is no error logs in the CI run. When the command was successful it would print the log, but never when the command fails. I even fixed the script to have it error after 15 seconds and it still didn’t output anything.

So in summary, the `travis_wait` command seems to output logs fine when successful, but if the command fails it suppresses the logs and never prints them.

Relevant run:  
[https://travis-ci.org/bitcoin/bitcoin/jobs/481036172](https://travis-ci.org/bitcoin/bitcoin/jobs/481036172)

After that last `gpg:` command it’s running another script with `travis_wait` and there is no output. If you go to the raw log, you can see only a message that says:

```auto
Still running (1 of 50): contrib/verify-commits/verify-commits.py --clean-merge=2

```

but never any output from the script.

---

<div class="post-metadata">

**Author:** ![BanzaiMan](https://sea1.discourse-cdn.com/flex015/user_avatar/travis-ci.community/banzaiman/32/67_2.png) [@BanzaiMan](https://travis-ci.community/u/BanzaiMan)\
**Post date:** [January 18, 2019, 4:34pm UTC](https://travis-ci.community/t/no-output-logged-when-using-travis-wait-command/1909/2 "2019-01-18T16:34:05Z")

</div>

This has nothing to do with the use of `travis_wait`. You are setting the `errexit` option on the bash:

> <https://github.com/bitcoin/bitcoin/blob/12b30105fc59daef2ae2fd8f81be1159ca68f94a/.travis.yml#L49>

and this means that any command that exits with a nonzero status will terminate the build _immediately_.

`travis_wait` does not have a chance to dump the logs it is collecting.

---

<div class="post-metadata">

**Author:** ![gkrizek](https://sea1.discourse-cdn.com/flex015/user_avatar/travis-ci.community/gkrizek/32/1051_2.png) [@gkrizek](https://travis-ci.community/u/gkrizek)\
**Post date:** [January 18, 2019, 4:36pm UTC](https://travis-ci.community/t/no-output-logged-when-using-travis-wait-command/1909/3 "2019-01-18T16:36:28Z")

</div>

Doh! Thanks for catching that. That makes a lot of sense. I’ll look into resolving it that way. Thanks!

---

<div class="post-metadata">

**Author:** ![Mizux](https://sea1.discourse-cdn.com/flex015/user_avatar/travis-ci.community/mizux/32/274_2.png) [@Mizux](https://travis-ci.community/u/Mizux)\
**Post date:** [April 9, 2019, 12:47pm UTC](https://travis-ci.community/t/no-output-logged-when-using-travis-wait-command/1909/4 "2019-04-09T12:47:28Z")

</div>

same issue here !  
log: [https://travis-ci.org/google/or-tools/jobs/517767392](https://travis-ci.org/google/or-tools/jobs/517767392)  
EDIT: my bad, as primary author specifies, logs do not appear until the process finish (or timeout)…  
note: so the “Follow Log” feature become useless BTW

FYI .travis.yml

```auto
...
script:
  - >
    export -f travis_wait &&
    export -f travis_jigger &&
    ./.travis/script.sh ||
    travis_terminate 1

```

note: `travis_jigger` needed to avoid this [https://travis-ci.org/google/or-tools/jobs/517744982#L288](https://travis-ci.org/google/or-tools/jobs/517744982#L288) -\> maybe the travis-doc should be updated with a working example using a `script.sh`…

inside script.sh I have one line containing

```auto
 ...
echo 'travis_fold:start:configure'
travis_wait cmake -H. -Bbuild -DBUILD_DEPS:BOOL=ON
echo 'travis_fold:end:configure'

```

before adding `travis_wait`, log looks like: [https://travis-ci.org/google/or-tools/jobs/517655819](https://travis-ci.org/google/or-tools/jobs/517655819)

```auto
...
[44%] Performing update step for 'Protobuf_project'
-- Protobuf_project update command succeeded. See also /home/travis/build/google/or-tools/build/dependencies/Protobuf/stamp/Protobuf_project-update-*.log
[55%] Performing configure step for 'Protobuf_project'
-- Protobuf_project configure command succeeded. See also /home/travis/build/google/or-tools/build/dependencies/Protobuf/stamp/Protobuf_project-configure-*.log
[66%] Performing build step for 'Protobuf_project'
No output has been received in the last 10m0s, this potentially indicates a stalled build or something wrong with the build itself.
Check the details on how to adjust your build configuration on: https://docs.travis-ci.com/user/common-build-problems/#Build-times-out-because-no-output-was-received
The build has been terminated

```

---

<div class="post-metadata">

**Author:** ![CrazyMax](https://sea1.discourse-cdn.com/flex015/user_avatar/travis-ci.community/crazymax/32/460_2.png) [@CrazyMax](https://travis-ci.community/u/CrazyMax)\
**Post date:** [August 2, 2019, 3:19pm UTC](https://travis-ci.community/t/no-output-logged-when-using-travis-wait-command/1909/5 "2019-08-02T15:19:50Z")

</div>

I have created a small CLI tool to fix this issue if you want to take a look : [https://github.com/crazy-max/travis-wait-enhanced](https://github.com/crazy-max/travis-wait-enhanced)

---

<div class="post-metadata">

**Author:** ![tapika](https://sea1.discourse-cdn.com/flex015/user_avatar/travis-ci.community/tapika/32/2716_2.png) [@tapika](https://travis-ci.community/u/tapika)\
**Post date:** [September 20, 2019, 8:15pm UTC](https://travis-ci.community/t/no-output-logged-when-using-travis-wait-command/1909/6 "2019-09-20T20:15:08Z")

</div>

I had similar problem , and I had python script launching all kind of commands - so I’ve decided - why python cannot just print some dummy message to keep travis ci satisfied. So I’ve coded following snipet, see:

```
pingTime = 5

stopTimer = False

def pingTravis(doPrint = True):
    if stopTimer:
        return

    if doPrint: 
        print("- Build still in progress...")
        sys.stdout.flush()

    threading.Timer(pingTime, pingTravis).start()

pingTravis(False)

execcmd("pause")

stopTimer = True

execcmd("pause")

```

execcmd can be replaced with os.system call. In code snipet above I’m using pause just if you want to test script locally, but final version can be found behind link below.

Here is a link to frozen version, switch to trunk if you want to get latest (but cannot guarantee that I will not recode it):  
[https://github.com/tapika/test\_travis\_ci/blob/b06c206d277882cd104f5224375daa9f63b66372/build.py](https://github.com/tapika/test_travis_ci/blob/b06c206d277882cd104f5224375daa9f63b66372/build.py)
