1

I'm trying to set up two databases on travis but it just stops halfway the before_install stating:

(END)

No output has been received in the last 10 minutes, this potentially indicates a stalled build or something wrong with the build itself.
The build has been terminated

eg https://travis-ci.org/B3Partners/brmo/builds/85746119

my yml is the following:

language: java

sudo: false

branches:
  only:
    - travis-integration

addons:
  postgresql: "9.3"

jdk:
#  - openjdk6
#  - openjdk7
  - oraclejdk7
#  - oraclejdk8

matrix:
  fast_finish: true

cache:
  directories:
  - $HOME/.m2

before_install:
  # STAGING
  - psql --version
  - psql -U postgres -c 'create database staging'
  - psql -U postgres -c 'create database rsgb'
  - psql -U postgres --list
  # set up RSGB
  - psql -U postgres -d rsgb -c 'create extension postgis'
  - psql -U postgres -d rsgb -f ./datamodel/generated_scripts/datamodel_postgresql.sql --single-transaction --echo-all
  # - psql -f ./datamodel/utility_scripts/111a_update_gemeente_geom.sql -U postgres -d rsgb --single-transaction
  # - psql -f ./datamodel/utility_scripts/113a_update_wijk_geom.sql -U postgres -d rsgb --single-transaction

install:
  # install all dependencies + artifacts without any testing
  - mvn install -Dmaven.test.skip=true -B -V -fae -q

before_script:
  # dit dient na afloop van de 'install' gedaan te worden omdat de staging DB sql gegenereerd wordt door Hibernate
  - psql -U postgres -d staging -f ./brmo-persistence/target/ddlscripts/create-brmo-persistence-postgresql.sql --single-transaction
  - psql -U postgres -d staging -f ./brmo-persistence/db/01_create_indexes.sql
  - psql -U postgres -d staging -f ./brmo-persistence/db/02_insert_default_user.sql
  - psql -U postgres -d staging -f ./brmo-persistence/db/03_update_status_enum_value.sql

# run tests
script:
  # run unit tests
  - mvn -e test -B
  # run integration tests
  - mvn -e verify -B

after_success:

after_failure:

after_script:

notifications:
  email: false
  #  on_success: [always|never|change] # default: change
  #  on_failure: [always|never|change] # default: always

and as you can see in the log it just stalls after a few psql calls.

0.01s$ psql --version
psql (PostgreSQL) 9.3.5
before_install.2
0.02s$ psql -U postgres -c 'create database staging'
CREATE DATABASE
before_install.3
0.22s$ psql -U postgres -c 'create database rsgb'
CREATE DATABASE
before_install.4
1.04s$ psql -U postgres -d rsgb -c 'create extension postgis'
CREATE EXTENSION
$ psql -U postgres --list
                                  List of databases
   Name    |  Owner   | Encoding |   Collate   |    Ctype    |   Access privileges   
-----------+----------+----------+-------------+-------------+-----------------------
 postgres  | postgres | UTF8     | en_US.UTF-8 | en_US.UTF-8 | 
 rsgb      | postgres | UTF8     | en_US.UTF-8 | en_US.UTF-8 | 
 staging   | postgres | UTF8     | en_US.UTF-8 | en_US.UTF-8 | 
 template0 | postgres | UTF8     | en_US.UTF-8 | en_US.UTF-8 | =c/postgres          +
           |          |          |             |             | postgres=CTc/postgres
 template1 | postgres | UTF8     | en_US.UTF-8 | en_US.UTF-8 | =c/postgres          +
           |          |          |             |             | postgres=CTc/postgres
 travis    | travis   | UTF8     | en_US.UTF-8 | en_US.UTF-8 | 
(6 rows)
(END)
No output has been received in the last 10 minutes, this potentially indicates a stalled build or something wrong with the build itself.
The build has been terminated
Mark
  • 93
  • 6
  • FWIW I have found https://github.com/travis-ci/travis-ci/issues/4618 which displays a similar phenomenon, however on a different command – Mark Oct 19 '15 at 11:31
  • Possible duplicate of [How can I install something on Travis CI without a timeout?](http://stackoverflow.com/questions/28746046/how-can-i-install-something-on-travis-ci-without-a-timeout) – kenorb Dec 05 '15 at 18:36
  • not sure if using `travis_wait` fixed this or code update – Mark Dec 11 '15 at 14:05

1 Answers1

1

I just spent about 3 hours troubleshooting this same issue and the problem is pretty simple once you understand why. psql is simply trying to page the output. There are multiple ways to disable the pager, but the solution I went with was to set the PAGER=cat environment variable in .travis.yml like so:

env: - PGUSER=postgres PAGER=cat

Cameron Taggart
  • 5,771
  • 4
  • 45
  • 70