Bug 1194997

Summary: error while Satellite 6 installation: /Stage[main]/Candlepin::Database::Postgresql/Exec[cpdb]: Failed to call refresh: liquibase --driver=org.postgresql.Driver...
Product: Red Hat Satellite Reporter: Jan Hutař <jhutar>
Component: CandlepinAssignee: Devan Goodwin <dgoodwin>
Status: CLOSED ERRATA QA Contact: jaudet
Severity: high Docs Contact:
Priority: unspecified    
Version: 6.1.0CC: bbuckingham, cwelton, dgoodwin, jaudet, jmontleo, omaciel
Target Milestone: UnspecifiedKeywords: Triaged
Target Release: Unused   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2015-08-12 05:26:56 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Jan Hutař 2015-02-21 20:17:11 UTC
Description of problem:
There is an ERROR being logged when katello-installer is run:

# less /var/log/katello-installer/katello-installer.log
[...]
[DEBUG 2015-02-21 00:48:22 main]  Executing 'liquibase --driver=org.postgresql.Driver                             --classpath=/usr/share/java/postgresql-jdbc.jar:/var/lib/tomcat6/webapps/candlepin/WEB-INF/classes/                        
     --changeLogFile=db/changelog/changelog-create.xml                             --url=jdbc:postgresql:candlepin                             --username=candlepin                              --password=VaYRnZpqJtEAM8moBoa9SzQ52oR9xZxD 
                            migrate                             -Dcommunity=False                             >> /var/log/candlepin/cpdb.log                             2>&1 && touch /var/lib/candlepin/cpdb_done'
[ERROR 2015-02-21 00:48:26 main]  /Stage[main]/Candlepin::Database::Postgresql/Exec[cpdb]: Failed to call refresh: liquibase --driver=org.postgresql.Driver                             --classpath=/usr/share/java/postgresql-jdbc.jar:/var/lib/tomcat6/webapps/candlepin/WEB-INF/classes/                             --changeLogFile=db/changelog/changelog-create.xml                             --url=jdbc:postgresql:candlepin                             --username=candlepin                              --password=VaYRnZpqJtEAM8moBoa9SzQ52oR9xZxD                             migrate                             -Dcommunity=False                             >> /var/log/candlepin/cpdb.log                             2>&1 && touch /var/lib/candlepin/cpdb_done returned 255 instead of one of [0]
[ERROR 2015-02-21 00:48:26 main]  /Stage[main]/Candlepin::Database::Postgresql/Exec[cpdb]: liquibase --driver=org.postgresql.Driver                             --classpath=/usr/share/java/postgresql-jdbc.jar:/var/lib/tomcat6/webapps/candlepin/WEB-INF/classes/                             --changeLogFile=db/changelog/changelog-create.xml                             --url=jdbc:postgresql:candlepin                             --username=candlepin                              --password=VaYRnZpqJtEAM8moBoa9SzQ52oR9xZxD                             migrate                             -Dcommunity=False                             >> /var/log/candlepin/cpdb.log                             2>&1 && touch /var/lib/candlepin/cpdb_done returned 255 instead of one of [0]
[ INFO 2015-02-21 00:48:26 main] /usr/lib/ruby/site_ruby/1.8/puppet/util/errors.rb:104:in `fail'
[...]


Version-Release number of selected component (if applicable):
Satellite-6.1.0-RHEL-6-20150220.0-Satellite-x86_64


How reproducible:
1 of 1


Steps to Reproduce:
1. # katello-installer --foreman-admin-email 'root@localhost' --foreman-admin-username 'admin' --foreman-admin-password '...'


Actual results:
Error is logged


Expected results:
No errors logged


Additional info:
# cat /var/log/candlepin/cpdb.log
INFO 2/21/15 12:48 AM:liquibase: Successfully acquired change log lock
INFO 2/21/15 12:48 AM:liquibase: Creating database history table with name: databasechangelog
INFO 2/21/15 12:48 AM:liquibase: Reading from databasechangelog
INFO 2/21/15 12:48 AM:liquibase: Reading from databasechangelog
INFO 2/21/15 12:48 AM:liquibase: Successfully released change log lock
Liquibase Update Failed: Validation Failed:
     1 changes have validation failures
          addForeignKeyConstraint is not supported on postgresql, db/changelog/20150123105016-add-consumer-checkin-table.xml::20150123105016-1::dgoodwin::(Checksum: 3:ef15d24f295f43442a692f544ed5efe0)

SEVERE 2/21/15 12:48 AM:liquibase: Validation Failed:
     1 changes have validation failures
          addForeignKeyConstraint is not supported on postgresql, db/changelog/20150123105016-add-consumer-checkin-table.xml::20150123105016-1::dgoodwin::(Checksum: 3:ef15d24f295f43442a692f544ed5efe0)

liquibase.exception.ValidationFailedException: Validation Failed:
     1 changes have validation failures
          addForeignKeyConstraint is not supported on postgresql, db/changelog/20150123105016-add-consumer-checkin-table.xml::20150123105016-1::dgoodwin::(Checksum: 3:ef15d24f295f43442a692f544ed5efe0)

	at liquibase.changelog.DatabaseChangeLog.validate(Unknown Source)
	at liquibase.Liquibase.update(Unknown Source)
	at liquibase.integration.commandline.Main.doMigration(Unknown Source)
	at liquibase.integration.commandline.Main.main(Unknown Source)


For more information, use the --logLevel flag)

Comment 3 Devan Goodwin 2015-02-23 13:26:45 UTC
This looks like it's caused by an issue with older versions of liquibase that don't know how to handle this. Satellite is using liquibase 2, we've moved onward to 3 and the builds are available in our buildroot.

Would it be possible to tag in liquibase-3.1.0-1? Dependencies are exactly the same.


bash-4.1# rpm -i liquibase-2.0.5-2.el6sat.noarch.rpm 
warning: liquibase-2.0.5-2.el6sat.noarch.rpm: Header V3 RSA/SHA256 Signature, key ID fd431d51: NOKEY
bash-4.1# rpm -q --requires liquibase
/bin/sh  
java >= 0:1.6.0
jpackage-utils  
rpmlib(CompressedFileNames) <= 3.0.4-1
rpmlib(FileDigests) <= 4.6.0-1
rpmlib(PayloadFilesHavePrefix) <= 4.0-1
rpmlib(PayloadIsXz) <= 5.2-1



bash-4.1# rpm -qa | grep liquibase
liquibase-3.1.0-1.el6_5.noarch
bash-4.1# rpm -q --requires liquibase
/bin/sh  
java >= 0:1.6.0
jpackage-utils  
rpmlib(CompressedFileNames) <= 3.0.4-1
rpmlib(FileDigests) <= 4.6.0-1
rpmlib(PayloadFilesHavePrefix) <= 4.0-1
rpmlib(PayloadIsXz) <= 5.2-1


The schema deploys fine with 3, which is how this was missed.

Comment 4 Devan Goodwin 2015-02-23 13:36:06 UTC
Cancel that, the liquibase update would be easy and we probably should do it, but I can fix with a new candlepin build and frankly it looks like it's probably the safer bet. No tagging required, rebuilding candlepin now.

Comment 5 Devan Goodwin 2015-02-23 14:00:45 UTC
*** Bug 1194819 has been marked as a duplicate of this bug. ***

Comment 6 Devan Goodwin 2015-02-23 14:29:33 UTC
Please tag in: candlepin-0.9.43-1.el6 and candlepin-0.9.43-1.el7

This should correct the problem.

Technically it would be good to pick up liquibase-3.1.0-1 as well but I'll leave that to sat rel-eng.

Comment 9 jaudet 2015-03-10 13:26:24 UTC
Tested against systems running Satellite-6.1.0-RHEL-6-20150303.0 and Satellite-6.1.0-RHEL-7-20150303.0. Identical results were produced on both systems.

    $ grep -i 'debug.*liquibase' /var/log/katello-installer/* | wc -l
    4
    $ grep -i 'error.*liquibase' /var/log/katello-installer/* | wc -l
    0

Comment 10 Bryan Kearney 2015-08-11 13:31:40 UTC
This bug is slated to be released with Satellite 6.1.

Comment 11 errata-xmlrpc 2015-08-12 05:26:56 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHSA-2015:1592