Description of problem:
If there is an error during the kickstart process there is currently no way to notify Satellite that the build has failed. Currently the only option is to just not notify that the build completed.
Add a state to the build process of "Failed" or "Errored" and have an API call that a kickstart can make back to Satellite to indicate that the build has failed/errored.
Given we supported such an API, how the kickstart template would look like?
How about using the same approach as for "built"? We can add another type to foreman_url macro. Otoh I can imagine proxy could use the same API to provide more info about the provisioning progress.
What @Marek said. Basically do some sort of error checking in the template, and then if in error state call new API to mark the build failed.
An example maybe, from real world client, kickstart is attempting to install puppet, but puppet package not available because there is an entitlement issue. So kickstart could first check to see if system is entitled correctly, and/or required package is available, and if not then call mark build in error API.
Right now what happens is if some issue happens during kickstart then the build just stays in building forever, or worse case, doesn't even notice an error occurred and still marks the build complete. In this case the client has had to develop a secondary script to run to make sure the kickstart actually did what it was supposed to.
Created redmine issue http://projects.theforeman.org/issues/21007 from this bug
Ok, so something like `foreman_url('built', 'fail', :message => "Failed installing puppet")` would do the trick, right?
That would be amazing.
Yup, I'd just user different endpoint, not built.
@Marek: what do you have it mind. Let's capture it before we all forget :)
I'd prefer having generic status update API endpoint, so the template would look like this
> foreman_url('build_status_update', 'fail', :message => "Failed installing puppet")
so it could be used from other places too, e.g.
> foreman_url('build_status_update', 'post_tasks_started', :message => "Entered the %post section of a kickstart")
would still exist and would be used to flip the build flag, as part of which we'd also set the build status to success.
Sounds awesome to me.
Upstream bug assigned to firstname.lastname@example.org
Moving this bug to POST for triage into Satellite 6 since the upstream issue http://projects.theforeman.org/issues/21007 has been resolved.
looks like the attached foreman issue still has an open pr?
Hiya all. Just checking in to see if there's been any progress on this? Got a couple of customers still anticipating this BZ to be released.
Please, provide some verification steps. IS there any documentation whatsoever?
Is this also supposed to handle pxe-handoff failures? Which stages are being reported?
sat6.6.0 snap 14
- the verification steps were consulted with mhulan IRL (cancelling needinfo).
- I updated the the last check to return non-zero return code in order to provoke marking the build as failed.
- the whole provisioning and package installation ran properly and the non-zero return code got reported to foreman, which correctly marked the build as failure with message "installation error"
- there's no notification generated for this event, but I raised a standalone RFE for this:
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.