Welcome to the Linux Foundation Forum!

Chapter 11: ./e2e.sh is failing

cziaul
cziaul Posts: 39
edited October 2020 in LFS261 Class Forum

Looks like postgres is exiting out. Please suggest

Comments

  • In such cases, to debug, check the logs for the service which is failing i.e. postgres.

    docker-compose logs db

    Root Cause:

    The docker image for db is been updated in the repository by the authors of this docker image. Since then, its expecting you to either provide a password, or enable trust authentication ( Which is disabled by default).

    To fix this, you would have to add POSTGRES_HOST_AUTH_METHOD var and set it to trust.

      db: 
        image: postgres:9.4
        volumes: 
          - db-data:/var/lib/postgresql/data
        environment: 
          POSTGRES_HOST_AUTH_METHOD: trust
    
    

    This should fix failing postgres db container.

  • I just found a different error in the script, to solve it I made some changes to the script. When the script is executed for the first time the phantomjs script return <!-- , unfortunately bash can't store that string in a variable so I think the sed command was for that. After that I checked if the string is only digits, if not I assume there are no votes yet and assign 1 to current variable.

    current=`phantomjs render.js "http://result:4000/" | grep -i vote | cut -d ">" -f 4 | cut -d " " -f1 | sed -e 's/\!//g'`
    
    echo $current | grep -q -e "[0-9]\+"
    if [[ $? -ne 0 ]]; then
      current=1
    fi
    
  • Hi @elsanchez,

    Many thanks for confirming the fix for your case.

    Regards,
    Luis.

  • These kinds of fixes should be added as hyperlinks somewhere on the proper lesson ... because searching for solutions to common problems here is very hard

  • Hi @donquijotedelasnubes , sometimes the issue is associated to the specific environment/shell that the person is using to make the tests. I haven't heard of this issue previously.

    Regards,
    Luis.

Categories

Upcoming Training