Bug 910077 - Thumbslug reports WARN message during katello-service restart
Summary: Thumbslug reports WARN message during katello-service restart
Keywords:
Status: CLOSED WONTFIX
Alias: None
Product: Subscription Asset Manager
Classification: Retired
Component: thumbslug
Version: 1.3
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: rc
: ---
Assignee: Jesus M. Rodriguez
QA Contact: sthirugn@redhat.com
URL:
Whiteboard:
: 996121 (view as bug list)
Depends On:
Blocks: sam20-tracker
TreeView+ depends on / blocked
 
Reported: 2013-02-11 18:16 UTC by sthirugn@redhat.com
Modified: 2017-06-26 20:36 UTC (History)
4 users (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2017-06-26 20:36:07 UTC
Embargoed:


Attachments (Terms of Use)

Description sthirugn@redhat.com 2013-02-11 18:16:01 UTC
Description of problem:
Thumsblug reports WARN message during #katello-service restart.  But #katello-service restart seems to work fine.  The WARN message may confuse the user.

Version-Release number of selected component (if applicable):
* candlepin-0.7.23-1.el6_3.noarch
* candlepin-tomcat6-0.7.23-1.el6_3.noarch
* elasticsearch-0.19.9-5.el6_3.noarch
* katello-candlepin-cert-key-pair-1.0-1.noarch
* katello-certs-tools-1.2.1-1h.el6_3.noarch
* katello-cli-1.2.1-12h.el6_3.noarch
* katello-cli-common-1.2.1-12h.el6_3.noarch
* katello-common-1.2.1-15h.el6_3.noarch
* katello-configure-1.2.3-3h.el6_3.noarch
* katello-glue-candlepin-1.2.1-15h.el6_3.noarch
* katello-headpin-1.2.1-15h.el6_3.noarch
* katello-headpin-all-1.2.1-15h.el6_3.noarch
* katello-selinux-1.2.1-2h.el6_3.noarch
* thumbslug-0.0.28-1.el6_3.noarch
* thumbslug-selinux-0.0.28-1.el6_3.noarch

How reproducible:
Always


Steps to Reproduce:
1. Install and configure SAM
2. #katello-service restart
  
Actual results:
A WARN message is shown to the user while starting thumbslug which may confuse the user.

# katello-service restart
Shutting down Katello services...
Stopping katello: 
Stopping elasticsearch: [  OK  ]
Stopping thumbslug: [  OK  ]
Stopping httpd: [  OK  ]
Stopping tomcat6: [  OK  ]
Done.
Starting Katello services...
Starting tomcat6: [  OK  ]
Starting httpd: [  OK  ]
Starting thumbslug: Feb 11 12:45:16 [main] WARN  org.candlepin.thumbslug.Main - Shutting down...
[  OK  ]
Starting elasticsearch: [  OK  ]
Starting katello: [  OK  ]
Starting katello-jobs: [  OK  ]
Done.

Note that katello-service start also gives the same message:
# katello-service stop
Shutting down Katello services...
Stopping katello: 
Stopping elasticsearch: [  OK  ]
Stopping thumbslug: [  OK  ]
Stopping httpd: [  OK  ]
Stopping tomcat6: [  OK  ]
Done.

# katello-service start
Starting Katello services...
Starting tomcat6: [  OK  ]
Starting httpd: [  OK  ]
Starting thumbslug: Feb 11 12:43:11 [main] WARN  org.candlepin.thumbslug.Main - Shutting down...
[  OK  ]
Starting elasticsearch: [  OK  ]
Starting katello: [  OK  ]
Starting katello-jobs: [  OK  ]
Done.



Expected results:
katello-service restart completing with no errors or warnings.

Additional info:
This BZ was created while verifying https://bugzilla.redhat.com/show_bug.cgi?id=876323

Comment 1 Tom McKay 2013-08-12 18:05:08 UTC
*** Bug 996121 has been marked as a duplicate of this bug. ***

Comment 3 Jesus M. Rodriguez 2013-08-12 18:33:59 UTC
Startup script is here, use this as a reference to see how thumbslug is being shutdown to determine WHICH warn needs to be fixed in Main.java of thumbslug.

https://github.com/Katello/katello/blob/master/script/katello-service?source=cc

Comment 4 Adrian Likins 2013-08-22 15:08:41 UTC
I think thumbslug is failing to load it's keystore (/etc/thumbslug/server_keystore) and fails to start and logs the "Shutting down..." warning on the way out.

I can reproduce the WARN message on a system without a server_keystore.

==> /var/log/thumbslug/error.log <==
Aug 22 10:55:18 [main] ERROR org.candlepin.thumbslug.Main - Unable to load the ssl keystore. Check that ssl.keystore and ssl.keystore.password are set correctly.
org.candlepin.thumbslug.ssl.SslKeystoreException: Failed to initialize the server-side SSLContext.
	at org.candlepin.thumbslug.ssl.SslContextFactory.getServerContext(SslContextFactory.java:83)
	at org.candlepin.thumbslug.Main.configureSSL(Main.java:67)
	at org.candlepin.thumbslug.Main.main(Main.java:139)
Caused by: java.io.FileNotFoundException: /etc/thumbslug/server_keystore.p12 (No such file or directory)
	at java.io.FileInputStream.open(Native Method)
	at java.io.FileInputStream.<init>(FileInputStream.java:137)
	at org.candlepin.thumbslug.ssl.SslContextFactory.getServerContext(SslContextFactory.java:68)
	... 2 more
Aug 22 10:55:44 [main] WARN  org.candlepin.thumbslug.Main - Shutting down...
Aug 22 10:55:45 [main] INFO  org.candlepin.thumbslug.ssl.SslContextFactory - reading keystore
Aug 22 10:55:45 [main] ERROR org.candlepin.thumbslug.Main - Unable to load the ssl keystore. Check that ssl.keystore and ssl.keystore.password are set correctly.
org.candlepin.thumbslug.ssl.SslKeystoreException: Failed to initialize the server-side SSLContext.
	at org.candlepin.thumbslug.ssl.SslContextFactory.getServerContext(SslContextFactory.java:83)
	at org.candlepin.thumbslug.Main.configureSSL(Main.java:67)
	at org.candlepin.thumbslug.Main.main(Main.java:139)
Caused by: java.io.FileNotFoundException: /etc/thumbslug/server_keystore.p12 (No such file or directory)
	at java.io.FileInputStream.open(Native Method)
	at java.io.FileInputStream.<init>(FileInputStream.java:137)
	at org.candlepin.thumbslug.ssl.SslContextFactory.getServerContext(SslContextFactory.java:68)
	... 2 more


Presumably missing or incorrect keystore password would be similar.

As best I can tell, nothing in thumbslug actually creates this file.

Comment 5 Jesus M. Rodriguez 2013-08-22 15:11:54 UTC
(In reply to Adrian Likins from comment #4)
> As best I can tell, nothing in thumbslug actually creates this file.

That's correct, thumbslug proper does not. It's created by the katello-installer.

https://github.com/Katello/katello-installer/tree/master/modules/thumbslug

Comment 6 Adrian Likins 2013-08-22 15:28:30 UTC
So it sounds like this error only happens if thumbslug is started without being setup first? and katello-installer will set that up?

The WARN is from thumbslug startup, where the default logging is:

log4j.appender.RootAppender=org.apache.log4j.ConsoleAppender
log4j.appender.RootAppender.layout=org.apache.log4j.PatternLayout
log4j.appender.RootAppender.layout.ConversionPattern=%d{MMM dd HH:mm:ss} [%t] %-5p %c - %m%n
log4j.rootLogger=WARN,RootAppender
log4j.logger.org.candlepin.thumbslug=INFO

until configs are loaded anyway, so I think that WARN is intentional and valid in this scenario (though it could use more detail)

Comment 7 Jesus M. Rodriguez 2013-09-05 18:07:32 UTC
I added qualifiers to the 3 print messages in Main.java. The message referenced in this bug is from line 153 of Main.java:

        else {
            if (shouldDaemonize) {
                try {
                    log.debug("Daemonizing..");
                    daemon.daemonize();
                    log.debug("Daemonized, exiting");
                }
                catch (IOException e) {
                    log.error("Unable to daemonize properly", e);
                    System.exit(ERROR_DAEMON_DAEMONIZE);
                }
                log.warn("Daemonized, I guess we're done. Shutting down...");
                System.exit(0);
            }
        }

I added the prefix so I could see which statement it was. After starting up thumbslug I was able to see this:

Starting thumbslug: Sep 05 14:06:15 [main] WARN  org.candlepin.thumbslug.Main - Daemonized, I guess we're done. Shutting down...

Comment 8 Jesus M. Rodriguez 2013-09-05 18:36:32 UTC
Removed offending Shutting down log statement.

Added text to each of the remaining Shutting down log entries which result from
an error during startup. The only one that print Shutting down... alone is the
shutdown hook which is the normal shutdown mechanism for thumbslug.

Configuration error results int he following:
    "Unable to load config! Shutting down..."

Problem trying to daemonize:
    "Error during daemon initialization! Shutting down..."

Valid shutdown message:

    "Shutting down..."

Comment 9 Jesus M. Rodriguez 2013-09-05 18:36:59 UTC
https://github.com/candlepin/thumbslug/pull/28

Comment 10 sthirugn@redhat.com 2013-09-13 17:41:00 UTC
Failed.

# katello-service restart
Shutting down Katello services...
Stopping katello: 
Stopping elasticsearch: [  OK  ]
Stopping thumbslug: [  OK  ]
Stopping httpd: [  OK  ]
Stopping tomcat6: [  OK  ]
Done.
Starting Katello services...
Starting tomcat6: [  OK  ]
Starting httpd: [  OK  ]
Starting thumbslug: Sep 13 11:53:19 [main] WARN  org.candlepin.thumbslug.Main - Shutting down...
[  OK  ]
Starting elasticsearch: [  OK  ]
Starting katello: [  OK  ]
Starting katello-jobs: [  OK  ]
Done.


Version Tested:
* candlepin-0.8.26-1.el6sam.noarch
* candlepin-scl-1-5.el6_4.noarch
* candlepin-scl-quartz-2.1.5-5.el6_4.noarch
* candlepin-scl-rhino-1.7R3-1.el6_4.noarch
* candlepin-scl-runtime-1-5.el6_4.noarch
* candlepin-selinux-0.8.26-1.el6sam.noarch
* candlepin-tomcat6-0.8.26-1.el6sam.noarch
* elasticsearch-0.19.9-8.el6sat.noarch
* katello-candlepin-cert-key-pair-1.0-1.noarch
* katello-certs-tools-1.4.2-2.el6sat.noarch
* katello-cli-1.4.3-10.el6sat.noarch
* katello-cli-common-1.4.3-10.el6sat.noarch
* katello-common-1.4.3-13.el6sam_splice.noarch
* katello-configure-1.4.4-4.el6sat.noarch
* katello-glue-candlepin-1.4.3-13.el6sam_splice.noarch
* katello-glue-elasticsearch-1.4.3-13.el6sam_splice.noarch
* katello-headpin-1.4.3-13.el6sam_splice.noarch
* katello-headpin-all-1.4.3-13.el6sam_splice.noarch
* katello-selinux-1.4.4-2.el6sat.noarch
* thumbslug-0.0.34-1.el6sam.noarch
* thumbslug-selinux-0.0.34-1.el6sam.noarch

Comment 11 Jesus M. Rodriguez 2013-09-13 20:25:44 UTC
Prematurely moved to ON_QA. The fix is in thumbslug-0.0.35-1.

Comment 12 Bryan Kearney 2017-06-26 20:36:07 UTC
The release of Satellite 5.8 we are deprecating the support of Subscription Asset Manager. The release notes for 5.8 can be found at https://access.redhat.com/documentation/en-us/red_hat_satellite/5.8/pdf/release_notes/Red_Hat_Satellite-5.8-Release_Notes-en-US.pdf.

I am therefore closing out this bug as WONTFIX. If you believe this to be an error, please feel free tor each out to either Rich Jerrido or Bryan Kearney. Thank you!


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