Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.

Bug 817642

Summary: Katello installer fails unable to configure Candlepin
Product: [Retired] Katello Reporter: Duncan Innes <duncan>
Component: InstallerAssignee: Martin Bacovsky <mbacovsk>
Status: CLOSED CURRENTRELEASE QA Contact: Katello QA List <katello-qa-list>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 2.0CC: bkearney, mbacovsk
Target Milestone: ---Keywords: Triaged
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2012-07-04 07:35:36 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:
Attachments:
Description Flags
Katello debug none

Description Duncan Innes 2012-04-30 18:01:55 UTC
Created attachment 581238 [details]
Katello debug

Description of problem: Try to install katello


Version-Release number of selected component (if applicable): 0.2.30


How reproducible: Every time


Steps to Reproduce:
1. katello-configure
2.
3.
  
Actual results: err: /Stage[main]/Candlepin::Service/Exec[wait for candlepin]/returns: change from notrun to 0 failed: /usr/bin/wget --spider --tries 10 --retry-connrefused --no-check-certificate https://localhost:8443/candlepin/ returned 4 instead of one of [0] at /usr/share/katello/install/puppet/modules/candlepin/manifests/service.pp:10



Expected results: Installation to succeed.


Additional info: This is my home machine with a clean install of F16.  Tried to install katello a few weeks back and it failed similarly.  Katello was upgraded via yum today and these are the results.

Comment 1 Duncan Innes 2012-04-30 18:34:06 UTC
Since entering the bug, I've done a complete removal of katello as I found in:

https://gist.github.com/1308881

Then re-install and configure as documented on the Katello wiki:

https://fedorahosted.org/katello/wiki/Install

The result I get is the same:

err: /Stage[main]/Candlepin::Service/Exec[wait for candlepin]/returns: change from notrun to 0 failed: /usr/bin/wget --spider --tries 10 --retry-connrefused --no-check-certificate https://localhost:8443/candlepin/ returned 4 instead of one of [0] at /usr/share/katello/install/puppet/modules/candlepin/manifests/service.pp:10

Comment 2 Lukas Zapletal 2012-05-02 07:46:55 UTC
Hey, use this for removal:

https://github.com/Katello/katello/blob/master/scripts/katello_remove.sh

Can you please run katello-debug script after the installation fails and attach it (privately) to this bugzilla? I need to see logs.

Comment 3 Lukas Zapletal 2012-05-02 08:03:22 UTC
Oh the debug output is already there.

java.io.IOException: failed to decrypt safe contents entry: javax.crypto.BadPaddingException: Given final block not properly padded

The issue is in /etc/tomcat6/server.xml file, passphrase is misconfigured. Will post a workaround for you.

Comment 4 Martin Bacovsky 2012-05-02 09:43:46 UTC
Could you please send me /etc/tomcat6/server.xml and /etc/katello/keystore_password-file to my private mail (mbacovsk)?
The passwords in server.xml were removed by katello-debug utility for security reasons and I need to check what really happened there.

Comment 5 Duncan Innes 2012-05-02 17:19:25 UTC
Files sent.

Comment 6 Martin Bacovsky 2012-05-04 15:47:29 UTC
The problem is that the keystore_password-file seems to be empty. According to logs it seems you had ran katello-configure multiple times which may caused some unexpected behavior of the installer. 

I would suggest to:
- remove katello installation by running katello-remove.sh script [1] 
- remove /root/ssl-build dir
- update katello packages to latest version
- run katello-configure again
so we have as clean install as possible for further investigation.

If you decide to go this way, please, let me know if that helped.

[1] https://github.com/Katello/katello/blob/master/scripts/katello_remove.sh

Comment 7 Duncan Innes 2012-05-04 18:02:47 UTC
Remove katello install using script : done
Remove /root/ssl-build dir : script did this, but I checked
Install katello repos to yum : done
Install katello-all : failed

Error Downloading Packages:

loads of rubygem and a few pulp packages (all from katello)
[Errno 256] No more mirrors to try.

Will try later.

Comment 8 Duncan Innes 2012-05-04 18:06:42 UTC
Scratch the last comment.  It's installing everything now.  Will report on success/failure shortly.

Comment 9 Duncan Innes 2012-05-04 19:22:52 UTC
Unfortunately I'm still not getting the full install:

[root@samsung /]# katello-configure 
Starting Katello configuration
The top-level log file is [/var/log/katello/katello-configure-20120504-201819/main.log]
Creating Katello database user
############################################################ ... OK
Creating Katello database
############################################################ ... OK
Creating Candlepin database user
############################################################ ... OK
Creating Candlepin database
############################################################ ... OK
Candlepin setup

  Failed, please check [/var/log/katello/katello-configure/cpsetup.log]
[root@samsung /]# cat /var/log/katello/katello-configure/cpsetup.log

########## ERROR ############
Error running command: wget -qO- http://localhost:8080/candlepin/admin/init
Status code: 2048
Command output: 
Writing configuration file
Cerficiates already exist, skipping...
Waiting for tomcat to restart...
Waiting for tomcat to restart...
Waiting for tomcat to restart...
Waiting for tomcat to restart...
Traceback (most recent call last):
  File "/usr/share/candlepin/cpsetup", line 218, in <module>
    main(sys.argv[1:])
  File "/usr/share/candlepin/cpsetup", line 213, in main
    run_command("wget -qO- http://localhost:8080/candlepin/admin/init")
  File "/usr/share/candlepin/cpsetup", line 42, in run_command
    raise Exception("Error running command")
Exception: Error running command
[root@samsung /]# 

This is a completely cleaned system, updated, then katello installed.

Comment 10 Duncan Innes 2012-05-05 15:27:08 UTC
I just installed a new F16 x86_64 virtual guest, performed all updates, installed Katello repos, installed katello, ran katello-configure:

[root@localhost ~]# katello-configure 
Starting Katello configuration
The top-level log file is [/var/log/katello/katello-configure-20120505-161242/main.log]
Creating Katello database user
############################################################ ... OK
Creating Katello database
############################################################ ... OK
Creating Candlepin database user
############################################################ ... OK
Creating Candlepin database
############################################################ ... OK
Candlepin setup

  Failed, please check [/var/log/katello/katello-configure/cpsetup.log]
[root@localhost ~]# cat /var/log/katello/katello-configure/cpsetup.log

########## ERROR ############
Error running command: wget -qO- http://localhost:8080/candlepin/admin/init
Status code: 2048
Command output: 
Writing configuration file
Cerficiates already exist, skipping...
Waiting for tomcat to restart...
Waiting for tomcat to restart...
Waiting for tomcat to restart...
Waiting for tomcat to restart...
Traceback (most recent call last):
  File "/usr/share/candlepin/cpsetup", line 218, in <module>
    main(sys.argv[1:])
  File "/usr/share/candlepin/cpsetup", line 213, in main
    run_command("wget -qO- http://localhost:8080/candlepin/admin/init")
  File "/usr/share/candlepin/cpsetup", line 42, in run_command
    raise Exception("Error running command")
Exception: Error running command
[root@localhost ~]#

Do you want any of the other logs?

Thanks

Duncan

Comment 11 Martin Bacovsky 2012-05-09 14:08:56 UTC
Finally I was able to reproduce the issue. It is problem with setup of tomcat's certificates. There is a fix ready. I'll let you know when the new build makes it in the repo.

Comment 12 Martin Bacovsky 2012-05-11 08:40:36 UTC
The updated packages that fixes the issue are in the repo.

For me the following did the trick and Katello was successfully installed

- katello_remove.sh
- yum install katello-all
- katello-configure

The relevant packages are candlepin >= 0.5.31 and katello-configure >= 0.2.20

Please let me know how that worked

Comment 13 Duncan Innes 2012-05-11 17:58:53 UTC
OK - looks like I'm getting a little further, but unfortunately not far...


[root@samsung ~]# katello-configure 
Starting Katello configuration
The top-level log file is [/var/log/katello/katello-configure-20120511-183120/main.log]
Creating Katello database user
############################################################ ... OK
Creating Katello database
############################################################ ... OK
Creating Candlepin database user
############################################################ ... OK
Candlepin setup
###########################################################
  Failed, please check [/var/log/katello/katello-configure/cpsetup.log]
[root@samsung ~]# cat /var/log/katello/katello-configure/cpsetup.log

########## ERROR ############
Error running command: /usr/share/candlepin/cpdb --create -u candlepin --database candlepin
Status code: 256
Command output: 
########## ERROR ############
Error running command: 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 migrate
Status code: 65280
Command output: Liquibase Update Failed: /usr/share/java/postgresql-jdbc.jar does not exist
SEVERE 5/11/12 6:32 PM:liquibase: /usr/share/java/postgresql-jdbc.jar does not exist
liquibase.exception.CommandLineParsingException: /usr/share/java/postgresql-jdbc.jar does not exist
	at liquibase.integration.commandline.Main.configureClassLoader(Unknown Source)
	at liquibase.integration.commandline.Main.main(Unknown Source)


For more information, use the --logLevel flag)
Creating candlepin database
Loading candlepin schema
Traceback (most recent call last):
  File "/usr/share/candlepin/cpdb", line 126, in <module>
    dbsetup.create()
  File "/usr/share/candlepin/cpdb", line 61, in create
    self._run_liquibase("db/changelog/changelog-create.xml")
  File "/usr/share/candlepin/cpdb", line 91, in _run_liquibase
    self.username,
  File "/usr/share/candlepin/cpdb", line 32, in run_command
    error_out(command, status, output)
  File "/usr/share/candlepin/cpdb", line 40, in error_out
    raise Exception("Error running command")
Exception: Error running command
Traceback (most recent call last):
  File "/usr/share/candlepin/cpsetup", line 221, in <module>
    main(sys.argv[1:])
  File "/usr/share/candlepin/cpsetup", line 201, in main
    options.dbuser, options.db))
  File "/usr/share/candlepin/cpsetup", line 42, in run_command
    raise Exception("Error running command")
Exception: Error running command

Comment 14 Martin Bacovsky 2012-05-16 14:27:50 UTC
What version of liquibase you have installed? My install succeeded with liquibase-2.0.3-4.el6.noarch. I'll try to find out more.

Comment 15 Duncan Innes 2012-05-16 16:32:30 UTC
Am at work just now, so can't check until I get home.

What I can say is that this has been done on a fully updated F16 box.

Following Comment #12,

1. Run katello_remove.sh script
2. Install katello repos rpm
3. yum install katello-all
4. katello-configure

If liquibase is erased during the katello_remove.sh script and is provided by one of the katello repos, then I suppose I'm installing the latest version that is available to me via the repos.

As I said, though, I'll check tonight and re-run the install.

Comment 16 Duncan Innes 2012-05-16 18:54:55 UTC
Version of liquibase currently installed:

liquibase-2.0.3-7.fc16.noarch

I'll clear things down and try again, then update this ticket.

Comment 17 Duncan Innes 2012-05-16 20:14:28 UTC
This install didn't appear to bring liquibase in with it.  Once I installed liquibase by hand, I got the following error:


[root@samsung ~]# katello-configure 
Starting Katello configuration
The top-level log file is [/var/log/katello/katello-configure-20120516-211153/main.log]
Candlepin setup

  Failed, please check [/var/log/katello/katello-configure/cpsetup.log]
[root@samsung ~]# cat /var/log/katello/katello-configure/cpsetup.log

########## ERROR ############
Error running command: wget -qO- http://localhost:8080/candlepin/admin/init
Status code: 2048
Command output: 
Writing configuration file
Cerficiates already exist, skipping...
Waiting for tomcat to restart...
Waiting for tomcat to restart...
Waiting for tomcat to restart...
Waiting for tomcat to restart...
Traceback (most recent call last):
  File "/usr/share/candlepin/cpsetup", line 221, in <module>
    main(sys.argv[1:])
  File "/usr/share/candlepin/cpsetup", line 216, in main
    run_command("wget -qO- http://localhost:8080/candlepin/admin/init")
  File "/usr/share/candlepin/cpsetup", line 42, in run_command
    raise Exception("Error running command")
Exception: Error running command
[root@samsung ~]#

Comment 19 Martin Bacovsky 2012-05-28 16:04:39 UTC
There were problems liquibase deps introduced with updated candlepin. Could you please try once again with the updated packages? On Fedore 16 there is workaround needed as described in https://fedorahosted.org/pipermail/katello/2012-May/000303.html

It may not be needed in next build, please check for presence of liquibase and postgresql-jdbc to guess if the workaround is needed.

Comment 20 Duncan Innes 2012-06-29 21:03:11 UTC
Sorry for the delay - lots going on right now.

I've upgraded my main system to F17 and as a result have built a brand new F16 x86_64 guest from scratch to continue testing.

Unfortunately I still get a fail after following the website install instructions:

[root@katello ~]# katello-configure
Starting Katello configuration
The top-level log file is [/var/log/katello/katello-configure-20120629-214722/main.log]
Creating Candlepin database user
############################################################ ... OK
Candlepin setup

  Failed, please check [/var/log/katello/katello-configure/cpsetup.log]
Creating Katello database user
############################################################ ... OK
Creating Katello database
############################################################ ... OK
[root@katello ~]# cat /var/log/katello/katello-configure/cpsetup.log
Writing configuration file
Cerficiates already exist, skipping...
Waiting for tomcat to restart...
Waiting for tomcat to restart...
Waiting for tomcat to restart...
Waiting for tomcat to restart...
Waiting for tomcat to restart...
Candlepin has been configured.
[root@katello ~]#

Comment 21 Duncan Innes 2012-06-29 21:05:51 UTC
Both liquibase and postgresql-jdbc were pulled in during the "yum install -y katello-all" process.

Comment 22 Duncan Innes 2012-06-29 21:14:29 UTC
It doesn't look like the error that's now reported is linked to the original report, however.  Close this ticket?  Reopen a different Candlepin ticket?

Comment 23 Bryan Kearney 2012-07-01 13:14:41 UTC
+1 to close and open new,

Comment 24 Duncan Innes 2012-07-04 07:36:06 UTC
OK - working now, so closing.