Bash: command not found

I am trying to run a bash script from within a before_install hook, and Travis is telling me that bash is not installed. This is quite surprising, can you please advise how we should proceed?

error in action: https://travis-ci.org/mongodb/node-mongodb-native/jobs/596654744#L272
travis configuration: https://github.com/mongodb/node-mongodb-native/blob/test-runner/.travis.yml#L25

It’s not bash that’s not found, but rather, " bash" with extra spaces in front.

Try

  - TOPOLOGY=${MONGODB_ENVIRONMENT} bash ${DRIVERS_TOOLS}/.evergreen/run-orchestration.sh

instead.

Hey @BanzaiMan, thanks for the quick response! This gets me further, nice catch on the spaces there. Related question: I have an after_failure hook set up to print log files, but it doesn’t seem to run if something fails in the before* hooks, is it possible to execute a hook after a failure during the setup phase?

In this particular case I think my issue is that a few of the commands in the setup are not being run (lines 21-22 in the config linked above). I had to wrap the lines in quotes in order to accommodate the complex regular expressions on the line, but they never show up in the logs as being run - it looks like travis just skips them.

If you need to do this, you’ll have to devise your own failing_command || dump_log logic.

I see them here https://travis-ci.org/mongodb/node-mongodb-native/jobs/596690516#L260-L261
and I don’t think these commands produce any output in the best of times. You can add something to force it; e.g., -print for find to print the matching file, or tell sed to echo the lines as well as editing files in place. They didn’t cause the job to error, so they exited with status 0.

Imprint