Project

General

Profile

Actions

Bug #15742

open

OS image field disabled during host creation, causing finish template error

Added by Dis McCarthy about 8 years ago. Updated about 8 years ago.

Status:
New
Priority:
Normal
Assignee:
-
Category:
Host creation
Target version:
-
Difficulty:
Triaged:
Fixed in Releases:
Found in Releases:

Description

Using EC2, Foreman doesn't resolve the OS templates on the first try. After completely configuring the host, both 'Resolve' and the main 'submit' error out: "Sorry but no templates were configured." and "Unable to save
No finish templates were found for this host, make sure you define at least one in your Ubuntu 14.04 settings"

If it is submitted again, with no changes(*), it will resolve correctly and build the host. (The 'resolve' button also works immediately after the error.)

(* No changes except redoing the lost network config, since it resets the interface subnet/etc when submit is clicked.)

Initial submit:

2016-07-19T17:28:19 [app] [I] Completed 201 Created in 176ms (Views: 4.3ms | ActiveRecord: 68.2ms)
2016-07-19T17:28:19 [app] [I] Started GET "/" for 38.140.146.178 at 2016-07-19 17:28:19 +0000
2016-07-19T17:28:19 [app] [I] Processing by DashboardController#index as HTML
2016-07-19T17:28:20 [app] [I] Rendered dashboard/_status_links.html.erb (4.2ms)
2016-07-19T17:28:20 [app] [I] Rendered dashboard/_status_widget.html.erb (5.4ms)
2016-07-19T17:28:20 [app] [I] Rendered dashboard/_status_links.html.erb (2.3ms)
2016-07-19T17:28:20 [app] [I] Rendered dashboard/_status_chart_widget.html.erb (3.7ms)
2016-07-19T17:28:20 [app] [I] Rendered dashboard/_reports_widget.html.erb (18.2ms)
2016-07-19T17:28:20 [app] [I] Rendered dashboard/_distribution_widget.html.erb (24.5ms)
2016-07-19T17:28:20 [app] [I] Rendered dashboard/index.html.erb within layouts/application (1076.1ms)
2016-07-19T17:28:20 [app] [I] Rendered common/_searchbar.html.erb (7.3ms)
2016-07-19T17:28:20 [app] [I] Rendered layouts/_application_content.html.erb (8.9ms)
2016-07-19T17:28:20 [app] [I] Rendered home/_user_dropdown.html.erb (5.6ms)
2016-07-19T17:28:20 [app] [I] Read fragment views/tabs_and_title_records-8 (0.1ms)
2016-07-19T17:28:20 [app] [I] Rendered home/_location_dropdown.html.erb (5.9ms)
2016-07-19T17:28:20 [app] [I] Rendered home/_org_switcher.html.erb (7.0ms)
2016-07-19T17:28:20 [app] [I] Rendered home/_submenu.html.erb (3.0ms)
2016-07-19T17:28:20 [app] [I] Rendered home/_submenu.html.erb (1.5ms)
2016-07-19T17:28:20 [app] [I] Rendered home/_submenu.html.erb (1.2ms)
2016-07-19T17:28:20 [app] [I] Rendered home/_submenu.html.erb (1.1ms)
2016-07-19T17:28:20 [app] [I] Rendered home/_submenu.html.erb (1.6ms)
2016-07-19T17:28:20 [app] [I] Write fragment views/tabs_and_title_records-8 (0.7ms)
2016-07-19T17:28:20 [app] [I] Rendered home/_topbar.html.erb (80.6ms)
2016-07-19T17:28:20 [app] [I] Rendered layouts/base.html.erb (83.0ms)
2016-07-19T17:28:20 [app] [I] Completed 200 OK in 1346ms (Views: 1144.6ms | ActiveRecord: 61.3ms)
2016-07-19T17:28:20 [app] [I] Started POST "/hosts" for 38.140.146.178 at 2016-07-19 17:28:20 +0000
2016-07-19T17:28:20 [app] [I] Processing by HostsController#create as */*
2016-07-19T17:28:20 [app] [I] Parameters: {"utf8"=>"✓", "authenticity_token"=>"3f3wgh/NwWugGXsrSIxa5HpBL2Iqy6uiHLlJ3+XtEhAPxhvlilg0UxhL6GM/8hXdv3Y4YGLxZpl/pq+V61WccA==", "host"=>{"name"=>"our-puppet-test-s03", "location_id"=>"1", "hostgroup_id"=>"", "compute_resource_id"=>"5", "compute_profile_id"=>"1", "environment_id"=>"6", "puppet_ca_proxy_id"=>"1", "puppet_proxy_id"=>"1", "realm_id"=>"", "config_group_ids"=>["", "2", "5"], "puppetclass_ids"=>[""], "managed"=>"true", "progress_report_id"=>"[FILTERED]", "type"=>"Host::Managed", "interfaces_attributes"=>{"0"=>{"_destroy"=>"0", "type"=>"Nic::Managed", "mac"=>"", "identifier"=>"", "name"=>"our-puppet-test-s03", "domain_id"=>"3", "subnet_id"=>"1", "ip"=>"", "managed"=>"1", "primary"=>"1", "provision"=>"1", "virtual"=>"0", "tag"=>"", "attached_to"=>""}}, "compute_attributes"=>{"flavor_id"=>"t2.small", "availability_zone"=>"", "subnet_id"=>"subnet-12345", "security_group_ids"=>[""], "managed_ip"=>"private"}, "architecture_id"=>"1", "operatingsystem_id"=>"1", "provision_method"=>"image", "build"=>"1", "disk"=>"", "root_pass"=>"[FILTERED]", "is_owned_by"=>"8-Users", "enabled"=>"1", "model_id"=>"", "comment"=>"", "overwrite"=>"false"}, "capabilities"=>"image", "provider"=>"EC2", "bare_metal_capabilities"=>"build"}
2016-07-19T17:28:20 [app] [I] Failed to save: No finish templates were found for this host, make sure you define at least one in your Ubuntu 14.04 settings
2016-07-19T17:28:20 [app] [I] Rendered hosts/_progress.html.erb (0.6ms)
2016-07-19T17:28:21 [app] [I] Rendered config_groups/_config_group.html.erb (34.2ms)
2016-07-19T17:28:21 [app] [I] Rendered config_groups/_config_group.html.erb (5.9ms)
2016-07-19T17:28:21 [app] [I] Rendered config_groups/_config_group.html.erb (3.2ms)
2016-07-19T17:28:21 [app] [I] Rendered config_groups/_config_group.html.erb (3.0ms)
2016-07-19T17:28:21 [app] [I] Rendered config_groups/_config_group.html.erb (1.4ms)
2016-07-19T17:28:21 [app] [I] Rendered config_groups/_config_group.html.erb (1.7ms)
2016-07-19T17:28:21 [app] [I] Rendered config_groups/_config_group.html.erb (1.7ms)
2016-07-19T17:28:21 [app] [I] Rendered config_groups/_config_group.html.erb (2.6ms)
2016-07-19T17:28:21 [app] [I] Rendered config_groups/_config_group.html.erb (1.4ms)
2016-07-19T17:28:21 [app] [I] Rendered config_groups/_config_groups_selection.html.erb (81.7ms)
2016-07-19T17:28:21 [app] [I] Rendered puppetclasses/_selectedClasses.html.erb (0.0ms)
2016-07-19T17:28:21 [app] [I] Rendered puppetclasses/_classes_in_groups.html.erb (3.2ms)
2016-07-19T17:28:21 [app] [I] Rendered puppetclasses/_classes.html.erb (357.7ms)
2016-07-19T17:28:21 [app] [I] Rendered puppetclasses/_class_selection.html.erb (465.9ms)
2016-07-19T17:28:21 [app] [I] Rendered nic/_base_form.html.erb (29.2ms)
2016-07-19T17:28:21 [app] [I] Rendered nic/_virtual_form.html.erb (1.9ms)
2016-07-19T17:28:21 [app] [I] Rendered nic/_provider_specific_form.html.erb (0.7ms)
2016-07-19T17:28:21 [app] [I] Rendered nic/manageds/_managed.html.erb (39.6ms)
2016-07-19T17:28:21 [app] [I] Rendered nic/_base_form.html.erb (15.4ms)
2016-07-19T17:28:21 [app] [I] Rendered nic/_virtual_form.html.erb (0.9ms)
2016-07-19T17:28:21 [app] [I] Rendered nic/_provider_specific_form.html.erb (0.2ms)
2016-07-19T17:28:21 [app] [I] Rendered nic/manageds/_managed.html.erb (20.5ms)
2016-07-19T17:28:21 [app] [I] Rendered hosts/_interfaces.html.erb (66.3ms)
2016-07-19T17:28:23 [app] [I] Rendered compute_resources_vms/form/ec2/_base.html.erb (909.0ms)
2016-07-19T17:28:23 [app] [I] Rendered compute_resources_vms/form/_volumes.html.erb (0.8ms)
2016-07-19T17:28:23 [app] [I] Rendered hosts/_compute_detail.html.erb (914.0ms)
2016-07-19T17:28:23 [app] [I] Rendered hosts/_compute.html.erb (1596.5ms)
2016-07-19T17:28:23 [app] [I] Rendered common/os_selection/_architecture.html.erb (16.7ms)
2016-07-19T17:28:23 [app] [I] Rendered common/os_selection/_operatingsystem.html.erb (61.7ms)
2016-07-19T17:28:23 [app] [I] Rendered hosts/provision_method/build/_form.html.erb (65.8ms)
2016-07-19T17:28:23 [app] [I] Rendered hosts/provision_method/image/_form.html.erb (0.5ms)
2016-07-19T17:28:23 [app] [I] Rendered hosts/_operating_system.html.erb (94.3ms)
2016-07-19T17:28:23 [app] [I] Rendered hosts/_unattended.html.erb (1694.0ms)

2016-07-19T17:28:23 [app] [I] Rendered puppetclasses/_class_parameters.html.erb (158.5ms)
2016-07-19T17:28:23 [app] [I] Rendered puppetclasses/_classes_parameters.html.erb (176.6ms)
2016-07-19T17:28:23 [app] [I] Rendered common_parameters/_inherited_parameters.html.erb (14.8ms)
2016-07-19T17:28:23 [app] [I] Rendered common_parameters/_parameter.html.erb (2.3ms)
2016-07-19T17:28:23 [app] [I] Rendered common_parameters/_parameters.html.erb (14.1ms)
2016-07-19T17:28:23 [app] [I] Rendered hosts/_form.html.erb (2565.5ms)
2016-07-19T17:28:23 [app] [I] Rendered hosts/new.html.erb within layouts/application (2567.5ms)
2016-07-19T17:28:23 [app] [I] Rendered layouts/_application_content.html.erb (1.0ms)
2016-07-19T17:28:23 [app] [I] Rendered home/_user_dropdown.html.erb (2.1ms)
2016-07-19T17:28:23 [app] [I] Read fragment views/tabs_and_title_records-8 (0.1ms)
2016-07-19T17:28:23 [app] [I] Rendered home/_topbar.html.erb (5.3ms)
2016-07-19T17:28:23 [app] [I] Rendered layouts/base.html.erb (236.7ms)
2016-07-19T17:28:23 [app] [I] Completed 200 OK in 3258ms (Views: 2696.8ms | ActiveRecord: 173.7ms)

After that, clicking resolve works:
Templates resolved for this operating system

User data template Template Our Combined Userdata


Files

foreman-os.jpg View foreman-os.jpg 40.7 KB Dis McCarthy, 07/20/2016 11:09 AM
Actions #1

Updated by Dominic Cleal about 8 years ago

  • Status changed from New to Need more information

Please include the version of Foreman installed and of any plugins (foreman-rake plugin:list).

Actions #2

Updated by Dis McCarthy about 8 years ago

Desired=Unknown/Install/Remove/Purge/Hold
| Status=Not/Inst/Conf-files/Unpacked/halF-conf/Half-inst/trig-aWait/Trig-pend
|/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad)
||/ Name                                          Version                     Architecture                Description
+++-=============================================-===========================-===========================-======================================================
ii  foreman                                       1.12.0-1                    amd64                       Systems management web interface
ii  foreman-cli                                   1.12.0-1                    all                         metapackage providing hammer CLI for Foreman
ii  foreman-debug                                 1.12.0-1                    all                         provides support utility foreman-debug.
ii  foreman-ec2                                   1.12.0-1                    all                         metapackage providing EC2 dependencies for Foreman
ii  foreman-installer                             1.12.0-1                    all                         Automated puppet-based installer for The Foreman
un  foreman-pgsql                                 <none>                      <none>                      (no description available)
ii  foreman-postgresql                            1.12.0-1                    all                         metapackage providing PostgreSQL dependencies for Foreman
ii  foreman-proxy                                 1.12.0-1                    all                         RESTful proxies for DNS, DHCP, TFTP, and Puppet

Plugins:
Collecting plugin information
Foreman plugin: foreman_setup, 4.0.0, Dominic Cleal, Plugin for Foreman that helps set up provisioning.
Foreman plugin: puppetdb_foreman, 1.0.3, Daniel Lobato Garcia, Disable hosts on PuppetDB after they are deleted or built in Foreman, and proxy the PuppetDB dashboard to Foreman. Follow https://github.com/theforeman/puppetdb_foreman and raise an issue/submit a pull request if you need extra functionality. You can also find some help in #theforeman IRC channel on Freenode.

It also occurred with 1.11.1-1, 1.11.2 and 1.11.3 (don't have plugin versions for those unfortunately, going off the dpkg log)

Actions #3

Updated by Dominic Cleal about 8 years ago

  • Category set to Host creation
  • Status changed from Need more information to New

Thanks for checking.

Both of the errors you mention probably come from the same thing, which looks like a missing image selection. The create log has this section:

"compute_attributes"=>{"flavor_id"=>"t2.small", "availability_zone"=>"", "subnet_id"=>"subnet-12345", "security_group_ids"=>[""], "managed_ip"=>"private"},

It should contain an "image_id" attribute too. Here's mine:

"compute_attributes"=>{"flavor_id"=>"m1.small", "availability_zone"=>"", "subnet_id"=>"", "security_group_ids"=>[""], "managed_ip"=>"public", "image_id"=>"ami-e4ff5c93"}

Perhaps the image selection isn't appearing for you? Please check the operating system tab after you select the compute resource - there should be an image selection between the operating system dropdown and the root password box. If it's missing or empty then this might explain the missing attribute and subsequent errors.

Is the dropdown missing or empty, but then appears after pressing Submit and getting the error?

Actions #4

Updated by Dis McCarthy about 8 years ago

In the older versions, that was usually populating as normal even with failure. I am getting very inconsistent results today, however.

I've been trying two tests. "Quick", where I just populate the minimum to try to demonstrate the problem. (Location, Deploy To, Environment and Compute Profile.) On the majority of the "quick" tests, it is working as expected with the dropdown being available and holding the image.

The more complete test I'm trying is a real deployment workflow - configure each tab, move to the next. I am getting it failing both ways most of the time. One test, it didn't populate the field or activate the drop-down. On a later attempt, the image populated automatically but the resolve button still errored out. (See attachment.)

Actions #5

Updated by Dominic Cleal about 8 years ago

  • Subject changed from Foreman doesn't resolve templates on the first try to OS image field disabled during host creation, causing finish template error

Yeah, the image shows the dropdown is disabled which means the field isn't going to be sent to the server, causing the error. Some of the dropdown selections on the form, particularly deploy on and locations/orgs, will cause AJAX calls to the server to refresh data. It might be if you're changing them quickly that something isn't fully loading before the next dropdown is changed.

The image field should refresh when items such as host group, OS and architecture are changed.

Actions

Also available in: Atom PDF