Description of problem: [root@katello-ci-rhel6 ~]# katello-configure Starting Katello configuration The top-level log file is [/var/log/katello/katello-configure-20111026-152342/main.log] Populating Katello database schema Failed, please check [/var/log/katello/katello-configure/db_seed.log] [root@katello-ci-rhel6 ~]# echo $? 0 Version-Release number of selected component (if applicable): katello-0.1.96-1.git.46.fc9bd29.el6.x86_64 How reproducible: Steps to Reproduce: 1. 2. 3. Actual results: Expected results: Additional info:
Jan are we able to add some sort of exit code here? This code snippet? elsif line =~ /err:/ t.kill puts "\n Failed, please check [#{processing_logfile}]" processing_logfile = nil end Also maybe within? rescue => e $stderr.puts 'Error: ' + e.message end Cliff
(In reply to comment #1) > Jan are we able to add some sort of exit code here? Well, we can, except: the fact that one target fails in puppet does not necessarily mean that the whole process would be aborted -- other things could get configured after the first failure. Do you prefer us to exit with nonzero whenever we see an error, even if it was followed by successes?
How about returning the result of the last target?
(In reply to comment #2) > (In reply to comment #1) > > Jan are we able to add some sort of exit code here? > > Well, we can, except: the fact that one target fails in puppet does not > necessarily mean that the whole process would be aborted -- other things could > get configured after the first failure. > > Do you prefer us to exit with nonzero whenever we see an error, even if it was > followed by successes? I think that we should *assume* any err from puppet being logged during a fresh installation will result in some portion of the installation not being completed and thus resulting in some portion of Katello not functioning correctly. I would rather get bug reports knowing *when* we hit err states during installation to help make the puppet stuff as robust as we can. So, yes. I feel that we should provide a non-zero exit code if err was detected, even if the rest can/did run OK after it. Cliff
(In reply to comment #3) > How about returning the result of the last target? Sadly - I do not fully grok that statement - maybe define (with an example) what you mean by 'target'. Unless you feel my proposal in comment #5 is OK. Cliff
Cliff, see comment #2. I mean, whatever puppet did last, if it failed, return nonzero error code.
Patch posted to katello-devel: https://www.redhat.com/archives/katello-devel/2011-November/msg00022.html With the patch, katello-configure will exit with nonzero status if error was seen during puppet execution (note, not just the last step in puppet).
Patch was applied to Katello master, 0e82a872d08a95a1659a6e8d11319f5f72352939.
DOCS: Errors look like this: # katello-configure Starting Katello configuration The top-level log file is [/var/log/katello/katello-configure-20111115-170733/main.log] err: /Stage[main]/Postgres::Service/Service[postgresql]/ensure: change from stopped to running failed: Could not start Service[postgresql]: Execution of '/sbin/service postgresql start' returned 1: at /usr/share/katello/install/puppet/modules/postgres/manifests/service.pp:6 There are different error conditions that can also show up like follows: Failed, please check [#{processing_logfile}] where the [] is replaced with the name of the log containing the step that errored.
Now returns nonzero on failures (in this case, service katello-jobs failed to start) Verified, katello-0.1.104-1.git.57.dab58b8.el6.x86_64
getting rid of 6.0.0 version since that doesn't exist