Description of problem: Occasionally we release Candlepin asynchronously from our usual Katello release cycle and in such cases when migrations are pending because the foreman-installer wasn't executed, the app never starts. Tailing candlepin.log doesn't give any indication of the problem. It would be nice if we could quickly and visibly know when this is the case which could mean something (simple?) like making it more obvious in candlepin.log or maybe slightly more involved like allowing the app to start and reporting the problem via the /status API. Version-Release number of selected component (if applicable): How reproducible: Steps to Reproduce: 1. 2. 3. Actual results: Expected results: Additional info:
The liquibase check can be done using something like Liquibase.listUnrunChangeSets(..). If that returns any changesets then Candlepin won't be able to fully start up.
The condition which causes the scenario is a database column type mismatch in the reproducer we were able to create. It is shown in the /var/log/tomcat/localhost*.log file as a stacktrace. The candlepin log is not of use as the means to log there is not able to start. The webapp initialization fails altogether which leaves no way to have the status endpoint for information. We need to document the issue in a kbase article and link it back to this BZ.
(In reply to William Poteat from comment #2) > The webapp initialization fails altogether which leaves no way to have the > status endpoint for information. Would it not be possible to do the liquibase check early enough during webapp context initialization, and log an ERROR that is explaining the situation? e.g. 'One or more database upgrade operations have not been run'?
There is a draft PR. I still need to run it up against some other databases.
PR is complete