Foreman : Failed to run preseeded command exit code 8

1.5k Views Asked by At

I install ubuntu 12.04 with foreman provision. When finish the installation, an error occur :

Failed to run preseeded command

Excution of preseeded command "wget http://foreman.example.com:80/unattened/finish?token=bae86996-5230-433b-84e7-896a5280df75 -O /target/tmp/finish.sh && in-target chmod +x /tmp/finish.sh && in-target/tmp/finish.sh" failed with exit code 8

log apache :

GET /unattended/finish?token=bae86996-5230-433b-84e7-896a5280df75 HTTP/1.1" 200 1003 "-" "Wget"
GET /unattended/built?token=bae86996-5230-433b-84e7-896a5280df75 HTTP/1.1" 409 1 "-" "Wget/1.13.4 (linux-gnu)"

How to fix this error?Please guide me the correct way to achieve my objective.

3

There are 3 best solutions below

0
On

I encountered this on Foreman 3.7 and Debian 11.8. I got the failure (exit status 8), and also had two entries in the Foreman UI for the host.

In my case I traced down that under Administer -> Settings -> General, I had set “Append domain names to the host” to “No.” Setting it back to “Yes” solved the behavior described above.

It does seem like it should be possible to have new hosts not have FQDN names shown in the foreman UI, but still not double the host entries. But this approach (showing FQDN in foreman UI rather than short name) was acceptable for my installation so I didn't dig further.

I will mention, though, that my preseed finish script was populating puppet.conf with a "certname" line, and that's probably related to this issue also. (That is, it might have been possible to fix the issue by leaving the "Append domain names to the host" setting as "yes" but taking out the explicit population of the "certname" line, but I didn't test this approach.)

I put more details about this in the Foreman community forums (https://community.theforeman.org/t/double-entries-for-new-hosts-in-foreman/35432) but this answer stands on its own.

1
On

It can also happen if you include in your preseed snippets which cannot be used by the organization(s) you are member of. You can check the organization(s) settings to dig further.

2
On

This normaly happens if a host is already in 'build mode'. The simplest solutions should be to delete the bare metal host in Foreman and create a new one.