Provisioning error - failed to retrieve preconfiguration file


Deployment of ubuntu 18.04 machines are failing with “failed to retrieve the preconfiguration file”. This is a newly deployed foreman server on ubuntu 18.04

Expected outcome:

installation of ubuntu machine

Foreman and Proxy versions:

Foreman 1.21.2

Foreman and Proxy plugin versions:

foreman-proxy 1.21.2
foreman-vmware 1.21.2


memcache 0.1.0-1
montitoring 1.0.1-1
remote execution 1.7.0-1

Other relevant data:
[e.g. logs from Foreman and/or the Proxy, modified templates, commands issued, etc]
(for logs, surround with three back-ticks to get proper formatting, e.g.)

-15T10:50:43 [I|app|5e8469ab] Completed 200 OK in 5ms (Views: 0.1ms | ActiveRecord: 0.5ms)
2019-04-15T10:50:44 [I|app|8c6461e1] Started GET "/unattended/provision?token=63aa09c5-adc2-46f1-aaa3-acecfda32cd4" for at 2019-04-15 10:50:44 -0400
2019-04-15T10:50:44 [I|app|8c6461e1] Processing by UnattendedController#host_template as TEXT
2019-04-15T10:50:44 [I|app|8c6461e1]   Parameters: {"token"=>"63aa09c5-adc2-46f1-aaa3-acecfda32cd4", "kind"=>"provision"}
2019-04-15T10:50:44 [E|app|8c6461e1] unable to find provision template for running Ubuntu 18.04
2019-04-15T10:50:44 [I|app|8c6461e1]   Rendering text template
2019-04-15T10:50:44 [I|app|8c6461e1]   Rendered text template (0.0ms)
2019-04-15T10:50:44 [I|app|8c6461e1] Completed 404 Not Found in 22ms (Views: 0.3ms | ActiveRecord: 7.3ms)
2019-04-15T10:50:52 [I|app|570a256d] Started GET "/node/" for at 2019-04-15 10:50:52 -0400
2019-04-15T10:50:52 [I|app|570a256d] Processing by HostsController#externalNodes as YML
2019-04-15T10:50:52 [I|app|570a256d]   Parameters: {"name"=>""}
2019-04-15T10:50:52 [I|app|570a256d]   Rendering text template
2019-04-15T10:50:52 [I|app|570a256d]   Rendered text template (0.0ms)


according to the logs, it cannot find your preseed template.
If you go to the host’s details page, tab templates, there should be an option to review the provisioning template. Can you check wheter that works?
If not, you should check for the following:

  • Maybe you see a more descriptive error message in the review
  • Is your preseed template correctly set up for the OS?
  • Is the template assigned to the correct organzation/location for the host?
1 Like

Also 404 often means “token has expired”. Exit and re-enter the build mode.

The Preseed template loads, here is the preview of the preseed for the test host:

# Locale
d-i debian-installer/locale string en_US
# country and keyboard settings are automatic. Keep them ...
# ... for wheezy and newer:
d-i keyboard-configuration/xkb-keymap seen true

  # Static network configuration.
d-i preseed/early_command string /bin/; /bin/netcfg
d-i netcfg/disable_autoconfig boolean true
d-i netcfg/dhcp_failed note
d-i netcfg/dhcp_options select Configure network manually
d-i netcfg/disable_dhcp boolean true
d-i netcfg/get_ipaddress string
d-i netcfg/get_netmask string
d-i netcfg/get_nameservers string
d-i netcfg/get_gateway string
d-i netcfg/confirm_static boolean true

# Network configuration
d-i netcfg/choose_interface select auto
d-i netcfg/get_hostname string
d-i netcfg/get_domain string
d-i netcfg/wireless_wep string

d-i hw-detect/load_firmware boolean true

# Mirror settings
d-i mirror/country string manual
d-i mirror/http/hostname string
d-i mirror/http/directory string /ubuntu
d-i mirror/http/proxy string
d-i mirror/codename string bionic
d-i mirror/suite string bionic
d-i mirror/udeb/suite string bionic

# Time settings
d-i clock-setup/utc boolean true
d-i time/zone string UTC

d-i clock-setup/ntp boolean true
d-i clock-setup/ntp-server string

# Set alignment for automatic partitioning
# Choices: cylinder, minimal, optimal
#d-i partman/alignment select cylinder

# Use the first detected hard disk as default installation disk
d-i partman/early_command string debconf-set partman-auto/disk "$(list-devices disk | head -n1)"

### Partitioning
# The presently available methods are: "regular", "lvm" and "crypto"
d-i partman-auto/method string regular

# If one of the disks that are going to be automatically partitioned
# contains an old LVM configuration, the user will normally receive a
# warning. This can be preseeded away...
d-i partman-lvm/device_remove_lvm boolean true
# The same applies to pre-existing software RAID array:
d-i partman-md/device_remove_md boolean true
# And the same goes for the confirmation to write the lvm partitions.
d-i partman-lvm/confirm boolean true
d-i partman-lvm/confirm_nooverwrite boolean true

# You can choose one of the three predefined partitioning recipes:
# - atomic: all files in one partition
# - home:   separate /home partition
# - multi:  separate /home, /var, and /tmp partitions (/usr was removed in jessie)
d-i partman-auto/choose_recipe select atomic

# If you just want to change the default filesystem to something
# else, you can do that without providing a full recipe.

# This makes partman automatically partition without confirmation, provided
# that you told it what to do using one of the methods above.
d-i partman/confirm_write_new_label boolean true
d-i partman/choose_partition select finish
d-i partman/confirm boolean true
d-i partman/confirm_nooverwrite boolean true

# User settings
d-i passwd/root-password-crypted password $5$6UPApBBW8s1ox9sK$slV8OzL3n.qWOaUszDiIa50o9AGvzKs76abwyzFJuK2
user-setup-udeb passwd/root-login boolean true
d-i passwd/make-user boolean false
user-setup-udeb passwd/make-user boolean false

# Install minimal task set (see tasksel --task-packages minimal)
tasksel tasksel/first multiselect minimal, ssh-server, openssh-server

# Install some base packages
d-i pkgsel/include string  lsb-release apt-transport-https software-properties-common
d-i pkgsel/update-policy select unattended-upgrades
d-i pkgsel/upgrade select none

popularity-contest popularity-contest/participate boolean false

# Boot loader settings
#grub-pc grub-pc/hidden_timeout boolean false
#grub-pc grub-pc/timeout string 10
d-i grub-installer/only_debian boolean true
d-i grub-installer/with_other_os boolean true
d-i grub-installer/bootdev string default
d-i finish-install/reboot_in_progress note

d-i preseed/late_command string wget -Y off -O /target/tmp/ && in-target chmod +x /tmp/ && in-target /tmp/

I have tried cancelling and issuing a rebuild, same error occurs.

It has been some time since I took a look at how templates are beeing rendered (and I’m not a dev) but I think I remember something about network settings on the provisioning interface having to match the infos in Foreman.

Just a wild guess: Can you check if the information about your systems provisioning interface match the state of the system while it tries installing (i.e. after DHCP or whatever you are using)? I might be completely mistaken here, but could be worth a try.

Thank you all for the advice, esp areyus. It turned out to actually be the custom provisioning and finish templates. They were assigned to a location, but not to an Organization. Comparing the production server to our working test server helped me finally find this issue. Checking under Organization details threw up errors that led me to the missing link. Our current production foreman is 1.15 so Locations and Orgs are still a bit new to me.

Happy to hear you managed to track down your issue, glad I could help :slight_smile:
Could you pleas mark the thread as solved (click the checkbox on the post with the solution) so others can see in the threadlist that this has been resolved?

Thanks for heads up, so if I understand correctly finish and provisioning template taxonomy did no match. We do not have a mechanism to check that unfortunately, this “association” is kind “free form” - only for Debians.