Skip to content

Self-healing an OpenProject 503 Upgrade Error

If you have OpenProject set to auto-update, you may come in in the morning to a 503 error. For some reason the upgrade scripts don’t post-run the 'openproject configure‘ command necessary to complete the upgrade.

Here’s a short monit script that will notice the downtime and do the configure for you:

check host localhost-openproject with address 127.0.0.1
  start program = "/bin/systemctl start openproject"
  stop  program = "/bin/systemctl stop  openproject"
  if failed
    port 443
    protocol https
    status != 503
    with http headers [Host: "project.example.com" ]
    for 10 cycles
    then exec "/usr/bin/openproject configure"
  if 3 restarts within 5 cycles then timeout

Fortunately the configure command then sets up the server as running, so you shouldn’t have to do anything else. The net effect is a few minutes of downtime on a version upgrade, which for us is acceptable at 6am.

Adapt the script for your specific needs.