Bug #12185


Inconsistent Host Creation

Added by Riley Shott about 8 years ago. Updated over 5 years ago.

Target version:
Fixed in Releases:
Found in Releases:


I've found that when my hostname contains capital letters (e.g. HOSTNAME.domain.local) that two hosts will get created in the Foreman. One that contains the report information (that's upper-case), the other contains the fact information (that's lower-case). The debug logs for POSTing to /api/host/facts with a host that contains capitals looks like below:

I've also attached a sanitized screenshot of what this looks like in the Foreman.

I see in the code that you're down casing hostnames for importing facts, but don't see the same action taken when a node is created from a report upload:

Would it be possible to standardize how hosts are created from an import of reports and facts? I'm not fully aware of what the ramifications of this would be, but is it possible to not modify the hostname at all (i.e. create a host with the same name that was passed to the API)? As an experiment, I tried commenting out line 489 in the code above to see if it would only create one host, and tie the facts to the host with the capital hostname. It succeeded in the latter, but not the former. That is, I still ended up with 2 hosts in the Foreman UI, but the capital hostname entry had the facts tied to it. However, it still didn't auto-generate the Properties table of the host view for that capital hostname entry (i.e. Domain, MAC, IP Address). That table was still only filled out for the lower case host.


Foreman 1.9.1
SmartProxy 1.9.1


foreman_hostnames.png View foreman_hostnames.png 39.4 KB Riley Shott, 10/15/2015 01:18 PM

Related issues 1 (0 open1 closed)

Related to Chef - Bug #12848: Duplicates host in Foreman consoleClosedMarek Hulán12/16/2015Actions
Actions #1

Updated by Marek Hulán about 8 years ago

  • Project changed from Smart Proxy to Foreman
  • Category set to Reporting
  • Status changed from New to Assigned
  • Assignee changed from Riley Shott to Marek Hulán

Thanks for the report. I saw the PR you've opened against chef-handler-foreman. That would fix it only for chef plugin but the same should be applied for all cfgmgmt tools so I'll send another fix against Foreman core.

Actions #2

Updated by The Foreman Bot about 8 years ago

  • Status changed from Assigned to Ready For Testing
  • Pull request added
  • Pull request deleted ()
Actions #3

Updated by Marek Hulán about 8 years ago

  • Status changed from Ready For Testing to Closed
  • % Done changed from 0 to 100
Actions #4

Updated by Dominic Cleal about 8 years ago

  • translation missing: en.field_release set to 63
Actions #5

Updated by Marek Hulán almost 8 years ago

  • Related to Bug #12848: Duplicates host in Foreman console added

Also available in: Atom PDF