Bug #1807
closedHost not found when editing a host
Description
Foreman 1.0.0
Puppet 2.7.18
Puppetmaster and Foreman are served by Apache Passenger
All are running on the puppetmaster server which is CentOS 6.3
When editing certain hosts (http://foreman.domain.com/hosts/foohost/edit) and then clicking the Submit button, I briefly see:
Host Not Found Please try to update your request
Then it goes to a blank page that just displays the text "2012" in the very top left corner of the browser. Here is the log of the web request:
Started POST "/hosts/foohost" for 172.22.17.182 at Fri Aug 03 08:30:38 -0400 2012 Processing by HostsController#update as Parameters: {"utf8"=>"รข", "host"=>{"enabled"=>"1", "puppetclass_ids"=>[""], "managed"=>"", "progress_report_id"=>"[FILTERED]", "environment_id"=>"2", "hostgroup_id"=>"2", "model_id"=>"1", "puppet_proxy_id"=>"1", "name"=>"foohost", "comment"=>"", "overwrite"=>"false"}, "authenticity_token"=>"13+RbJb/YmcD/Ux/8RTViLAIaxk2tMjg6B347y2j+FI=", "id"=>"foohost"} Rendered bookmarks/_list.html.erb (2.4ms) Rendered bookmarks/_list.html.erb (0.5ms) Rendered home/_settings.html.erb (8.3ms) Rendered home/_topbar.rhtml (19.2ms) Rendered common/404.rhtml within layouts/application (26.6ms) Completed 404 Not Found in 577ms (Views: 26.9ms | ActiveRecord: 239.0ms)
This happens on certain hosts, but no pattern to it. Let me know if you need more info.
Updated by Jason Ashby almost 13 years ago
Here is the web log for a successful edit:
Started GET "/hosts/homer.domain.com" for 172.x.x.x at Fri Aug 10 09:32:31 -0400 2012 Processing by HostsController#show as HTML Parameters: {"id"=>"homer.domain.com"} Rendered hosts/_overview.html.erb (13.8ms) Rendered hosts/_metrics.html.erb (0.4ms) Rendered bookmarks/_list.html.erb (2.3ms) Rendered bookmarks/_list.html.erb (0.5ms) Rendered home/_settings.html.erb (8.0ms) Rendered home/_topbar.rhtml (19.0ms) Rendered hosts/show.html.erb within layouts/application (526.2ms) Completed 200 OK in 741ms (Views: 492.2ms | ActiveRecord: 44.6ms)
Note that this particular host (homer.domain.com) has a FQDN. Most of my hosts in Foreman/Puppet are listed with only their hostname and not the FQDN. It could be something with having hostname vs. FQDN.
I see the GET parameter for id is actually set in this successful request but not in my failed requests.
Updated by Jason Ashby almost 13 years ago
After looking into it some more, I see that the issue does in fact occur if the domain is not set on a host. Specifically, on the database side if the domain_id column is not set in the hosts table, then I get the 'Host not Found' error when submitting an edit to an individual host.
Unfortunately, I had to manually set the domain_id to 1 (which corresponds to my domain) in the database for all of my hosts and also set the default value to 1 for when new hosts are added. I tried setting the domain for an entire Hostgroup in the Foreman web gui and it appeared to set successfully, but when I went to the domains list, no additional hosts were listed for my particular domain. I could not set the domain on individual hosts in the web gui, of course, because of the Host not found issue in general.
Now when I make an edit to a host, Foreman converts the hostname to a FQDN. Thats OK, but looks like I need to create new certs for all my hosts now since the current certs don't have the FQDN.
Hope this info helps.
Updated by Jason Ashby almost 13 years ago
Scratch this comment:
Now when I make an edit to a host, Foreman converts the hostname to a FQDN. Thats OK, but looks like I need to create new certs for all my hosts now since the current certs don't have the FQDN.
The error I see is related to a conflicting Sshkey. My ssh_known_hosts file will need to be updated with fqdn's now, but thats a puppet issue.
err: Could not retrieve catalog from remote server: Error 400 on SERVER: Another local or imported resource exists with the type and title Sshkey[chicken] on node chicken
Updated by Ohad Levy almost 7 years ago
- Assignee deleted (
Ohad Levy) - Triaged set to No
Updated by Leos Stejskal almost 4 years ago
- Status changed from New to Closed
Hi, I'm closing the issue, it has been here for some time and I wasn't able to reproduce it on the latest version.
If you think that the issue is still relevant feel free to reopen it.