Bug 1993223 - [RFE] Make it more clear when database migrations have not been run when Candlepin starts
Summary: [RFE] Make it more clear when database migrations have not been run when Cand...
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Candlepin
Classification: Community
Component: candlepin
Version: 4.1
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
: ---
Assignee: candlepin-bugs
QA Contact:
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2021-08-12 15:05 UTC by Jonathon Turel
Modified: 2022-06-28 14:37 UTC (History)
5 users (show)

Fixed In Version: candlepin-4.2.3-1
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2022-06-28 14:37:17 UTC
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Github candlepin candlepin pull 3363 0 None open 1993223: Stop Candlepin initialization if database is not updated 2022-06-07 17:41:23 UTC
Red Hat Issue Tracker ENT-4789 0 None None None 2022-03-04 10:20:12 UTC

Description Jonathon Turel 2021-08-12 15:05:40 UTC
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:

Comment 1 Barnaby Court 2022-03-07 14:21:54 UTC
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.

Comment 2 William Poteat 2022-05-25 12:55:00 UTC
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.

Comment 3 Nikos Moumoulidis 2022-05-26 10:30:53 UTC
(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'?

Comment 4 William Poteat 2022-06-01 16:26:47 UTC
There is a draft PR. I still need to run it up against some other databases.

Comment 5 William Poteat 2022-06-07 17:40:48 UTC
PR is complete


Note You need to log in before you can comment on or make changes to this bug.