Project

General

Profile

Bug #2351

Inconsistent Down-casing causes host page to 404

Added by Nate Walck over 6 years ago. Updated over 6 years ago.

Status:
Closed
Priority:
Normal
Category:
Importers
Target version:
Difficulty:
Triaged:
No
Bugzilla link:
Pull request:
Team Backlog:
Fixed in Releases:
Found in Releases:

Description

When adding a client to Foreman that has a mixed case hostname (HostName.localdomain), the host details page for this client would display a 404 error. The debug logs showed this when trying to load the host details page:

https://gist.github.com/natewalck/5238787

even though the reports log worked as expected:

https://gist.github.com/natewalck/5238798

gwmngilfen on #theforeman walked me through all the above troubleshooting and narrowed the issue down to the following line of code:

https://github.com/theforeman/foreman/blob/develop/app/controllers/hosts_controller.rb#L508

I commented out that line of code, restarted the foreman and it began to work as expected.

Thanks to gwmngilfen for all the help on this!

Associated revisions

Revision a380bc92 (diff)
Added by Greg Sutcliffe over 6 years ago

fixes #2351 Downcase fqdn when importing facts, for hostname validation consistency

History

#1 Updated by Greg Sutcliffe over 6 years ago

  • Assignee set to Greg Sutcliffe
  • Priority changed from High to Normal

For clarity, this issue seems to be that the validations are not applied to hosts created via fact upload - UI-created hosts cannot have uppercase characters in, but fact-created ones can.

We should probably apply the same validations to both creation types, and add a test to ensure it.

#2 Updated by Greg Sutcliffe over 6 years ago

  • Status changed from New to Ready For Testing

Nate, there's a better fix at https://github.com/theforeman/foreman/pull/484 if you want to try it.

#3 Updated by Greg Sutcliffe over 6 years ago

  • Project changed from Website to Foreman

#4 Updated by Greg Sutcliffe over 6 years ago

  • Category set to Importers
  • Target version set to 1.2.0

#5 Updated by Nate Walck over 6 years ago

I can confirm that this patch fixes the issue.

#6 Updated by Greg Sutcliffe over 6 years ago

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

Also available in: Atom PDF