Foreman kickstart call build done api failed after system was kicked

Hi guys,

I am using katello 2.0.1 with foreman 1.6.1, but we recently find a
problem, when a system was kicked, at the last part of the kickstart file,
it will call foreman api to replace the TFTP configuration file to the
default, here is the production.log for a normal one after a system was
kicked:

Processing by UnattendedController#built as /
Parameters: {"token"=>"519126e4-6528-4e9a-8cdf-4218bc7ff7c6"}
Found kvm-test.abc.com
unattended: kvm-test.anim.odw.com.cn is Built!
Add the TFTP configuration for kvm-test.abc.com
Delete the autosign entry for kvm-test.abc.com
Completed 201 Created in 157ms (ActiveRecord: 14.0ms)

but, sometimes, it will failed on some host that was kicked again and
again because the TFTP config file was not replace by default one, seems
that the API calling failed for some reason, I can't get any log in the
production.log file, but on the kicked system's install.post.log, we do
find something on the last line:
"Informing Foreman that we are built"
it means that the system actually tried to call foreman API, it just failed.

Most of the time the kickstart process works well, it sometimes happened,
but not often, the problem was that once it happened, normally, the system
will be kicked more than once, maybe twice or even more, because we are not
suppose to sit by the hosts and waiting.

So any good ideas about this?

Thanks
Sinux

Hi,

If you have no error to give it will be hard to diagnose the problem. Could
be a DNS problem, a token not found, etc etc.

May be you can try to log wget output on the kickstart finish template and
see what is going on ? When you say "I can't get any log in the
production.log file", does that mean you don't have access to the
production.log or there is no error in the production log file ?

Regards,

··· 2015-01-15 5:22 GMT+01:00 sinux shen :

Hi guys,

I am using katello 2.0.1 with foreman 1.6.1, but we recently find a
problem, when a system was kicked, at the last part of the kickstart file,
it will call foreman api to replace the TFTP configuration file to the
default, here is the production.log for a normal one after a system was
kicked:

Processing by UnattendedController#built as /
Parameters: {“token”=>“519126e4-6528-4e9a-8cdf-4218bc7ff7c6”}
Found kvm-test.abc.com
unattended: kvm-test.anim.odw.com.cn is Built!
Add the TFTP configuration for kvm-test.abc.com
Delete the autosign entry for kvm-test.abc.com
Completed 201 Created in 157ms (ActiveRecord: 14.0ms)

but, sometimes, it will failed on some host that was kicked again and
again because the TFTP config file was not replace by default one, seems
that the API calling failed for some reason, I can’t get any log in the
production.log file, but on the kicked system’s install.post.log, we do
find something on the last line:
"Informing Foreman that we are built"
it means that the system actually tried to call foreman API, it just
failed.

Most of the time the kickstart process works well, it sometimes happened,
but not often, the problem was that once it happened, normally, the system
will be kicked more than once, maybe twice or even more, because we are not
suppose to sit by the hosts and waiting.

So any good ideas about this?

Thanks
Sinux


You received this message because you are subscribed to the Google Groups
"Foreman users" group.
To unsubscribe from this group and stop receiving emails from it, send an
email to foreman-users+unsubscribe@googlegroups.com.
To post to this group, send email to foreman-users@googlegroups.com.
Visit this group at http://groups.google.com/group/foreman-users.
For more options, visit https://groups.google.com/d/optout.

Hi,

Thanks for the reply, and sorry for the late response.

I can gather some log from install.post.log under host's root directory,
here is an example on one of our system that kick itself again and again:
Informing Foreman that we are built
–2015-02-03 17:05:44–
http://katello.abc.com/unattended/built?token=ca0ddd99-8898-41f1-92f6-ec555e1c13cb
<http://katello.anim.odw.com.cn/unattended/built?token=ca0ddd99-8898-41f1-92f6-ec555e1c13cb>
Resolving katello.abc.com… 10.241.32.19
Connecting to katello.abc.com <http://katello.anim.odw.com.cn>|10.
241.32.19|:80… connected.
HTTP request sent, awaiting response… 405 Method Not Allowed
2015-02-03 17:05:44 ERROR 405: Method Not Allowed.

I know that this log might not have a lot reference value because this
might because I manually cancel the host's build status. But I do remember
that last time when it happened, this log showed me that it called the
foreman API.

Here is the piece in my kickstart template:
<% if @provisioning_type == nil || @provisioning_type == 'host' -%>

Inform the build system that we are done.

echo "Informing Foreman that we are built"
wget -O /dev/null --no-check-certificate <%= foreman_url %>
<% end -%>

BTW, I do have the access to production.log, but I can't see anything
helpful, I mean "no errors" for this.

Thanks again,
Sinux

··· On Thursday, January 15, 2015 at 7:32:08 PM UTC+8, claude juif wrote: > > Hi, > > If you have no error to give it will be hard to diagnose the problem. > Could be a DNS problem, a token not found, etc etc. > > May be you can try to log wget output on the kickstart finish template and > see what is going on ? When you say "I can't get any log in the > production.log file", does that mean you don't have access to the > production.log or there is no error in the production log file ? > > Regards, > > 2015-01-15 5:22 GMT+01:00 sinux shen <sinux...@gmail.com >: > >> Hi guys, >> >> I am using katello 2.0.1 with foreman 1.6.1, but we recently find a >> problem, when a system was kicked, at the last part of the kickstart file, >> it will call foreman api to replace the TFTP configuration file to the >> default, here is the production.log for a normal one after a system was >> kicked: >> >> Processing by UnattendedController#built as */* >> Parameters: {"token"=>"519126e4-6528-4e9a-8cdf-4218bc7ff7c6"} >> Found kvm-test.abc.com >> unattended: kvm-test.anim.odw.com.cn is Built! >> Add the TFTP configuration for kvm-test.abc.com >> Delete the autosign entry for kvm-test.abc.com >> Completed 201 Created in 157ms (ActiveRecord: 14.0ms) >> >> but, sometimes, it will failed on some host that was kicked again and >> again because the TFTP config file was not replace by default one, seems >> that the API calling failed for some reason, I can't get any log in the >> production.log file, but on the kicked system's install.post.log, we do >> find something on the last line: >> "Informing Foreman that we are built" >> it means that the system actually tried to call foreman API, it just >> failed. >> >> Most of the time the kickstart process works well, it sometimes happened, >> but not often, the problem was that once it happened, normally, the system >> will be kicked more than once, maybe twice or even more, because we are not >> suppose to sit by the hosts and waiting. >> >> So any good ideas about this? >> >> Thanks >> Sinux >> >> -- >> You received this message because you are subscribed to the Google Groups >> "Foreman users" group. >> To unsubscribe from this group and stop receiving emails from it, send an >> email to foreman-user...@googlegroups.com . >> To post to this group, send email to forema...@googlegroups.com >> . >> Visit this group at http://groups.google.com/group/foreman-users. >> For more options, visit https://groups.google.com/d/optout. >> > >