Uploaded image for project: 'Moodle'
  1. Moodle
  2. MDL-77425

Fix some travis problems with PostgreSQL 13

XMLWordPrintable

      Recently (MDL-74905) we bumped Moodle 4.2 requirements to need PostgreSQL 13. One of the details changed there were Travis and GHA CI scripts to start using it.

      It seems that the Travis script was having some (random) problems, failing at some point in the install phase.

      Tracing down the problem, it seems that the service postgresql stop command (needed to prepare the ramdisk for the database), with PostgreSQL 13 is returning too early, when everything has not been shutdown/removed properly.

      More specifically, we were getting this error in the logs:

      mv: cannot remove '/var/lib/postgresql/13/main/postmaster.pid': No such file or directory
      /var/run/postgresql:5432 - no response
      Waiting for the DB to be up...
      /var/run/postgresql:5432 - no response
      Waiting for the DB to be up...
      /var/run/postgresql:5432 - no response
      Waiting for the DB to be up...
      /var/run/postgresql:5432 - no response
      ...
      ...
      (timeout after 2h)
      

      Link to the failing run: https://app.travis-ci.com/github/stronk7/moodle/jobs/596855988

      So, the postmaster.pid was still there, but was removed in the middle of the move (to ramdisk) operation, causing it to fail and, consequently, the service postgresql start command wasn't, ever', starting the database.

      Note that this is only happening with 4.2dev (master) and PG13, we haven't seen it with previous Moodle and PG versions.

      And the logic fix (that is being used out there by others), is to add a small sleep, to allow the service to be completely stopped (and pid file removed), before continue with the installation phase.

      That's exactly what the proposed solution does. Note that, to keep everything similar. I've applied the very same pause to the mysql install phase (that doesn't run by default and, surely, doesn't need it). But better keep them parallel.

            stronk7 Eloy Lafuente (stronk7)
            stronk7 Eloy Lafuente (stronk7)
            Paul Holden Paul Holden
            Andrew Lyons Andrew Lyons
            Eloy Lafuente (stronk7) Eloy Lafuente (stronk7)
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved:

                Estimated:
                Original Estimate - Not Specified
                Not Specified
                Remaining:
                Remaining Estimate - 0 minutes
                0m
                Logged:
                Time Spent - 2 hours, 50 minutes
                2h 50m

                  Error rendering 'clockify-timesheets-time-tracking-reports:timer-sidebar'. Please contact your Jira administrators.